cancel
Showing results for 
Search instead for 
Did you mean: 

Usage of CCM Data RAM in KEIL

umamahesh
Associate II
Posted on September 25, 2014 at 08:05

Hi,

Currently using STM32F427 for my project and using KEIL as the environment. So my project build contains boot rom, applications and fonts for displaying. The available usage RAM in the controller is 192 KB and my binaries are around 210KB. I am planning to use CCM RAM of 64KB, the usage of that is not clear. And the method to store any constants in CCM RAM using KEIL is not defined.  Looking for suggestions.

Thanks

Umamahesh

#stm32-stm32f4-ccm-linker-section #stm32
4 REPLIES 4
Posted on September 25, 2014 at 14:20

Not defined? Or not read the documentation very thoroughly? Wouldn't Keil do it through #pragma's, attributes and scatter files?These threads are mostly GNU/GCC, but I've discussed Keil implementations in both.

https://community.st.com/0D50X00009Xka1pSAB

 

https://community.st.com/0D50X00009XkaVpSAJ

 

Constants? You'd want them left in flash. Variables, Heap and Stack might be better usages, though you'd have to watch you don't allocate buffers for DMA. You might also want to work on an allocator that understands multiple memory arenas.

Edit: Fixed DEAD LINKs, original post from Sep 25, 2014

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
umamahesh
Associate II
Posted on September 25, 2014 at 16:18 Thanks for the reply, I am not thorough in KEIL. My project doesn't use DMA. Following are the sections that would be flashed 1.boot code 2. fpga.bin 3. Fonts 4. Appilcation Fonts will reside in flash and fpga.bin will flashed on fpga. How shall I plan to use CCM RAM. Secondly the following piece of section should be updated in scatter file, if my understanding is right

.ccm (NOLOAD) :
{
.= ALING(4);
*(.ccm)
.= ALIGN(4);
} >CCMRAM

Then to store/access CCM, I can use the following if my understanding is correct. CCRAM (rwx) : ORIGIN = 0x10000000, LENGTH = 64K to be added in start_***.s If you have any examples it would be helpful to understand much better. Please any suggestions
Posted on September 25, 2014 at 17:37

Ok, but that's GNU/GCC linker script stuff, you need to extract the KEIL specific material from the threads I don't like citing specific messages within threads as it's unwieldy, and loses context.

Doing it here for specificity:

https://community.st.com/0D50X00009XkaVpSAJ

The thing to understand is two fold 1) You must describe to the linker your memory regions.

2) You must direct specific data, code, sections, or objects into those regions. The how/why of this floor planing is up to you to decide.

Edit: Fixing DEAD LINK, original post from Sep 25, 2014

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on September 29, 2014 at 03:47

This creates a .ccm section, and also directs the STACK section from a specific object into CCM to demonstrate. Review the .MAP file to confirm memory placements.

; *************************************************************
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************
LR_IROM1 0x08000000 0x00200000 { ; load region size_region (2M)
ER_IROM1 0x08000000 0x00200000 { ; load address = execution address
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
}
RW_IRAM1 0x20000000 0x00030000 { ; RW data (192K)
.ANY (+RW +ZI)
}
RW_IRAM2 0x10000000 0x00010000 { ; CCM (64K)
startup_stm32f427x.o (STACK)
*(.ccm)
}
}

char buf[256] __attribute__ ((section(''.ccm'')));

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..