2017-03-24 10:33 AM
Hi STM32 lovers.
I am currently using a STM32F429 �C in my project.
I would like to use the 64kB CCM memory for placing some buffers (Not accessed by peripherals and DMA) and some critical functions (ISR functions that need to run very fast).
I am lost with the �mysterious� GNU Linker file, I tried my best and succeeded to place some variables (even initialized) using the attribute GCC command and the startup code.
Using the modified linker script attached (sections.ld) and t
he memory file (.mem) file and the makefile, the compiler outputs a 384MB .bin file, of course will not fit the 2MB �C�s Flash.
I travelled all around forums and tutorials, followed the most famous ones:Application note AN4296 :http://www.st.com/resource/en/application_note/dm00083249.pdf
From analog Devices forum: But in vain !Could anyone say what I did wrong, what is missing ? How should the script file be edited ?#stm32-stm32f4-ccm-linker-section2017-03-25 09:28 AM
If the linker file already put the stack in the CCM, maybe creating a big array inside the main() will automatically put it with no effort in the CCM. For putting code in the CCM, this might be tricky as the code should be generated for the CCM memory space, backed up in the flash, copied in the CCM at the beginning of main() or startup...
2017-03-25 01:45 PM
I use GCC. I followed the steps outlined in AN4296 and it worked for me. Section 4 explains all of the steps needed.
You don't need to completely understand the linker script syntax, just follow the steps as outlined. It will work. Look at the map file in order to see what addresses each symbol is placed.
You should see something like this (I used the name .bss2 instead of .ccmram):
.bss2 0x0000000010000000 0x3580 load address 0x000000000801d058
0x0000000010000000 . = ALIGN (0x4) 0x0000000010000000 _sbss2 = . *(.bss2) .bss2 0x0000000010000000 0x3f8 Drivers/CMSIS/Lib/Source/FilteringFunctions/arm_fir_f32.o 0x0000000010000000 arm_fir_f322017-03-26 03:10 PM
Hi riggs.rob, Thanks for your engagement
Could you please upload your linker file (where .bss2 is stated), so I can view a working linker file.My original script file (from where I started modifying it) doesn't have .data { ....... } >RAM AT>FLASH as the AN4296 show, but instead.data : AT ( _sidata ) {
.......
} >RAM
So It seems that I have to modify further the linker rather than just adding what is in the red box, andI don't know if I should also change .data to >RAM AT>FLASH ?
I would be grateful2017-03-26 05:02 PM
https://gist.github.com/mobilinkd/2eeea5d783c33a4e334d652402e6abad
This should get you going.