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

fstorage problem

main (5).c

I have attached my main code here.Please have a look at it.I am using fs_store to write in flash location in the on_adv_report() function under the switch case C:

I am observing that once I place a breakpoints inside it I am not able to go to another breakpoint and if the breakpoint is directly placed after it completes store operation the chip is getting reset.

1)how do I avoid chip getting reset? 2) Can fstorage functions are only meant to be used inside main() ? Can we not call fs_Store outside the main in any other function? 3) Is peer_manager necessary for implementing fstorage operations? 4) Can you provide an example where fstorage or only fs_store operation is used in function other than main()? Expecting reply asap as I am stuck for demo.Thanks

Parents
  • Hi,

    If you hit a breakpoint in your code while the softdevice is enabled, the softdevice will assert when you continue execution, due to unhandled timing-critical events.

    1. Don't place any breakpoints in your code, unless you need to debug that specific part of the application. You can single-step the code from this point until you hit a softdevice specific call, but then you will get an assert.
    2. In general, you should spend as little time in the interrupt handlers as possible, as it will block other events with equal or lower priority. fs_store can be used outside main. This function will only schedule writes, meaning it should not block the CPU for long it called from event handlers.
    3. No, peer manager is not necessary for using fstorage, actually it's the other way around; peer_manager use FDS for storing bonding information, which again depend on fstorage. fstorage use the softdevice flash API for executing flash operations, meaning it requires the softdevice to be present. In SDK 14.0.0 and above you can also use FDS/fstorage with NVMC backend if you are not using softdevice.
    4. I'm not sure what you are expecting here. There are two examples of using fstorage in this GitHub repository. It should not be any problem to move fstorage part to other functions or even other files.

    If you need help with your demo, please post a thread describing the details of the issue.

    Best regards,

    Jørgen

Reply
  • Hi,

    If you hit a breakpoint in your code while the softdevice is enabled, the softdevice will assert when you continue execution, due to unhandled timing-critical events.

    1. Don't place any breakpoints in your code, unless you need to debug that specific part of the application. You can single-step the code from this point until you hit a softdevice specific call, but then you will get an assert.
    2. In general, you should spend as little time in the interrupt handlers as possible, as it will block other events with equal or lower priority. fs_store can be used outside main. This function will only schedule writes, meaning it should not block the CPU for long it called from event handlers.
    3. No, peer manager is not necessary for using fstorage, actually it's the other way around; peer_manager use FDS for storing bonding information, which again depend on fstorage. fstorage use the softdevice flash API for executing flash operations, meaning it requires the softdevice to be present. In SDK 14.0.0 and above you can also use FDS/fstorage with NVMC backend if you are not using softdevice.
    4. I'm not sure what you are expecting here. There are two examples of using fstorage in this GitHub repository. It should not be any problem to move fstorage part to other functions or even other files.

    If you need help with your demo, please post a thread describing the details of the issue.

    Best regards,

    Jørgen

Children
Related