Close

From 768ms to 506ms with CCM (Core Coupled Memory)

A project log for FreEader - minimal e-book reader

HTML/EPUB <pandoc> LATEX <dvipng> png <imagemagick> pbm <pbmtojbg85> SD-Card <uC> 4.4" E-Ink

ventosusventosus 09/08/2015 at 21:150 Comments

I run my tests on a STM32F303CC for now, which has a nice feature called CCM (Core Coupled Memory).

From AN4296 (http://www.st.com/web/en/resource/technical/document/application_note/DM00083249.pdf):

[...] The STM32F303xB/C and STM32F358xC CCM RAM is tightly coupled with the CortexTM
core. it is primarily intended to execute code at maximum system clock frequency (72 MHz)
without any wait state penalty. It thus allows to significantly decrease critical task execution
time, compared to code execution from Flash memory.
CCM RAM is typically used for real-time and computation intensive routines [...]

[...] When code is located in CCM RAM and data stored in the regular SRAM, the Cortex-M4
core is in the optimum Harvard configuration. [...]

[...] A benchmark between the STM32F103xx and STM32F303xx microcontrollers using
STMicroelectronics MC library V3.4 shows [...] that the STM32F303xx is 20.33 % faster than the
STM32F103xx thanks to the CCM RAM [...]

I have of course tested this by adding support for CCM RAM to libopencm3 and was quite surprised with the speed up in decompressing 1 page of 800x600px JBIG1 encoded data from 768ms (code on FLASH) to 506ms (code on CCM RAM).

The speed up is quite substantial with -34 %.

Lessons learned:

Discussions