This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Problems using fstorage to write to flash (using it alongside mesh sdk)

Hi, currently I am using fstorage alongside ble-mesh to store some data in flash. Currently however, writing with fstorage seems to be successful only about 50% of the time, with the other failing 50% giving me a timeout error (error code 13, NRF_TIMEOUT_ERROR). The memory areas between the mesh data and the fstorage do not overlap. Reading using fstorage so far works just fine. Are there any ideas to what might be causing this issue?

I suspect perhaps the fstorage operations might be competing with the mesh events in some sort of scheduler but I am not sure.

Thanks in advance

PS. I am aware that the mesh SDK offer its own thing for managing flash data (flash manager) but i used fstorage due to my greater familiarity with it plus the fact that there are no flash manager examples in the SDK, so I would prefer if i can stick with my current fstorage solution, however if this issue is unfixable I am open to trying out the mesh SDK's flash manager.

  • Hi Jeffe, 

    If you have a look at the mesh_flash module you can find that the flash is accessed directly via NVMC not via softdevice. The flash activity occurs inside mesh timeslot can access flash directly via NVMC. 

    A good example of using the flash manager is in the enocean_switch example where we store the enocean information to flash. This documentation is also very useful.

  • Oh, so the flash manager of the mesh SDK doesn't actually use the softdevice by directly uses the NVMC - and by extension any flash storage implementation that directly use the NVMC and skip the softdevice should also work?

    I will take a good look at stuff you recommended, thanks!

  • Hi Jeffe, 
    I'm checking with the mesh team on what should be the best way of doing this. But as it's suggested in the documentation here:

    It's preferred to use Flash Manager. Note that the reason it can access flash directly without using softdevice API is because it's running inside Mesh timeslots. If you use your own flash library that access flash via NVMC there is a risk that it operates outside Mesh timeslots. This will cause a fault. 

  • I see, so that is why flash manager is the best option. I have went ahead and decided to use that via mesh_config. Thank you for all the help

Related