Flash memory usage in Mesh sdk_5

Hello!
I am working on a project I have set "sensor/server" as my starting point. The sensor is successfully interfaced with NRF52 I need to store the calibrated data of the sensor once the sensor achieve its accuracy, so that whenever the device is power down, the sensor then loads that calibrated data from flash to quickly stabilizes its status. The size of serialized data is 2280 bytes. To store this data I have tried fstorage example but I think the documentation suggest to stick to flash_manager provided in the mesh SDK. The page/File size is 128 bytes (if I am not wrong), I will not be able to store this data in a single page/File, what should I do to store 2280 bytes in the flash memory.
Thanks

Parents
  • Hi msalmankhan334,

    To store this data I have tried fstorage example but I think the documentation suggest to stick to flash_manager provided in the mesh SDK.

    Are you talking about the advice on this page? Base on the discussion regarding fstorage there, I would conclude the same as you did, that is to stick with flash_manager

    The page/File size is 128 bytes

    I checked the Flash Manager documentation. I think the 128 bytes you mention is the row for the field "Data" of the flash entry format?
    If so, that is just the limit of one entry. Could you please try just split up your data and store it in multiple entries? Based on the number from your question and in the documentation, I don't think storing that much would be a problem at all.

    Additionally, since the data you store is calibration data, I understand that it would only be done once or very few times over a device's life, right? If so, there should be even less concerned with writing many flash entries.

    Best regards,

    Hieu

Reply
  • Hi msalmankhan334,

    To store this data I have tried fstorage example but I think the documentation suggest to stick to flash_manager provided in the mesh SDK.

    Are you talking about the advice on this page? Base on the discussion regarding fstorage there, I would conclude the same as you did, that is to stick with flash_manager

    The page/File size is 128 bytes

    I checked the Flash Manager documentation. I think the 128 bytes you mention is the row for the field "Data" of the flash entry format?
    If so, that is just the limit of one entry. Could you please try just split up your data and store it in multiple entries? Based on the number from your question and in the documentation, I don't think storing that much would be a problem at all.

    Additionally, since the data you store is calibration data, I understand that it would only be done once or very few times over a device's life, right? If so, there should be even less concerned with writing many flash entries.

    Best regards,

    Hieu

Children
  • Okay , I understood.
    Is there any sample code to use flash manager or any reference example to start working on, because its very hard especially for comer to accomplish this?

  • Hi msalmankhan334,

    Sorry for the late follow up.

    Unfortunately, there are no sample or reference for the Flash Manager.
    There is an application of the Flash Manager in mesh/core/src/mesh_config_flashman_glue.c.

    I tried to look into it to see if I can quickly write some code snippets that works (without any warranty). However, I was not successful in producing any.
    The experience did make me agree that proceeding with the Flash Manager can be quite challenging.
    There are other things you would also need to look into such as memory layout.

    Meanwhile, the nRF5 SDK for Mesh is in maintenance, and support for it will be very limited.

    What stage are you currently at with your project? If you are still in the early stages, you might want to consider using the nRF Connect SDK instead.

    Best regards,

    Hieu

Related