Hello everyone, while compiling my code for STM32H747 I've realized that the Mbed is using the 240MHz clock processor and are not accessing and allowing to allocated static memory over 512Mb. But the discovery board for STM32H747I has an external memory of 256Mbit.
I don't know if this is just a configuration on .ld file or if it's something more complex to implement.
DISCO_H747I
arm-gcc-eabi 9.3.0
mbed-os-6.2.0
mbed-cli 1.10.2
@jeromecoutant
Thank you for raising this detailed GitHub issue. I am now notifying our internal issue triagers.
Internal Jira reference: https://jira.arm.com/browse/MBOTRIAGE-2835
Hi
Yes SDRAM is not supported by default in mbed-os.
You could have a look on Cube package:
https://github.com/STMicroelectronics/STM32CubeH7/blob/master/Drivers/BSP/STM32H747I-DISCO/stm32h747i_discovery_sdram.c
https://github.com/STMicroelectronics/STM32CubeH7/blob/master/Projects/STM32H747I-DISCO/Examples/BSP/CM7/Src/sdram.c
Hi @felipeLeast
One of my side projects is a digital gauge cluster based on Mbed OS that uses a dual-core STM32H745 along with an external SDRAM:
https://forums.mbed.com/t/marquesas-mbed-based-open-source-digital-gauge-cluster/8410
My BSP for this board shows how I set up the linker script and where the code to initialize the SDRAM can go in the Mbed boot sequence.
You can find the BSP here: https://github.com/AGlass0fMilk/marquesas-bsp
There is a function for all STM32 targets called TargetBSP_Init. It was introduced for this reason -- to allow you to initialize any board-level resources early on in the boot sequence (such as external SDRAM, etc). You can find it in Mbed's sources here:
My Marquesas BSP initializes the external SDRAM in this function. You can see the initialization code I used here:
https://github.com/AGlass0fMilk/marquesas-bsp/blob/master/sdram/sdram_ext.c
You will probably need to change the settings and pins used, but most of that code was generated by STM32CubeIDE. You should be able to reference the examples mentioned by @jeromecoutant above to get the code required for your board.
The .ld file has some changes to map out the external RAM but it's not really necessary unless you want the linker to manage where your variables get placed in RAM. In my case, I use the external RAM as a display buffer and for caching bitmaps so I just use explicit pointers to the external SDRAM memory space.
I hope this helps!
Could this issue be closed ?
Thx