Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

freertos + fds

Hi. I am trying to add FDS to my application where I used freertos and ble. I tried few things always ending with hardfault, one time it was from Freertos scheduler and the other times I cannot really tell.

- first I was trying to simply add fds_record_write() as fds was already initilized by peer_manager

- second I removed peer manager and initlized fds myself, I got the fds_init event but on fds_record_write() attempt it failed with harfault - altthough call to fds_record_write() itself returned success

- third I took raw (unmodified) ble_app_hrs_freertos and tried to add fds_record_write() on every battery_level_update. 

Until I tried third solution I was thinking that maybe something was witihin my app but looks like it is something (bug?) with fds/freertos. 

Can someone advise me what is proper way to use FDS with Freertos?

Thanks

Parents
  • It looks like problem is with writing data to flash from interrupt context. All of 3 attempts I was trying to use fds_record_write() from either gpio interrupt or freertos timer interrupt. However I did not find any documentation that would confirm this.

    I tried using it from main context and works ok.

    It would be nice if someone can confirm this and either fix documentation or show me where in documentation it is said that function cannot be used from interrupt context.

    Regards

Reply
  • It looks like problem is with writing data to flash from interrupt context. All of 3 attempts I was trying to use fds_record_write() from either gpio interrupt or freertos timer interrupt. However I did not find any documentation that would confirm this.

    I tried using it from main context and works ok.

    It would be nice if someone can confirm this and either fix documentation or show me where in documentation it is said that function cannot be used from interrupt context.

    Regards

Children
No Data
Related