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

CMSIS-RTOS RTX problem with stack overflow

I have a weird problem with my CMSIS-RTOS RTX application. Application consists of 3 threads with user-provided stacks.

osThreadDef(USBRead,      osPriorityHigh,        1, 300);
osThreadDef(DCMotorDrive, osPriorityAboveNormal, 1, 400);
osThreadDef(ScanProduct,  osPriorityNormal,      1, 200);

With this configuration, everything goes smoothly. All threads are created, first runs USBRead thread, which blocks on empty Mail queue. After that, DCMotorDrive starts running and so on.

However, if I change USBRead stack to 200 bytes, debugger says that DCMotorDrive thread is in stack overflow. That happens as soon as USBRead blocks and thread switch begins. If I put a breakpoint on the very beginning of DCMotorDrive thread, it never reaches it.

Does anybody have experience with this? Is it some bug in debugger (that actually USBRead thread got to stack overflow), or something I have overlooked?

0