S
S
st_nimble2020-01-15 19:53:05
C++ / C#
st_nimble, 2020-01-15 19:53:05

Where can I find a good FreeRTOS manual for Cortex-M3?

Hello! Recently started developing firmware for a device based on STM32F103. Since there are several parallel resource-intensive tasks with different priorities, I decided not to fence the bike, but to assign it to RTOS. Since FreeRTOS is immediately available from CubeMX, the choice fell on it, as it is probably the most developed option for this platform. For building and debugging I use VS+VisualGDB with GCC compiler. During the work, several questions and problems were discovered:

  1. FreeRTOS initial setup. The parameters of the starting config are approximately clear, but with the minimum size of the task stack and a bunch of questions arise - it is not entirely clear to what extent they can be reduced (the stack seems to be also considered in words), and the current FreeRTOS port does not disable dynamic memory allocation. The consumption of RAM for the needs of FreeRTOS with a standard configuration is within 20% of all memory, which obviously wants to be optimized.
  2. Constant struggle with errors that occur during the operation of RTOS. It is worth touching its elements a little - you immediately find yourself in HardFault, after which a long google on the call stack follows in an attempt to understand the cause of the error. Either it turns out to be the mandatory inclusion -O1, now, for some unknown reason, it falls into uxListRemove.

Based on the above, the question arises - is there any guide/FAQ/documentation that will help to get enough information to solve all these problems? In the case of the configuration, I can reread the information about it several times on freertos.org, but there are probably articles about its actual use on MK. On Habré, I read everything that was, with an understanding of how mutexes, semaphores, events, etc. work. no problem.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Buliterov, 2020-01-25
@st_nimble

1) There is documentation on the site! In pdf format!
2) On the site microsin.ru
3) 10 (or 11) Lectures by Kurnitsa (from the journal components and technologies).
Everything is googling!
If you really want to see what is specifically under the cortex, then go to the portable folder. You won't see anything special!
Any on/off options in the freertos_config.h file.

Either it turns out to be the mandatory inclusion -O1, now, for some unknown reason, it falls into uxListRemove.
Haven't seen this. How did you decide what to compile with -O1?
but with the minimum size of the task stack and a bunch of questions arise - it's not entirely clear to what extent they can be reduced (the stack seems to be also counted in words), and the current FreeRTOS port does not disable dynamic memory allocation.
Stack, yes, in words. Calculating the amount of memory occupied by a task is not a trivial task. I'm using the "-fstack-usage" compilation switch Files are generated. We feed them to avstack.pl (googled) Although the program works for AVR. There you can see how much the task eats the stack!
Plus there are plugins and switches to view the task stack and more! But here we must take into account that the task will "pass" the most "gluttonous" path for the stack!
Do not be lazy to "overlay" the tools - they will save a lot of time and effort in the future!
Good luck!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question