I am new to STM32, Circle OS and all that (but not new to C or embedded stuff). I just started my first CircleOS application and I am surprised at how slow it is running. It is doing next to no work. Currently my application handler seems to be executing at about 5 Hz or 10 Hz if I comment out half the code. Could someone please help me with my application handler is called so infrequently or is taking so long to execute. All code is exactly as per a new CircleOS project with this application handler:
But it still doesn't explain why calls to the application handler halve when all code is commented in. Surely this code could not be taking so long to execute that it skips every second call to the application handler??? The following code executes exactly twice as often as the code above!
o me it would make more sense to call the application handler whenever the OS is not doing something rather than having the processor waiting 100ms or more between calls to the application handler. You have to add handlers to get any useful performance out of the OS. It would be more practical if in the application handler you took care of how often parts of your application were called. ie every 10ms do this, every 23ms do that...
We don't call too often the application handler to avoid saturation. All the tasks (except the MEMS that is handled by a high priority interrupt) are called sequentially from the same systick interrupt. An a long 'application' can be accepted if it is not call at every tick.
Note that if you need to call more often your application handler, you can easily redirect the handler to your application, and eliminate the division. Just restore the original handler when you leave the application (in order to provide the standard behaviour to any other application).