cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F3 CCM RAM WITH CoIDE

Asantos
Senior
Posted on January 29, 2014 at 14:50

I`m trying to configure a STM32F3 Project with the CoIDE 1.7.6 to run an ISR from CCM RAM basing on the AN4296 application note, but I can't put it to work with the CoIDE.

2 REPLIES 2
kpavlata9
Associate II
Posted on January 29, 2014 at 16:56

in 1.7.5:

C file:

#define CCMRAMFUNC __attribute__ ((long_call, section (''.ccmramtext'')))

and add to function declarations you want to execute in CCM.

in your .ld file:

MEMORY

{

rom (rx)  : ORIGIN = 0x08000000, LENGTH = 0x00040000

ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x0000a000

ram1 (rwx) : ORIGIN = 0x10000000, LENGTH = 0x00002000

}

between .data and .bss sections put:

_siccmramtext = ADDR(.text) + SIZEOF ( .text ) +  SIZEOF ( .data );

.ccmramtext :  AT (_siccmramtext)

    { 

        _sccmramtext = .; 

        *(.ccmramtext .ccmramtext.*) 

        . = ALIGN(4); 

        _eccmramtext = . ;

    } > ram1

 

and to your startup file put this after data segment initialization, just before bss zeroing

  pulSrc = &_siccmramtext;

  for(pulDest = &_sccmramtext; pulDest < &_eccmramtext; )

  {

    *(pulDest++) = *(pulSrc++);

  }

hope it helps,

karel

Asantos
Senior
Posted on January 30, 2014 at 22:36

Karel,

 Thanks very much. It solved my problem. 

  Ari.