2025-03-05 11:33 PM
Hi there,
With STM32CubeIDE v. 1.18.0 there comes new GNU tool ver. 13.3
My linker script defines between others:
RAM_D3 (xrw) : ORIGIN = 0x38000000, LENGTH = 64K
This area is used explicitely for BDMA
/* RAM D3 for BDMA access */
.ramd3 (NOLOAD) :
{
. = ALIGN(4);
_sramd3 = .; /* create a global symbol at data start */
. = ALIGN(4);
_eramd3 = .; /* define a global symbol at data end */
} >RAM_D3
In the code, there is only one array assigned to above mentioned section:
// ADC3 thru BDMA
uint32_t adc3_data[4] __attribute__ ((section (".ramd3")));
After the build it is easy to find in *.map file that adc3_data is correctly placed at 0x38000000 address and BDMA can access the data. Build Analyzer shows the same:
.ramd3 0x38000000
And it was normal and expected behaviour until GNU Tools 12.3 (included).
Just with GNU 13.3 is works no more.
The same code and linker script result with faulty date placement!!!
In the *.map file one can see wrong placement:
.ramd3 0x240008d0
BTW With GNU 13.3 there comes newlib 4.4.0 but no one has mentioned in release notes about it.
2025-03-07 4:52 PM
Change is a curse, as a Chinese proverb goes. You can use the previous toolchain and newlib with the new CubeIDE and stay happy.
2025-03-09 11:52 PM
Hi Pavel,
thank you for advice.
Yes, I have already installed old toolchain (12.3) and set it as DEFAULT but have no chance to choose newlib version.
Newlib version seems to be hardwired with toolchain release.
No option to change, GNU 12.3 corresponds to newlib 4.3.
2025-03-10 9:20 AM
Hello @DrDro
First let me thank you for posting.
I am trying to reproduce the behavior to be able to analyze it. However, I am not able to see a difference between GNU 13 and 12.
If I add the (NOLOAD) to the linker, in both GCC version the variable is placed in 0x24000010 address.
But when I delete the (NOLOAD) I get the variable placed in the RAM_D3 with both GCC.
Can you share a minimalistic project showing the issue so I can see the same behavior as you.
KR,
Semer.
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2025-03-10 11:50 PM
Thank you for quick reaction.
Below I enclosed minimalistic project causing linker issue.
Results when changing GNU Tools are suspicious:
GNU Tools 13.3.rel1
.ramd2 0x2400057c 0x80 load address 0x0801a4f8
.ramd2 0x2400057c 0x80 ./Core/Src/main.o
0x2400057c adc1_data_regular
0x240005bc adc2_data_regular
.ramd3 0x240005fc 0x40 load address 0x0801a578
.ramd3 0x240005fc 0x40 ./Core/Src/main.o
0x240005fc adc3_data_regular
0x2400063c . = ALIGN (0x4)
GNU Tools 12.3.rel1
.ramd3 0x38000000 0x40
0x38000000 . = ALIGN (0x4)
0x38000000 _sramd3 = .
0x38000000 . = ALIGN (0x4)
0x38000000 _eramd3 = .
.ramd3 0x38000000 0x40 ./Core/Src/main.o
0x38000000 adc3_data_regular
.ramd2 0x30000000 0x80
0x30000000 . = ALIGN (0x4)
0x30000000 _sramd2 = .
0x30000000 . = ALIGN (0x4)
0x30000000 _eramd2 = .
.ramd2 0x30000000 0x80 ./Core/Src/main.o
0x30000000 adc1_data_regular
0x30000040 adc2_data_regular