cancel
Showing results for 
Search instead for 
Did you mean: 

ISR and data from CCMRAM?

joergmeyer55
Associate
Posted on October 20, 2015 at 03:03

Hi!

On a F303K8 in SysTick i have two functions that i would like to run from CCMRAM because SRAM is

under heavy load from multiple DMA channel transactions, i use EmBitz tools. The functions fetch variables

and data from Flash and SRAM process these and writes result to SRAM buffer from which DMA will

move 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 */

  } > CCMRAM

I 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.o

Then 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 the

CCM 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_Handler

What do i have do to make a ISR and data run from CCMRAM?

Thanks

Joerg. 
1 REPLY 1
qwer.asdf
Senior
Posted on October 20, 2015 at 11:54

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

http://www.openstm32.org/Using+CCM+Memory

from the OpenSTM32 community wiki.