File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
lib/sdk11/components/libraries/bootloader_dfu Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -345,13 +345,14 @@ void bootloader_app_start(void)
345
345
NVIC -> ICPR [1 ]= 0xFFFFFFFF ;
346
346
#endif
347
347
348
+ uint32_t fwd_ret ;
348
349
uint32_t app_addr ;
349
350
350
351
if ( is_sd_existed () )
351
352
{
352
353
// App starts after SoftDevice
353
354
app_addr = SD_SIZE_GET (MBR_SIZE );
354
- sd_softdevice_vector_table_base_set (app_addr );
355
+ fwd_ret = sd_softdevice_vector_table_base_set (app_addr );
355
356
}else
356
357
{
357
358
// App starts right after MBR
@@ -362,7 +363,14 @@ void bootloader_app_start(void)
362
363
.params .irq_forward_address_set .address = app_addr ,
363
364
};
364
365
365
- sd_mbr_command (& command );
366
+ fwd_ret = sd_mbr_command (& command );
367
+ }
368
+
369
+ // unlikely failed to forward vector table, manually set forward address
370
+ if ( fwd_ret != NRF_SUCCESS )
371
+ {
372
+ // MBR use first 4-bytes of SRAM to store foward address
373
+ * (uint32_t * )(0x20000000 ) = app_addr ;
366
374
}
367
375
368
376
// jump to app
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ void flash_nrf5x_flush (bool need_erase)
37
37
{
38
38
if ( _fl_addr == FLASH_CACHE_INVALID_ADDR ) return ;
39
39
40
+ // skip the write if contents matches
40
41
if ( memcmp (_fl_buf , (void * ) _fl_addr , FLASH_PAGE_SIZE ) != 0 )
41
42
{
42
43
// - nRF52832 dfu via uart can miss incoming byte when erasing because cpu is blocked for > 2ms.
You can’t perform that action at this time.
0 commit comments