Other Parts Discussed in Thread: TMS320F28069, SYSBIOS
I am using SYS/BIOS on a TMS320F28069 for a complex motor control application. It consists of several tasks, SWIs, HWIs and one "low latency" ISR.
The tasks are waiting on semaphores for most of the time, until the semaphore receives a post by either a SWI or HWI.
After adding another task to the application to service the I2C bus, and a SWI to periodically trigger this task, the application would experience what CCS is reporting as a stack overflow in a thread which does not exist. Debugging showed that the address which is reported as the task experiencing the stack overflow is actually the address of
_ti_sysbios_knl_Task_Module_State_0_readyQ__A[9]
It seems that the scheduler determines that a thread with priority 9 (10?) is ready to run, however there is no thread with this priority in the application. As there is no such thread, the element in the ready queue points to itself, resulting in the scheduler feeding completely wrong information to the function which checks for stack overflows.
Two more observations:
There is another task in the application which is called every tick (via sem_post from SWI). If I change this task's SWI clock period from 1 to 2, the problem seems to go away.
When I change the period for the I2C task's SWI from 2000 ticks to 3000 ticks, the problem seems to go away.
The workload of the tasks in question has no influence on the problem (I removed all workload and it didn't change anything).
What I need to know is the exact moment when the scheduler makes the wrong decision about what thread has to be executed next, so I can trace what is happening in my application.
Additional information:
CCS 5.2.1.00018
SYS/BIOS 6.33.04.39
XDCTOOLS 3.23.03.53
Compiler TI v6.1.0
Any help would be greatly appreciated!
Thanks
Torben Frenzel