freertoscortex-m

FreeRTOS stuck in vListInsert


I'm using FreeRTOS 10.0.1 and have a really hard problem, trying to solve it for days, getting my code to run on a CC1310 (Arm Cortex M3). I use the TI SDK and read data from a I2C device, first time is successful, second gets stuck in the vListInsert, with the pxIterator->pxNext points to itself, so the for loop is infinite.

The driver is waiting for a SemaphoreP_pend(), if I set a breakpoint, I can see that the post gets called, but the kernel is just stuck.

I have set the SysTick and PendSV isr prio to 7 (lowest).

The i2c interrupt is prio 6.

configMAX_SYSCALL_INTERRUPT_PRIORITY is set to 1.

There is no stack overflow as far as I can tell.

Please help, how do I debug this problem ?

Best regards Jakob


Solution

  • I solved the Issue, after getting help from @realtime-rik, I decided to check all my interrupt priorities again. They where all ok, but in the process I discovered two things.

    1. The TI-SDK had structs with buffers in some of the drivers, which where rtos dependent, so their size should be set manually for each driver depending on the rtos usage.
    2. I called the board init function in main before the scheduler was started, and inside board init, one of the drivers was using FreeRTOS queues. I have moved board init to my thread now.