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

FDS not functional after bootloader application startup

I'm using the IoT bootloader from NRF52 SDK 14.2. When the bootloader has nothing to do and starts the main application, the FDS calls all fail in the main application. When I clear the UICR (nrfjprog -f nrf52 --eraseuicr), my main application launches (without using the bootloader) and the FDS calls work, it is only when the main application is launched through the bootloader that they fail. What am I missing?

Parents
  • I figured out the issue. The FDS library normally uses the top of flash (0x7F000-0x7FFFF) to store the data, but when a bootloader is present, it always stores itself in a page directly under the bootloader. In my case, my bootloader was at 0x78000 and therefore FDS was looking for my previously stored data in 0x77000-0x77FFF instead of 0x7F000-0x7FFFF. The FDS library determines where it can store the data by looking at the BOOTLOADER_ADDR UICR. I hacked the FDS library to always look for data in the top of flash (0x7F000-0x7FFFF) regardless of the BOOTLOADER_ADDR UICR setting. I just have to make sure that my bootloader start address is such that it doesn't extend into the FDS data area. Hope this helps someone else. 

Reply
  • I figured out the issue. The FDS library normally uses the top of flash (0x7F000-0x7FFFF) to store the data, but when a bootloader is present, it always stores itself in a page directly under the bootloader. In my case, my bootloader was at 0x78000 and therefore FDS was looking for my previously stored data in 0x77000-0x77FFF instead of 0x7F000-0x7FFFF. The FDS library determines where it can store the data by looking at the BOOTLOADER_ADDR UICR. I hacked the FDS library to always look for data in the top of flash (0x7F000-0x7FFFF) regardless of the BOOTLOADER_ADDR UICR setting. I just have to make sure that my bootloader start address is such that it doesn't extend into the FDS data area. Hope this helps someone else. 

Children
Related