cancel
Showing results for 
Search instead for 
Did you mean: 

Infinite loop in stm32_list.c

JFisher-Legato
Associate III

Hello,

I'm having trouble with our BLE app where our code gets stuck in an infinite loop in `stm_list.c`, specifically in the `passPendingToActive()` function.

When I expand the `AmmPendingCallback` variable in CubeIDE, I see this:

JFisherLegato_0-1766354385493.png

And following the logic through of the passPendingToActive() it seems like we'll never recover from this. The application becomes unresponsive.

Some relevant details:

  • Our application is running in ThreadX
  • We are abusing the BLE thread (HCI Async Event Task) currently (doing a Flash Erase) - this obviously will be moved off into an application thread, but currently it is in the BLE thread:
    JFisherLegato_0-1766410981989.png

     

I suspect the fact that we're abusing the BLE thread is what's causing this, but in any case it seems like incorrect behavior. The LST_is_empty (&AmmPendingCallback) check is never TRUE, so the while loop never exits.

Any thoughts on what could be causing this?

Cheers,

Jonathan

1 REPLY 1
TDK
Super User

Set a hardware watchpoint to figure out when and where the list gets modified with a link to itself.

If you feel a post has answered your question, please click "Accept as Solution".