This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Updating bootloader + SD from SDK13 to SDK14

I have SD 4.0.2 + 13.0.0 secure debug bootloader, and I am trying to update it to SD 5.0.0 + 14.0.0 secure debug bootloader. It transfers the data, goes to 100%, but after that it fails and is not bootable (bricked) until I flash it with segger. The bootloader debug logs show:

....
:DEBUG:Waiting for other flash operation to finish.                                                                                                                                                     
[118/62355]
:DEBUG:Waiting for other flash operation to finish.
:DEBUG:Erasing: 0x0007e000, num: 1                             
:DEBUG:Writing 0x00000057 words    
:DEBUG:Writing settings...                       
:DEBUG:Sending Response: [0x4, 0x1]
:INFO:Inside main                                              
:DEBUG:In nrf_bootloader_init      
:DEBUG:In real nrf_dfu_init                      
:DEBUG:running nrf_dfu_settings_init                               
:DEBUG:Enter nrf_dfu_continue     
:DEBUG:Valid SD + BL              
:DEBUG:Enter nrf_dfu_sd_bl_continue
:DEBUG:Enter nrf_bootloader_dfu_sd_continue
:DEBUG:Updating SD. Old SD ver: 40, New ver: 50
:DEBUG:Copying [0x00030000-0x00039000] to [0x00001000-0x0000a000]: Len: 0x00009000
:DEBUG:Finished copying [0x00030000-0x00039000] to [0x00001000-0x0000a000]: Len: 0x00009000
:DEBUG:Validated 0x00030000-0x00039000 to 0x00001000-0x0000a000: Size: 0x00009000
:DEBUG:Finished with the SD update.                     
:DEBUG:Erasing old settings at: 0x0007e000              
:DEBUG:Erasing: 0x0007e000, num: 1                      
:DEBUG:Writing 0x00000057 words                         
:DEBUG:Writing settings...                                                
:DEBUG:Copying [0x00039000-0x00042000] to [0x0000a000-0x00013000]: Len: 0x00009000
:DEBUG:Finished copying [0x00039000-0x00042000] to [0x0000a000-0x00013000]: Len: 0x00009000
:DEBUG:Validated 0x00039000-0x00042000 to 0x0000a000-0x00013000: Size: 0x00009000
:DEBUG:Finished with the SD update.                      
:DEBUG:Erasing old settings at: 0x0007e000              
:DEBUG:Erasing: 0x0007e000, num: 1
:DEBUG:Writing 0x00000057 words                                           
:DEBUG:Writing settings...                                   
:DEBUG:Copying [0x00042000-0x0004b000] to [0x00013000-0x0001c000]: Len: 0x00009000
:DEBUG:Finished copying [0x00042000-0x0004b000] to [0x00013000-0x0001c000]: Len: 0x00009000
:DEBUG:Validated 0x00042000-0x0004b000 to 0x00013000-0x0001c000: Size: 0x00009000
:DEBUG:Finished with the SD update.                                        
:DEBUG:Erasing old settings at: 0x0007e000                                 
:DEBUG:Erasing: 0x0007e000, num: 1                                         
:DEBUG:Writing 0x00000057 words                                            
:DEBUG:Writing settings...                                                 
:DEBUG:Copying [0x0004b000-0x00052000] to [0x0001c000-0x00023000]: Len: 0x00007000
:DEBUG:Finished copying [0x0004b000-0x00052000] to [0x0001c000-0x00023000]: Len: 0x00007000
:DEBUG:Validated 0x0004b000-0x00052000 to 0x0001c000-0x00023000: Size: 0x00007000
:DEBUG:Finished with the SD update.                                        
:DEBUG:Erasing old settings at: 0x0007e000                                 
:DEBUG:Erasing: 0x0007e000, num: 1                                         
:DEBUG:Writing 0x00000057 words                                            
:DEBUG:Writing settings...                                                 
:DEBUG:Verifying BL: Addr: 0x00023000, Src: 0x000514a8, Len: 0x000055e0    
:DEBUG:Bootloader not verified, copying: Src: 0x000514a8, Len: 0x000055e0  

Edit:

I think my problem is that the SDK13 bootloader was at 0x74000 with a length of 0x9000, and the SDK14 bootloader is at 0x72000 with a length of 0xB000. It seems like it is not possible to DFU update a bootloader where the UICR BOOTADDR has to change?

Parents
  • The problem was definitely the UICR, it seems that it is not possible to update from an old bootloader to a new bootloader if the new bootloader is larger. In general it seems like updating from one SDK to a newer SDK is something that's not well supported or tested. But if you think you might do it, be sure to pad out the space taken by the bootloader in case the next bootloader is larger. In my case we got it working by going from the SDK13 debug bootloader to the SDK14 non-debug bootloader.

  • Yes, it is correct that the old and the new bootloader must have the same start address, i.e. the new bootlaoder must be able to fit within the region occupied by the old bootloader. However, the SDK v13.0.0 and the SDK v14.0.0 bootloaders should be the same size, given that its non-debug to non-debug or debug to debug.

Reply Children
No Data
Related