cancel
Showing results for 
Search instead for 
Did you mean: 

Using CCM memory

pawel_popiolek
Associate II
Posted on July 03, 2012 at 09:20

When I was testing DSP efficiency i tried compare how fast is FFT from data from internal SRAM and CCM.

The code looks like this:

int16_t

tab[2048]

__attribute__

((section(

''.

ccm

'')));

...

GPIO_Pin_high();

arm_cfft_radix4_q15(&S, tab);

arm_cmplx_mag_squared_q15(tab, Output, fftSize);

GPIO_Pin_low();

When the tab was in internal SRAM this code was execute faster. I don't know why. Isn't it shoudl works faster? CCM is memory only for core and it should be the fastest memory. If it's not as fast then what's the reason of using it?

#ccm #dsp
2 REPLIES 2
Posted on July 03, 2012 at 12:24

The answer is it depends, the regular SRAM is zero wait state (ie single cycle access), so it can't get faster than that, but the SRAM can be contended by activity external to the core, so if you have a lot of constant DMA (LCD, Ethernet, SD Card, USB, etc) your accesses can be stalled. CCM is slowed when it has to arbitrate with FLASH for the use of the D-Bus. It is also safe from errant DMA access.

There are some CCM vs SRAM benchmarks here :

https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Attachments/22412/2012_STM32%20Technical%20Updates%20-%20Issue%pdf

An interesting test might be to do a recursive factorial test, or whatever, where the stack was either in CCM or SRAM.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
abelloni
Associate II
Posted on December 15, 2013 at 16:43

When I was testing DSP efficiency i tried compare how fast is FFT from data from internal SRAM and CCM.

The code looks like this:

int16_t

tab[2048]

__attribute__

((section(

''.

ccm

'')));

...

GPIO_Pin_high();

arm_cfft_radix4_q15(&S, tab);

arm_cmplx_mag_squared_q15(tab, Output, fftSize);

GPIO_Pin_low();

When the tab was in internal SRAM this code was execute faster. I don't know why. Isn't it shoudl works faster? CCM is memory only for core and it should be the fastest memory. If it's not as fast then what's the reason of using it?