BOOST THE SPEED OF YOUR STM32 MICROCONTROLLERS BY 31% USING CORE-COUPLED MEMORY

Summary of BOOST THE SPEED OF YOUR STM32 MICROCONTROLLERS BY 31% USING CORE-COUPLED MEMORY


This article explains how STMicro's Core Coupled Memory (CCM) RAM accelerates computation-intensive and real-time tasks on STM32 microcontrollers by offering zero wait-states compared to flash. Dim Tass demonstrated this using an STM32F303CC board, benchmarking the LZ4 compression algorithm across Flash, SRAM, and CCM at 72MHz and 128MHz. Results showed CCM significantly reduced execution time, proving its value for digital power control, motor control, and DSP applications.

Parts used in the STM32F303CC CCM Demonstration:

  • STM32F303CC development board
  • LZ4 compression algorithm
  • Custom CMake build system

When working on projects with computation-intensive routines and (or) near real-time performance requirements, having a “lightning-fast” RAM is usually a good thing for developers. This is one of the reasons while STMicro included the Core Coupled Memory (CCM) RAM  in a good number of its STM32 microcontroller series, and Dim Tass recently demonstrated how to use it, in a blog post on his website.

Core Coupled Memory (CCM), unlike flash storage, offers high performance and a zero wait-state that allows the execution of instructions at a fraction of the time it takes when running the firmware from flash storage.  According to STMicro, it is was included in the microcontrollers for use in scenarios that involve “real-time and computation-intensive routines [including] digital power conversion control loops (switch-mode power supplies, lighting), field-oriented 3-phase motor control, [and] real-time DSP (digital signal processing)”.

Describing CCM, Tass referred to it as potentially one of the features used by STM to set the microcontrollers with it, apart. In his words, “Vendors need to make themselves stand out from their competitors and this is done in many different ways. Of course, the most important is the price, but some times that’s not enough, because even the low price doesn’t mean that the controller fits your project”.

For the demo showcasing how developers can use the CCM, Tass made use of an STM32F303CC development board, which has 256kB of flash storage, 40kB of static RAM (SRAM) and 8kB of Core Coupled Memory(CCM) RAM. For the firmware, he adopted the LZ4 compression algorithm as a benchmark, along with a custom CMake that allows execution on flash  SRAM, and CCM RAM. Executing the LZ4 compression algorithm at different clock speeds on the flash, the SRAM, and the CCM. At the default board clock speed of 72MHz and a block size of 8k, executing the LZ4 algorithm from the flash took between 279 and 304 milliseconds. Moving to the SRAM dropped the runtime further to 251ms, but switching to CCM lowered it still further to 172ms. To further test the limits, Tass overclocked the device to get a clock speed of 128MHz and tested the performance of all three memories again. At the new clock speed with the same block size as before, execution time dropped to between 156-171ms on flash memory, 141 on the SRAM, 97ms on the CCM.

Read more: BOOST THE SPEED OF YOUR STM32 MICROCONTROLLERS BY 31% USING CORE-COUPLED MEMORY

Quick Solutions to Questions related to STM32F303CC CCM Demonstration:

  • What is the primary benefit of Core Coupled Memory over flash storage?
    CCM offers high performance and zero wait-state, allowing instruction execution at a fraction of the time required by flash.
  • Can I use CCM for digital signal processing tasks?
    Yes, STMicro states CCM is included for scenarios involving real-time DSP such as field-oriented 3-phase motor control.
  • How much CCM RAM does the STM32F303CC board have?
    The STM32F303CC board includes 8kB of Core Coupled Memory RAM.
  • What was the execution time for the LZ4 algorithm on CCM at 72MHz?
    At 72MHz with an 8k block size, execution on CCM took 172 milliseconds.
  • Does overclocking improve CCM performance?
    Yes, increasing the clock speed to 128MHz reduced the CCM execution time for the same task to 97ms.
  • How does SRAM performance compare to CCM in this test?
    SRAM was faster than flash but slower than CCM, taking 251ms at 72MHz compared to 172ms for CCM.
  • Why did Dim Tass choose the LZ4 algorithm for his demo?
    Tass adopted the LZ4 compression algorithm specifically as a benchmark to showcase CCM capabilities.
  • What are some examples of projects that benefit from CCM?
    Projects involving switch-mode power supplies, lighting, and real-time DSP routines benefit most from CCM.

About The Author

Muhammad Bilal

I am a highly skilled and motivated individual with a Master's degree in Computer Science. I have extensive experience in technical writing and a deep understanding of SEO practices.

Scroll to Top