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

Flash Manager Example (SDK for Mesh 3.1.0)

Hi, I was wondering if there was an updated example for using the Flash Manager correctly with SDK for Mesh v3.1.0?

Some info about my setup:

Up until now I have been using code based off of the code provided here:

https://devzone.nordicsemi.com/f/nordic-q-a/31170/storing-values-using-flash-manager

(see Kristen's post near the bottom).

My code works more or less okay after being upgraded to SDK for Mesh v3.1.0, however one of the function calls are deprecated as of this version, see my thread:

https://devzone.nordicsemi.com/f/nordic-q-a/43743/flash-manager-question-mesh-sdk-v3-1-0/171416#171416

Namely, the function call flash_manager_entry_read() should be used instead of flash_manager_entry_get() (which is now deprecated).

I tried replacing the call to flash_manager_entry_get() with one to flash_manager_entry_read() as well as passing an empty buffer for the returned data - but the data I am getting back does not look correct. I see that there are some notes about alignment in the header file.

Could you please provide an example on how to correctly use flash_manager_entry_read() in place of flash_manager_entry_get()? I dug through the SDK but could not find any.

Regards,

  • Hi,

    What is the return value from flash_manager_entry_read()? Any return value other than NRF_SUCCESS should indicate what might be wrong.

    I assume that your original project is from nRF5 SDK for Mesh 1.0.0 (which seems to be the version used in the DevZone thread that you linked to). Have you followed the migration guide when porting the project? (Or, alternatively, have you started a 3.1.0 example and copied parts of code into that one that you have rewritten to fit with the new SDK version?) There might be something there that you have missed.

    Unfortunately there is little use of the flash manager library in the examples, but there is one instance of flash_manager_entry_read() in examples/light_switch/provisioner/src/main.c, and one in examples/enocean_switch/src/flash_helper.c. In both of those cases the read function is used in a helper function, and flash manager is used to store the contents of a struct.

    In general it is hard to tell what might be the problem when all we know is that "the data [you are] getting back does not look correct". What data have you previously written, how did you write it, how do you read it back, and what does it look like then?

    Regards,
    Terje

  • "Have you followed the migration guide when porting the project? (Or, alternatively, have you started a 3.1.0 example and copied parts of code into that one that you have rewritten to fit with the new SDK version?) There might be something there that you have missed."

    Hi, sorry I should have been a bit more specific about the data I read back. I will go through the migration guide again and get back to you.

    Regards,

Related