This works for me - I've tried to place my two float arrays (re[], im[], 32kB each) into CCM:
In the linker script add:
Code: Select all
..
.ccm :
{
KEEP(*(.ccmbuf))
} > ccmram
And in the main.c for example:
Code: Select all
..
#define intoCCM __attribute__((section(".ccmbuf"))) __attribute__((aligned(4)))
#define N 8192
float re[N] intoCCM;
float im[N] intoCCM;
That places the two arrays into CCM memory section - see the map file:
Code: Select all
..
.ccm 0x10000000 0x10000
*(.ccmbuf)
.ccmbuf 0x10000000 0x10000 build/obj/main.o
0x10000000 re
0x10008000 im
.bss 0x20000c38 0x183c8
This way I put 5x32kB of arrays into the STMF4:
Code: Select all
..
#define intoCCM __attribute__((section(".ccmbuf"))) __attribute__((aligned(4)))
#define N 8192
float re[N] intoCCM;
float im[N] intoCCM;
float test[N];
float test1[N];
float test2[N];
..
If the vars do not fit into the CCM you will get an error:
Code: Select all
..
#define N 8192
float re[N] intoCCM;
float im[N] intoCCM;
float re1[100] intoCCM;
Code: Select all
.../arm-none-eabi/bin/ld.exe: region `ccmram' overflowed by 400 bytes
collect2.exe: error: ld returned 1 exit status