This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Stack Overflow after mutex but no stack is used

Took some time this week and picked up my eval system with MCB1760 with tools to continue testing de keil IDE.
I was testing a mutex when strange things happend.
Normal task16 is sending and receiving serial data and send routines are protected by a mutex.
everything works fine.
When the button is pressed in task7 it should use the serial port and send out a message.
so it has to claim the serial port and i use os_mut_wait.
If the mutex is free (program 16 not sending) it works, if program 16 has the mutex (count=1 or 2) the following is happening (used OS Tasks and system):
task16 priority is increased (OK), state = running (OK) and stackload = Overflow (NOT OK)
task7 state = wait_MUT
breakpoint at void os_error (U32 err_code) entered with 0x01 (= OS_ERR_STK_OVF)

To find the problem i created a user stack and filled it with x16

static U64 task16stack[400/8];
memset(task16stack, 0x16, sizeof(task16stack));
tskID16 = os_tsk_create_user(task16, task16priority, &task16stack, sizeof(task16stack));

before and after only about 50% of the stack has been used, the magic number 0xE25A2EA5 is still in place in this stack (and direct following user created stack).

Any idea's why and which tools from the IDE (good leason) to use to debug this problem?