Hi,
Most of my projects are for simple real-time systems where tasks are started, but never deleted. They must persist through the operation of the device.
I usually use the default task named Monitor Task, then the ST Touch GFX GUI task and then various other tasks such as Ethernet/WifFi, and their interface tasks, and a real-time hi priority process control task, timer timer triggered using deferred interrupts, usually using notification, not sem’s.
In all cases these tasks must run continuously.
My policy has been if a task is going to run forever make it static. This makes debugging easier because the task stack and buffer are at fixed locations which I can optimise in terms of which memory and MPU settings to use. And I know exactly where they are. This also takes the heap out of the mix as a potential problem causing feature.
I also do the same for queues, semaphores etc.
On the odd occasion I have a number of transient tasks which are heavy memory users and that can be deleted on completion I use the dynamic versions for these.
Memory shortage is not usually an issue as I am generally using hi end processors with plenty of RAM and external ram.
My question:
- Is my policy sound or should I be considering other factors?
- Have you any guidelines or recommendations on this issue.
Kind Regards
Rob