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