2021-07-09 10:43 AM
I am using the STM32H753VIHX. I have a large amount of data that does not all fit in RAM. I am trying to allocate some of it to the other RAM such as RAM_D2 and RAM_D3. I seem unable to. Below is the error message I am getting
c:\st\stm32cubeide_1.6.1\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_1.5.0.202011040924\tools\arm-none-eabi\bin\ld.exe: 170093_stm32h753.elf section `.D3data' will not fit in region `RAM'
c:\st\stm32cubeide_1.6.1\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_1.5.0.202011040924\tools\arm-none-eabi\bin\ld.exe: region `RAM' overflowed by 9952 bytes
it keeps saying region RAM, but I want to allocate to the other location. Does anyone have an example of the proper way to configure the linker file? I added the following to my STM32H753VIHX_RAM.Id file.
.D2data :
{
. = ALIGN(4);
*(.D2data) /* .rodata sections (constants, strings, etc.) */
*(.D2data*) /* .rodata* sections (constants, strings, etc.) */
. = ALIGN(4);
} >RAM_D2
.D3data :
{
. = ALIGN(4);
*(.D3data) /* .rodata sections (constants, strings, etc.) */
*(.D3data*) /* .rodata* sections (constants, strings, etc.) */
. = ALIGN(4);
} >RAM_D3
I have only made changes to the linker file. Is there anywhere else that I need to make changes, or is there something else that I need to change?
Solved! Go to Solution.
2021-07-09 01:43 PM
The FLASH linker script is used by default. Delete the one you don't want to ensure it's not being used, or rename it to a text file.
Linker script used is under "MCU GCC Linker" settings.
2021-07-09 10:55 AM
Are you sure it is using the right .LD file?
Are these early enough in the file that your data hasn't already been binned into the RAM section with a wildcard?
2021-07-09 10:58 AM
The only other LD file I see is the _FLASH one in the root directory. Would there be others in another location? I tried originally putting it below .rodata, so one of the first, then put it below /DISCARD/, so near the end. Both locations yielded the same result.
2021-07-09 11:13 AM
I don't know what CubeIDE does, and I don't see the command line in the log. I use GNU/GCC w/make.
You could try renaming the singular "RAM" to some more noteworthy/unique name, then you'd see from the error message whether your file was being used, or not.
It's not clear to me how data would manifest in SRAM without some actual code in startup.s to move it there, and it getting staged in FLASH
I don't have your original or modified files, but like I said it probably isn't early enough. Define your MEMORYs, then have this at the top of SECTIONS
2021-07-09 01:43 PM
The FLASH linker script is used by default. Delete the one you don't want to ensure it's not being used, or rename it to a text file.
Linker script used is under "MCU GCC Linker" settings.
2021-07-12 10:32 AM
Thank you this was the solution for me. I did not realize FLASH was the default. I thought RAM would be the default.