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

Halt on SOFTDEVICE_HANDLER_INIT after previous access of flash via nrf_nvmc driver

Hi all,

I am facing issues when initializing and enabling the Softdevice after using the nrf_nvmc driver to erase and write flash pages. The project shall have the ability to access write the flash before the Softdevice is enabled to update parts of our own bootloader.

In the steps to reproduce the crash on my system are:

  1. System startup
  2. Erasing a single flash page using nrf_nvmc_page_erase()
  3. Writing to the previouse erase flash page nrf_nvmc_write_words()
  4. Verify the written data -> successfull
  5. Erasing the flash page again using nrf_nvmc_page_erase()
  6. Initialize and enable the Softdevice via SOFTDEVICE_HANDLER_INIT()

The macro calls sd_softdevice_enable() within softdevice_handler_init(). Calling sd_softdevice_enable() halts the processor. Debugging with eclipse shows:

image description

When we remove the erasing and writting prior SOFTDEVICE_HANDLER_INIT() the Softdevice is enabled successfully. The code is running on nRF51 and nRF52 and we are facing the same problem.

Our setup is:

  • PCA10028 (V.1.0.0) and PCA10040 (V.1.1.0)
  • SDK 11
  • Softdevice S130 and S130 in Version 2.0.1

Any hints on that issue?

Related