Skip to main content
Asantos
Associate III
January 29, 2014
Question

STM32F3 CCM RAM WITH CoIDE

  • January 29, 2014
  • 2 replies
  • 528 views
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.

    This topic has been closed for replies.

    2 replies

    kpavlata9
    Associate II
    January 29, 2014
    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
    AsantosAuthor
    Associate III
    January 30, 2014
    Posted on January 30, 2014 at 22:36

    Karel,

     Thanks very much. It solved my problem. 

      Ari.