Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training


Cortex M4, Core Coupled Memory (CCM)

Posted by dkure on February 11, 2014

Hi All,

I am looking into using the Core Coupled Memory in my project and I was wondering how other people are going about this with FreeRTOS.

(Core-Coupled memory, is a special area of memory offset from standard RAM, CCM can't be DMA'ed to, but it does provide no-wait state access to memory. Benifits of CCM would be to hold run time code of functions needing to be highly optimised or lookup tables that need to be accessed quickly, rather than waiting on flash, which requires wait states),

I have currently setup a section in my linker script which sets aside 64kB of memory for CCM. However I am only able to place static variables into this region, and can't use it as a generic RAM section. Note, I am not trying to take advantage of CCM for extra speed, I want to take advantage of CCM for extra memory. On the STM32F4 that I am using, 128kB is standard RAM, 64kB is CCM, so its a significate portion of avaliable memory.

I am thinking of extending heap_x.c to provide support for multiple memory segements, one for standard RAM, and one for CCM memory.

This would allow me to dynamically allocate variables into CCM, rather than only being able to allocate them at compile time.

Does anyone have any thoughts on this? Or has anyone implemented something along these lines already.

Cortex M4, Core Coupled Memory (CCM)

Posted by rtel on February 11, 2014

The 4 memory allocation functions are kept in the port layer so you can modify them however you like, or provide your own. It seems to be relatively common for people to what to split the heap into several memory regions. You could do this quite easily by adding an attribute to the heap block (which is just a uint8t array) to force it into which ever memory region you want. If you need a heap that is larger than the CCM block then you will need a little extra effort to update the heapx.c file to use more than one block of RAM as its heap. It could try to allocate form one block first, and if that fails, try to allocate from the second block.


Cortex M4, Core Coupled Memory (CCM)

Posted by hawk777 on February 14, 2014

Personally, I wrote a port (because none of the three existing ones did quite what I wanted), and I implemented pvPortMallocAligned (which is only used for allocating stacks and nothing else) in CCM, while pvPortMalloc uses normal RAM. Thus, stacks (which hold locals, which should be much more common and much more frequently accessed than globals in good code) are fast, but you have to use heap or global data for DMA, which is IMO a reasonable tradeoff.

[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]

Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.

Free TCP/IP and file system demos for the RTOS

Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists