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

Bootloader app copy dual bank

Hello,

I'm running into trouble when doing a DFU of the app only using Secure Bootloader SDK13.

When it uses Bank1, it loads the whole image to the empty space after the current valid app. When it reboots, I can see that it's copying the image to bank0, so far so good.

At this point, I got a reset during the copy because of my watchdog (set to 10 seconds). It resumes copying as seen on the log (which is great!):

:DEBUG:Erasing: 0x00038000, num: 1
:DEBUG:Erasing: 0x00058000, num: 1
:DEBUG:Erasing old settings at: 0x0007f000
:DEBUG:Erasing: 0x0007f000, num: 1
:DEBUG:Writing 0x00000057 words
:DEBUG:Writing settings...
:DEBUG:Erasing: 0x00039000, num: 1
:DEBUG:Erasing: 0x00059000, num: 1
:DEBUG:Erasing old settings at: 0x0007f000
:DEBUG:Erasing: 0x0007f000, num: 1
:DEBUG:Writing 0x00000057 words
:DEBUG:Writing settings...
:DEBUG:Erasing: 0x0003a000, num: 1
:INFO:Inside main
:DEBUG:Reset reason 0x00000006
:DEBUG:In nrf_bootloader_init
:INFO:In real nrf_dfu_init
:DEBUG:running nrf_dfu_settings_init
:DEBUG:Enter nrf_dfu_continue
:DEBUG:Valid App
:DEBUG:Enter nrf_dfu_app_continue
:DEBUG:Copy app to bank0 @0x3a000, size 0x20fc8 (offset from base address 0x1b000)
:DEBUG:Erasing: 0x0003a000, num: 1
:DEBUG:Erasing: 0x00048000, num: 1
:DEBUG:Erasing old settings at: 0x0007f000
:DEBUG:Erasing: 0x0007f000, num: 1
:DEBUG:Writing 0x00000057 words
:DEBUG:Writing settings...
:DEBUG:Erasing: 0x0003b000, num: 1
:DEBUG:Erasing: 0x00049000, num: 1
:DEBUG:Erasing old settings at: 0x0007f000
:DEBUG:Erasing: 0x0007f000, num: 1
:DEBUG:Writing 0x00000057 words
:DEBUG:Writing settings...

But then, when the CRC is checked, it's not the right one, so I did a memory dump to check if the copied image was right and I noticed that some pages are erased, but NOT written here from 0x3A000 to the end (pages erased directly after reboot). (during my tests, I got 17 pages not written then it worked for the few remaining pages and after another test I got 12 pages not written).

So, I tried reloading the WDT during the copy and it worked well, as the device didn't reset, but I'm wondering how we can do better as there is this mechanism that let the copy resume but it doesn't seem to be entirely functional.

Cheers, Cyril

Parents Reply Children
No Data
Related