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

flashwrite

i need use flashwrite in my code, but i found sometims when i write data in flash, the BLE connecting sometimes is borken,  
i used this funciton flash_word_write(uint32_t * address, uint32_t value)

it was said when you need to use softdevise , you need to use other flash write funciton?  but i have not found that function, can you provider the API for me?

  • Hi

    If you use a softdevice you need to use the dedicated flash access functions the softdevice provides itself. Normally these are the functions "sd_flash_write" and "sd_flash_erase_page". The specification for these functions can be found in the Nordic InfoCenter in the Softdevice documentation.

    Keep in mind that these two functions only start the write/erase operation. Once the operation has been completed (or failed) the softdevice interrupt is triggered and a event can be read from the event queue of the softdevice.

    The Nordic's SDK provides some higher level libraries for flash access with or without softdevice usage (check out fstorage library in the SDK). These high level API can be used, but it's also possible to use the softdevice functions directly as we do in our projects. 

    Maybe one additional remark. If the BLE is active there is a chance that a flash operation may fail. More details can be found here.

    Regards Adrian 

Related