I
I
Ilya2017-06-02 04:06:09
Programming
Ilya, 2017-06-02 04:06:09

FreeRTOSConfig.h heap size and in IAR settings. What is the difference?

Recently, I decided to master FreeRTOS, everything seems to be clear, but there are a couple of questions about the heap. I'm using IAR and the FreeRTOS port for Cortex-M0.
There are two fields in the IAR linker settings (stack and heap size), everything is clear with this. But in the FreeRTOSConfig.h file, you again need to specify the size of the heap. As I understand it, the heap size specified in the linker settings is for the malloc() functions, and the size specified in the FreeRTOSConfig.h file is for pvPortMalloc()?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Ocelot, 2017-06-02
@ananevilya

Yes, you understand correctly. IAR and FreeRTOS each have their own heap. If you are going to allocate dynamic memory only by means of the OS, you can safely set the heap size = 0 in the linker settings. The
stack is a little more complicated. There is a stack, memory for which is allocated by a linker. It cannot be disabled, otherwise the OS will not be able to work. And plus, FreeRTOS has its own stack, or rather a set of stacks, for each task. The configMINIMAL_STACK_SIZE parameter in the config is responsible for their size. In addition, when creating a task, the stack size for it can be redefined.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question