Question
Make use of the 64k CCM
Posted on January 11, 2012 at 11:08
I've spent (too many) hours trying to figure out how to use the CCM for something useful.
And with useful I mean easy access from my code written in C. I use GNU GCC, etc (the Yagarto toolchain). At first I thought that putting some variable, array into a specified section, let's call it .ccm, (and of course the appropriate lines in the linker script) would be the solution. For example: uint8_t test[1024] __attribute__ ((section(''.cmm''))); Well, it works... Kind of... :\ I compiles and links nicely. Checking the memory map/dump of the generated ELF-file I see that the array is located @0x1000 0000 However, producing a binary image produces a LARGE 100+MB file. Doing a hex-file makes it smaller but will not load into ST-Link Utility (file too large to fit, it says) Now... That's probably due to the gap between 0x1000 FFFF and 0x2000 0000 The part in the linker script is something like (under the SECTIONS part) .ccm : { .= ALING(4); *(.ccm) .= ALIGN(4); } >CCMRAM And CCM is defined under MEMORY as CCRAM (rwx) : ORIGIN = 0x10000000, LENGTH = 64K Also tried to use NOLOAD to make it NOBITS instead of PROGBITS but it still takes up space in the binary or hex-file. Removing the section with objcopy and --remove-section .ccm does nothing to help either. Isn't there anyway of makeing your own section behave like the .bss section and not taking space in the image? I hope I make sense with my problem/question. Best regards // J�rgen #stm32-stm32f4-ccm-linker-section #gcc-linker-ccm