Loading...
 

SW4STM32 and SW4Linux fully supports the STM32MP1 asymmetric multicore Cortex/A7+M4 MPUs

   With System Workbench for Linux, Embedded Linux on the STM32MP1 family of MPUs from ST was never as simple to build and maintain, even for newcomers in the Linux world. And, if you install System Workbench for Linux in System Workbench for STM32 you can seamlessly develop and debug asymmetric applications running partly on Linux, partly on the Cortex-M4.
You can get more information from the ac6-tools website and download (registration required) various documents highlighting:

System Workbench for STM32


FreeRTOS Heap / Stack / Memory Management

Hi there,

I am working on a custom board with the STM32F107VCT processor. I am using FreeRTOS & lwIP

I am using tinyxml2 library and reading / writing to an EEPROM and running into strange corruption issues and crashes. I suspect I may be running out of memory. I am fairly new embedded electornics and FreeRTOS so am unsure where I should be looking.

I create a few threads like so:

osThreadDef(defaultTask, StartDefaultTask, osPriorityNormal, 0, 512);
defaultTaskHandle = osThreadCreate(osThread(defaultTask), NULL);

osThreadDef(RfTask, StartRfTask, osPriorityNormal, 0, 700);
RfTaskHandle = osThreadCreate(osThread(RfTask), NULL);

osThreadDef(DiscoveryTask, StartDiscoveryTask, osPriorityNormal, 0, 256);
DisoveryTaskHandle = osThreadCreate(osThread(DiscoveryTask), NULL);

Here are some of my defines related to heap / stack

FreeRTOS.h
define configTOTAL_HEAP_SIZE ((size_t)1024*24)

Flash.id

_estack = 0x20010000; /* end of RAM */

_Min_Heap_Size = 0; /* required amount of heap */
_Min_Stack_Size = 0x200; /* required amount of stack */

I am not really following in my mind exactly what heap / stack theory is, and how it relates to the figures in flash.id and FreeRTOS.h

Could someone offer me an explanation please of how this all works, and any methods to check amount of ram available for the tasks etc?

I can share my code on gitlab if required

Thank you so much

There are few information to detect the reason of your bug but here a little explanation of what stack and heap memories are:
stack memory is used by cpu to store all the local array or pointers needed to manage the returning of function calls (think of an interrupt that is served so the cpu must store the right memory address to recall when its routine terminate). when you use an rtos usually define a priori the amount of memory reserved for each task. if you don’t need an rtos the stack memory is all the free ram memory you leave in your program.

heap memory is a kind of reserved memory to manage the dynamic memory access. When you have memory space problem you can decide to use the amount of needed memory in sharing way calling a malloc() or calloc(). In such a way you request to get it for a short time and then release that amount calling free().
The size of that memory is always defined,

Hope could help!