Is there a FreeRTOS howto for Cortex M7 about how to supervise/trace a system with few tasks (what features of kernel to be used)

半城伤御伤魂 提交于 2020-05-16 02:44:10

问题


I'm slowly assembling the picture of how to use FreeRTOS in a real world application. I've read a lot of partial features (stack supervision, memory, malloc etc...). But haven't anywhere found a good instruction, what "supervision" to use to be able to follow the performance of tasks, system also after debugger is not connected anymore...

Can anyone help with some pointers, advices? What features do you activate when a FreeRTOS app is designed? How do you supervise, what is going on with tasks?

I'd rather read something short, to try feature by feature and see how it works. Something more for beginners. I understand, I have the documentation, but what I'm after is gradual introduction in FreeRTOS with examples. Maybe I overlooked a good info to read...

Let me illustrate it with few questions that I don't have the answers for:

  • Should I have a separate supervision task, that gathers the info about other tasks (state,memory,..) ?
  • What features should be used to supervise FreeRTOS based app in an "professional" way?
  • Should I use ITM/SWO, or maybe RTT?
  • Do you leave serial console on the system to supervise it?

Thanks in advance, regards.


回答1:


I'm slowly assembling the picture of how to use FreeRTOS in a real world application. I've read a lot of partial features (stack supervision, memory, malloc etc...). [...] Can anyone help with some pointers, advices?

On the freeRTOS website, you find a lot of documentation for introduction as well as to understand detail features in depth.

I'd rather read something short, to try feature by feature and see how it works. Something more for beginners. I understand, I have the documenation, but what I'm after is gradual introduction in FreeRTOS with examples. Maybe I overlooked a good info to read...

There is also a lot of third-party documentation. You may want to read general literature about RTOSes and how to use them: First, because many of them refer to one of the most well-known OSS implementation - freeRTOS. Second, because when working with RTOS, one has to take care of virtually the same aspects independent from which RTOS implementation is used.


How do you supervise, what is going on with tasks?

This depends on the purpose of supervision:

  1. If the system that runs the RTOS is critical in some meaning (e. g., it implements functional safety or security requirements), you'll probably need certain supervision measures at runtime that depend on the type and level of criticality. Violating the expectations of such supervision usually triggers the system to switch off and fall into some kind of safe/secure operation mode.

  2. More usually, you need supervision to debug or trace the application during development and testing to gain insights why certain errors appear in system behaviour, or how long the tasks/ISRs in the system need to execute and how long they are suppressing other contexts in doing so. This will often allow you to attach a debug/trace adapter to the system all the time. Violating the expectations here means guiding the developer to a remaining error in the system under development/test.

  3. For many kinds of applications, you may have to measure (and log) the task timings over larger periods in order to get reliable statistics under controlled laboratory (or real-life) conditions. Then you usually cannot keep a debug/trace adapter dongle at the embedded system because this would disturb the procedures under test. So, a logging concept/implementation is needed.

You have to evaluate the purpose of supervision. Then you can look up this board and others for more specific help and re-post further questions you may have.

But haven't anywhere found a good instruction, what "supervision" to use to be able to follow the performance of tasks, system also after debugger is not connected anymore...


What features do you activate when a FreeRTOS app is designed?

All your application requires (see above). One by one!

Let me illustrate with few questions, that I don't have the answers for:

  • Should I have a separate supervision task, that gathers the info about other tasks (state,memory,..)?

  • What features should be used to supervise FreeRTOS based app in an "professional" way ?

  • Should I use ITM/SWO, or maybe RTT?

  • Do you leave serial console on the system to supervise it?

This all depends on the answers you find about the purpose of supervision. The professional way to deal with it is a top-down approach to focus on the system requirements (and development needs), and to design/implement everything that is necessary to fulfill them.


If you are looking for a way to get a first insight how to activate ITM/SWO trace of freeRTOS for educational purposes, I can recommend the beautiful tutorial in the Atollic blog, a beginners' intro spread over several free articles, step-by-step.

For RTOS architecture hints, you may also like youtube introductions like the channel of beningo engineering, for example.



来源:https://stackoverflow.com/questions/61268110/is-there-a-freertos-howto-for-cortex-m7-about-how-to-supervise-trace-a-system-wi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!