Nucleo h743zi2 - RAM size

hello,

I’m currently developping a image software on a nucleo h743zi2.
i have to deal with 10b VGA images. to store it, I need a RAM bigger than 640 x 480 x 2 bytes = 614.400 bytes.
After looking at th specs of the boad here : i read " Up to 1 Mbyte of RAM: 192 Kbytes of TCM RAM (inc. 64 Kbytes of ITCM RAM + 128 Kbytes of DTCM RAM for time critical routines), Up to 864 Kbytes of user SRAM, and 4 Kbytes of SRAM in Backup domain".
In theory, it is thus ok to store a picture in the user SRAM, with 200kB of extra room for other stuffs.

The issue appears when i try to allocate via a malloc enough space, it crashes.
after some investigation of the memory as mentionned here, it appears that mmy heap is too small (only 497148 bytes).
the issue is still there even when i create a very small program that only print the stack and heap sizes.
it gives me this:
Thread: 0x24004168, Stack size: 516 / 4096
Thread: 0x240041AC, Stack size: 592 / 768
Thread: 0x240041F0, Stack size: 96 / 768
Heap size: 64 / 503316 bytes

The question is thus where are my 300kB of SRAM going ?? :face_with_monocle: :thinking:

Thanks

Hi

Some information can be found in mbed-os/README.md at master · ARMmbed/mbed-os · GitHub

Then memory use is specified in the default linker script: mbed-os/stm32h743xI.sct at master · ARMmbed/mbed-os · GitHub

So, you are right, memory is not fully optimised…
In DTCM, we place vectors and crash data only.
Then, only SRAM is used for MBED application.
SRAM3 is reserved for Ethernet.

I will be very happy to review pull requests for a better memory usage and optimisation!

Thx

Jerome

hello,

yes i found the answer in the linker file. see discussion here.

regards

Thomas