2014-09-24 11:05 PM
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 #stm322014-09-25 05:20 AM
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
2014-09-25 07:18 AM
.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
2014-09-25 08:37 AM
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
2014-09-28 06:47 PM
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'')));