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 max # tasks stuck at 18

Hi

I had a problem that I cannot figure out. I have 19 tasks/threads declared and created in my system. The documentation says that I can have up to 250 threads.

I found that my 19th thread is not being created. The create_thread call returns a id of is 0 for the 19th thread.

I have edit the configuration file to for 20 threads (the RTOS osTimer thread takes up one) and plenty of stack space for it.

All 19 threads have their own user stacks and I have made sure there is plenty of memory allocated to them.

If I remove one of my threads so there are 18, all 18 are created including the old 19th one. So there is nothing wrong with the way that that thread is defined because it will work if there are no more than 18 user threads.

What am I missing that is keeping me from creating more than 18 threads?

Parents
  • I was trying to debug the thread_create by stepping into the RTOS source and followed it through and it return a non 0 for the id this time!!! I did not change anything but yet now it is returning a proper thread id

    I don't get it. There is no reason why it should be working now

    I added two additional threads to try to break it but those worked as well (increased cnt appropriately).

    I don't understand it. I don't like things clearing up on their own without a reason becasue they could break again.

    Thank you for your help in trying to figure this out but it seems to have fixed itself and is working now.

Reply
  • I was trying to debug the thread_create by stepping into the RTOS source and followed it through and it return a non 0 for the id this time!!! I did not change anything but yet now it is returning a proper thread id

    I don't get it. There is no reason why it should be working now

    I added two additional threads to try to break it but those worked as well (increased cnt appropriately).

    I don't understand it. I don't like things clearing up on their own without a reason becasue they could break again.

    Thank you for your help in trying to figure this out but it seems to have fixed itself and is working now.

Children
No data