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

pstorage_update() not working when called before start_bootloader()

Hello iam using softdevice 110 and SDK 10.0.0, i have implimented dfu in my project, i want to update a region in EEPROM by calling pstorage_update() function before calling start_bootloader() in dfu_app_handler.c, i have written code in function dfu_app_on_dfu_evt under BLE_DFU_START event, problem is pstorage_update() is returning NRF_SUCCESS but i cant see changes in EEPROM Memory. kindly help me in this.

Thank you, Sunil Kumar

Parents
  • Hi Sunil,

    When you call pstorage_update() the flash won't be written right away. It will queue the command and then send the update command to softdevice. Then the softdevice will schedule the flash execution. So if you call bootloader_start() right after pstorage_update(), the chip will reset before the flash operation is executed.

    What you need to do is to wait for the call back of pstorage to make sure the flash is updated properly, before you call bootloader_start().

Reply
  • Hi Sunil,

    When you call pstorage_update() the flash won't be written right away. It will queue the command and then send the update command to softdevice. Then the softdevice will schedule the flash execution. So if you call bootloader_start() right after pstorage_update(), the chip will reset before the flash operation is executed.

    What you need to do is to wait for the call back of pstorage to make sure the flash is updated properly, before you call bootloader_start().

Children
Related