2024-04-28 05:03 AM
Hi team,
I am trying to implement FreeRTOS on nucleo32 board (stm32f303k8) on building the same with the one FreeRTOS task, I am getting a error that RAM overflowed by 66456 bytes.
It can be resolved or I need to go with some other high memory boards?
Solved! Go to Solution.
2024-04-28 08:00 AM
If you increase the size of the FLASH in the linker script, or related dialogs, the linker can get closure, with an unusable image, but you can inspect the .MAP file to see what's allocated to what/whom
2024-04-28 05:51 AM
Unless you can make your RAM utilization smaller you'll need a more capable part. Doesn't your current choice only have 12KB SRAM
What are you statically allocating that's going to put you 64KB over the available space?
Got some large 32-bit or float arrays? Too many tasks, too much stack space for each?
2024-04-28 07:53 AM
I'm making just one task that too stack size of 30. I just want to print something as I am just a beginner with RTOS.
Still I don't know where it wants this much space.
2024-04-28 08:00 AM
If you increase the size of the FLASH in the linker script, or related dialogs, the linker can get closure, with an unusable image, but you can inspect the .MAP file to see what's allocated to what/whom
2024-04-29 02:53 AM
As you told to increase the size of FLASH in linker script, I tried that, but the error was still there so I tried to increase the size of RAM (I know it's out of range) the error got resolved here, but I know it won't work for the future. While debugging the project it stuck in the HardFault_Handler.
As I inspected through built analyzer to check memory usage, I got that ucHeap is consuming around 75KB of memory. How can we reduce it?
2024-04-29 03:08 AM - edited 2024-04-29 03:08 AM
@neelesh_vish wrote:I am trying to implement FreeRTOS on nucleo32 board (stm32f303k8) o
Why?
That chip has only 12K of RAM - it seems highly unlikely that any application which will fit into just 12K RAM is going to benefit from an RTOS !
@neelesh_vish wrote:It can be resolved or I need to go with some other high memory boards?
Going with a more appropriately-sized chip would seem like the most sensible way forward.
Maybe an expert could shoe-horn this into such a small processor - but that doesn't seem like a sensible approach for a novice?
Maybe a better learning approach would be to use the Windows Simulator:
2024-04-30 12:23 AM
Actually, I just started learning RTOS and I have only this chip board available with me. So I tried some printing task on this. I don't think the printing of one or two task will consume this much of memory.
Currently I am able to fix the issue, but yeah for the next I will go ahead with some higher memory boards.
Thanks @Tesla DeLorean and @Andrew Neil
2024-04-30 12:49 AM - edited 2024-04-30 12:51 AM
Currently I am able to fix the issue,
Hello @neelesh_vish ,
Could you please tell us how you did fix the issue?
As said by @Andrew Neil, this chip has only 12K of SRAM and there is no sense to increase its size more.
2024-04-30 02:16 AM
@neelesh_vish wrote:Actually, I just started learning RTOS and I have only this chip board available with me.
Again, there's the Windows simulator available precisely for this - this lets you concentrate on learning the RTOS without any of the added complications of real hardware.
2024-04-30 03:23 AM
In the linker script of the project the total heap size was defined as 75*1024 (#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 75 * 1024 ) )) that is because I have copied this FreeRTOSconfig.h linker script from other project. now I change it to (#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 10 * 1024 ) )) and it started working.
I will change the board for next, as I just want to print some lines that why I used it.