Below you see Eclipse Debug output for the function that eventually calls “take()” on the command semaphore.
marTouchWireless Debug [GDB Hardware Debugging]
GDB Hardware Debugger (30.10.13 16:51) (Suspended)
Thread [1] (Suspended)
5 RedpineTask::queryFirmwareVersion() RedpineTask.cpp:761 0x080120b8
4 RedpineTask::redpineStartup() RedpineTask.cpp:2914 0x0801424e
3 SPCRootTask::run() SPCRootTask.cpp:143 0x08014e0c
2 taskFunc() IRunnable.cpp:19 0x0800c81e
1 <symbol is not available> 0x00000000
arm-none-eabi-gdb (30.10.13 16:51)
This call stack would be totally fine for Task 1 but according to pcGetTaskName() this is actually the call stack of Task 2.
This is the function I’m looking at in the debugger. Although it’s a method of the RedpineTask class it is meant to be called by other tasks (the sychronous interface i talked about). “PC->” marks the program counter…
SINT32 RedpineTask::queryFirmwareVersion(UINT8* pui8FwVersion) {
ComQueryFirmwareVersion _command(this);
deliverCommand(&_command); //puts command to queue, queue was empty before
xTaskHandle curTask = xTaskGetCurrentTaskHandle(); //<--OOPS to show the effect
signed char* task = pcTaskGetTaskName(curTask); //to show the effect
_command.waitCompletion();//<--PC of debug window
_command.getFirmwareVersion(pui8FwVersion); //i never get here due to the resulting deadlock
return _command.getRetval();
}
When Task 1 calls the function above the command is delivered and the semaphore tells Task 2 to wake up. Task 2 wakes up and checks if there are any commands in the queue. It takes the command from the queue in a function collectCommand() similar to deliverDommand() which just puts the pointer passed to it into a defined byte order. As soon as this function returns I get thrown to the place marked with “OOPS”. Actually I get thrown to the next instruction right after “deliverCommand”. The debugger tells me that I’m executing in the context of SPCRootTask. However, looking at the string named task I see that the current task is “RedpineTask” (Task 2) which never calls “queryFirmwareVersion()”.
I hope this is some known issue that can be quickly resolved. I also want to add that I have been through all CM3 specifics and I think that my settings (full interrupt preemption, Kernel Prio 0xF0, Syscall Prio = API call Prio = 0xB0) should all be correct. I’m currently not using any interrupts besides the ones the portPackage enabled.
Cheers
Martin
So it seems that a non-trivial mixup is happening somewhere