We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Sorry if my question is very simple... But is it possible to use microlib together with RTX (Cortex M0) ? I have read some of the doc about the microlib, but I'm not totally sure of the answer to my question.... Anyone ?
And I will answer (part of) my own question :) It was the dreaded stack size! I keep wondering why after 30+ years of software development one still falls into this problem (maybe I'm the only one?)! In an effort to "optimize" the RAM usage, the stacksize in the startup file was lowered (to 128 bytes). This had the system crash after a few minutes. Lowering it to 96 had it crash immediatly, raising it to 128 made the system stable (it is now fixed at 256 bytes :) "Next time I see something similar I will check the stack as the first step"...(I have said that to myself many times before :D)
The question still stands, are there any problems using Microlib with RTX ?
Don't you have task stack overflow checks enabled?
Tamir, yes I have, and sometimes they also trapped. But often I just see the before mentioned errors (long delays and threads stopping). When I think of it, when/why is the stacksize in startup.s used (I know it is used when main runs until the RTX init takes over) I run with user supplied stacks in all threads, also the init thread
When I think of it, when/why is the stacksize in startup.s used (I know it is used when main runs until the RTX init takes over)
It is used before RTX takes control or if no RTOS like RTX is used.
Hi Jameel, yes, that is also my understanding. But if I lower the stacksize in startup.s too much, the system crashes! There must be something else ?
If that global stack overflows, then the startup code may overwrite global variables used by the C library, the OS or by any of the threads.
Next thing is that you have multiple stacks in the startup file. One stack is used during startup - before you start to use threadspecific stacks.
But the startup file also has stacks for other processor modes. Like interrupt processing.
Good catch. That fact had slipped my mind.
Thanks Per! That explains it perfectly!
Any input on using the microlib with RTX ?