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 checking with CMSIS-RTOS RTX

So I've run into this before, and wasn't able to figure it out, other than very painful trial-and-error guesswork.

I'm using CMSIS-RTOS RTX on Energy Micro EFM32GG devices, and I now have a blown stack. When the stack checker finds a blown stack, it calls os_error(uint32_t err_code). However, I am not able to figure out which thread blew its stack!. I tried the following in my os_error function, but it doesn't work; id is always NULL.

  static volatile osThreadId id;
  id = osThreadGetId();

Also, is there any way to get stack usage to help in optimizing their allocation?

BTW - I'm using the CodeSourcery GCC with Eclipse.

Any advice? Thanks!

0