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

Can firmware write to FLASH directly, not using fstorage, without bothering the SoftDevice?

Hello, I just want to clarify a secondary takeaway from my post:

https://devzone.nordicsemi.com/f/nordic-q-a/60714/best-approach-to-store-nonvolatile-data

I would like to confirm that we can access our nrf52832 registers to write to FLASH (ie not using nordic drivers, eg fstorage) without bothering the SoftDevice?  Meaning, will this work and do we need to be careful not to conflict with, for example, SoftDevice register actions or flash access?

Thanks.

Parents
  • Hi,

    If you do not use a softdevice in your application, or the softdevice is disabled, you can access the NVMC registers as much as you want to write/erase flash.

    If a softdevice is enabled, you can only do flash operations through the softdevice flash API. BLE has critical timing requirements. If the softdevice fails to handle the events within time, the radio link may be lost. During a flash write/erase operation, the CPU is halted, preventing the softdevice from handling events. 

    Through the softdevice flash API, flash operations are performed asynchronously between BLE events, determined by the internal scheduler in the softdevice.

    Accessing the NVMC registers directly with a softdevice enabled will likely lead to a softdevice assert.

    Best regards,
    Jørgen

Reply
  • Hi,

    If you do not use a softdevice in your application, or the softdevice is disabled, you can access the NVMC registers as much as you want to write/erase flash.

    If a softdevice is enabled, you can only do flash operations through the softdevice flash API. BLE has critical timing requirements. If the softdevice fails to handle the events within time, the radio link may be lost. During a flash write/erase operation, the CPU is halted, preventing the softdevice from handling events. 

    Through the softdevice flash API, flash operations are performed asynchronously between BLE events, determined by the internal scheduler in the softdevice.

    Accessing the NVMC registers directly with a softdevice enabled will likely lead to a softdevice assert.

    Best regards,
    Jørgen

Children
Related