Some problems about freeRTOS
Posted: Thu Mar 18, 2021 5:48 pm
Hi Guys, I use the newest stm32duino-freeRTOS in my project, but I meet some serious problems, and I am from China, and not good at English.
MCU: STM32L476RG 96K/1024K
PlatformIO/ Frame=Stm32duino
1.Most programs we are using the heap4 in STM32, but in your
heap4?
2. I have serval tasks in my program like this,
In the ldscript.ld, I change the stack and heap value
but usually, my program is run to death, and print the task list to see the stack use is a failure.
So I want to know [_Min_Heap_Size = 0x200; ] is the size for the freeRTOS, is it too small for the RTOS,
or Could you give me some tips to optimize my code?
Thank you very much!
MCU: STM32L476RG 96K/1024K
PlatformIO/ Frame=Stm32duino
1.Most programs we are using the heap4 in STM32, but in your
you use the heap_useNewlib, and I can not find more references, how about it? I doubted the reason that my program run to error is it. Should I change it to thelib/STM32duino FreeRTOS/src/FreeRTOSConfig_Default.h
heap4?
2. I have serval tasks in my program like this,
Code: Select all
xTaskCreate(periphRunTask, (const portCHAR *)"PeriphRun", 512, NULL, 6, NULL);
xTaskCreate(sensorSampleTask, (const portCHAR *)"Sensor", 256, NULL, 5, NULL);
xTaskCreate(dataHandleTask, (const portCHAR *)"DataHandle", 512, NULL, 4, NULL);
xTaskCreate(socketLTERunTask, (const portCHAR *)"LTESocket", 1024, NULL, 3, NULL);
xTaskCreate(socketWaterRunTask, (const portCHAR *)"WaterSocket", 1024, NULL, 2, NULL);
Code: Select all
_Min_Heap_Size = 0x200;; /* 0x400 1KB 一般由程序员分配和释放,分配方式类似于数据结构中的链表 */
_Min_Stack_Size = 0x800;; /* 0x800 2KB 由编译器自动分配和释放,如存放函数的参数值,局部变量的值等 */
So I want to know [_Min_Heap_Size = 0x200; ] is the size for the freeRTOS, is it too small for the RTOS,
or Could you give me some tips to optimize my code?
Thank you very much!