2015-10-19 06:03 PM
Hi!
On a F303K8 in SysTick i have two functions that i would like to run from CCMRAM because SRAM isunder heavy load from multiple DMA channel transactions, i use EmBitz tools. The functions fetch variablesand data from Flash and SRAM process these and writes result to SRAM buffer from which DMA willmove to a peripheral. I have this in .ld file but i have not done anything to startup file and an eventual initializer:CCMRAM (rwx) : ORIGIN = 0x10000000, LENGTH = 4K_siccmram = LOADADDR(.ccmram); .ccmram : { . = ALIGN(4); _sccmram = .; /* create a global symbol at ccmram start */ *(.ccmram) *(.ccmram*) . = ALIGN(4); _eccmram = .; /* create a global symbol at ccmram end */ } > CCMRAMI have tried all kind of things, made simple data test case placed an array from a different file into CCM://const uint8_t bell2[768]= {107,108,126,112,,,,,,,,,,};And map file showed: .rodata.bell2 0x00000000 0x300 obj\debug\src\waves.oThen when try to place in CCMRAM:uint8_t bell2[768]__attribute__((section(''.ccmram'')))= {107,108,126,112,,,,,,,,,,};Then map file showed apparently the right size and linker loaded the array into CCMRAM .: .ccmram 0x00000000 0x300 obj\debug\src\waves.o.ccmram 0x10000000 0x300 0x10000000 . = ALIGN (0x4) 0x10000000 _sccmram = . *(.ccmram) .ccmram 0x10000000 0x300 obj\debug\src\waves.o 0x10000000 bell2 *(.ccmram*) 0x10000300 . = ALIGN (0x4) 0x10000300 _eccmram = .But when i run the functions (SysTick ISR in main not attributed) they seams to fetch theCCM array data but the content is scrambled egg!? Or do the functions do read the CCM but the array data is not there!?The SysTick if attributed in main, dont run:void SysTick_Handler(void) __attribute__ ((section (''.ccmram'')));Seams to be loaded in CCMRAM:.ccmram 0x10000000 0x30 0x10000000 . = ALIGN (0x4) 0x10000000 _sccmram = . *(.ccmram) .ccmram 0x10000000 0x10 obj\debug\src\main.o 0x10000000 SysTick_HandlerWhat do i have do to make a ISR and data run from CCMRAM?ThanksJoerg.2015-10-20 02:54 AM
You must copy the initialized data/code from flash into CCM RAM in the startup code. Make sure to read
http://www.st.com/web/en/resource/technical/document/application_note/DM00083249.pdf
(sections 1 and 4 in your case). Edit: Another from the OpenSTM32 community wiki.