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

How to write to flash with sd_flash_write?

Using SDK v11.0 and SD v2.0.0 on nRF52832 with ARM GCC.

I want to copy page(s) content to another page(s), I tried the following but couldn't succeed.

When I used the sd_flash_write command, the return value is 1 (NRF_ERROR_SVC_HANDLER_MISSING) and content is not copied there. I used the command directly like this:

err_code = sd_flash_write(dest_addr, src_addr, 1024);

Am I missing something?

Alternatively, to achieve the same thing, I looked at pstorage but I was not able to find how to specify both the target and source address in a single step. I could, however, use the NVM commands which work fine, but that is taking very long to finish the process.

Any help would be appreciated.

Parents
  • Hello,

    I know it may already be too late, depending on how much of the development you have done, but I recommend you consider moving to a later version of the SDK. Right now we are at version SDK15.3.0. Quite a lot has happened with flash handling since SDK11.0.0.

    If you use the softdevice, you can't use the NVMC backend. You must use the sd_flash... API. 

    Have you enabled the softdevice before calling sd_flash_write?

  • Yes, I am well aware of the development happening around and doing this as part of an upgrade.

    No, I did not enable the softdevice. I read the following in the SD API documentation for 2.0 and assumed it is not necessary to enable the softdevice.

    "If the SoftDevice is not enabled no event will be generated, and this call will return NRF_SUCCESS when the write has been completed"

  • naveenj said:

    No, I did not enable the softdevice. I read the following in the SD API documentation for 2.0 and assumed it is not necessary to enable the softdevice.

    "If the SoftDevice is not enabled no event will be generated, and this call will return NRF_SUCCESS when the write has been completed"

     That is true. Is the softdevice present in the project? Has it been programmed to the device?

Reply Children
Related