BLE Interrupts and Flash Operations

Hi,

I use flash read operations at the BLE interrupts, because I need some of the stored informations. However, while I am doing another flash operations and BLE interrupt arrived at the same time the firmware stucks at the wait_for_flashready(&fstorage);.  

Before doing any flash operation (Read/Write/Erase) I am looking for f_storage readyness. The BLE Interrupts are crucial and when they arrived they have to evaluate by firmware, but also I have to solve this conflict. What should I do?

Should I remove the flash read operations in BLE Interrupts?

Sincerely,

Parents Reply Children
  • Hi Elfving,

    Unfortunately I cannot use RTOS in my project. I want to know the real cause of the conflict to produce a real solution. I remove all of the flash read functions in the BLE interrupts and as I see there is no problem no more. But I am not sure about the problem's real cause though. 

    For short, did this conflict happened because of this state or was it due to something else?

    Sincerely,

  • Are you using the bare-metal SDK, nRF 5 SDK, or plain bare-metal? I guess the solution is the same though, you need some sort of buffer or scheduler of tasks you can do outside the interrupt.

    cemile nur damnali said:
    But I am not sure about the problem's real cause though. 

    I guess the actual fault depends on the situation, but generally, BLE tasks are very time-sensitive and need to be handled right away. You can study this further by looking at the error you've gotten, but I believe the answer will be the same. It is worth noting that if you have something else you need to do that is equally time-sensitive, we've developed multi-core SoCs for this very reason - you can eg. get the extra core on the 54L to do this flash writing. 

    Regards,

    Elfving

Related