2016-01-09 11:36 AM
Hi.
I tried to put code in a CCM RAM (STM32F303) as described in AN4296 and I was very impressed. It was more than 30% faster, than if the code is in flash.Mentioned PDF (AN4296) says that it is not recommended to place both code and data together in the CCM, because there would be a risk of ''collision''. Is that problem the same if I place in the CCM (beside code) a look-up table, which is a constant? Now I have it stored in a flash.Thanks2016-01-10 03:58 AM
2016-01-10 04:56 AM
Thanks.
I use uVision form Keil. Why?Should there be any profit, if I place variables (not stack) in CCM RAM too, instead in regular SRAM?2016-01-10 05:20 AM
Not always. Code in CCRAM will be quicker of course. But when placing code in RAM must remember that this code can call some function from flash (standard function like memcpy). Putting a global data to CCRAM will have a minimal influence on speed. Data used very often for example like data for FFT can be placed in CCRAM for speed up calculations. Stack is more important, of course it's depend on programing style.
Did you use some standard libraries? SPL or HAL?2016-01-10 05:51 AM
2016-01-10 05:59 AM
Mixing this programing styles it isn't good idea. But ok because using HAL (or SPL) libraries and talking about program speed i VERY BIG mistake.
2016-01-10 11:43 AM
2016-01-10 12:28 PM
Code from CCRAM should be quicker.
But answer for your question is not simply. You can do test, use coremark code for measurement. But why you bother at this?2016-01-10 12:36 PM
How did your CCMRAM setup look like?
2016-01-10 04:43 PM
ART should be able to out-run SRAM/CCMRAM in most situations, those are 1-cycle memories, and the ART can service the prefetch in the same cycle, effectively providing 0-cycle access. The FLASH is also very wide, 128-bit (16-byte) so even on a miss, the subsequent reads will average out the upfront cost.