cancel
Showing results for 
Search instead for 
Did you mean: 

Can ccmram be divided into data and BSS

dchen.2000
Associate II

I want to divide ccmram into data and bss section,so how to do it?

thank you!

5 REPLIES 5

Describe the sections in the linker script or scatter file​, direct content into them, and initialize in startup_stm32xxxx.s

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Thank you! I modify link file like this,but it does not work.  so,why?

 .data_CCMRAM : ALIGN(4)

   {

      . = 0x20004000;

      test_ccm = 0x20004000;

      FILL(0xFF)

      *(.data.CCMRAM .data.CCMRAM.*)

      . = ALIGN(4) ;

   } > CCMRAM AT>FLASH

   .bss_CCMRAM (NOLOAD) : ALIGN(4)

   {

       *(.bss.CCMRAM .bss.CCMRAM.*)

   } > CCMRAM

Doesn't work in what respect?

Where does the .MAP file indicate it is placing things?

Don't think I'd set the location there, do it top side in the section definition.

You'd also need to track where in FLASH it is placed so your code in startup.s can unpack it.​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
berendi
Principal

And don't forget to enable the clock in RCC (RCC_AHB1ENR_CCMDATARAMEN or similar) before the reset handler starts copying data into it.

#define CCMRAM __attribute__((section(".data_CCMRAM")))

CCMRAM extern uint8_t ntripTxBuf[NTRIP_TX_BUFSIZE];

lt iike this,it use RAM address not CCMRAM address. this is map:

 .data.udp_port

               0x2000098e       0x2 .pio/build/OpenRTK/src/LWIP/lwip-1.4.1/src/core/udp.o

 .data_CCMRAM  0x20000990     0xfa0 .pio/build/OpenRTK/src/LWIP/lwip_app/NtripClient/src/ntripClient.o

               0x20000990               ntripTxBuf

               0x20001160               ntripRxBuf

 .data.g_pcSSIExtensions

               0x20001930      0x10 .pio/build/OpenRTK/src/LWIP/lwip_app/webserver/src/httpd.o

               0x20001930               g_pcSSIExtensions

 .data.ssiTAGs 0x20001940       0x8 .pio/build/OpenRTK/src/LWIP/lwip_app/webserver/src/httpd_handler.o

 .data_CCMRAM  0x20001948     0x800 .pio/build/OpenRTK/src/LWIP/lwip_app/webserver/src/httpd_handler.o

               0x20001948               http_response

               0x20001d48               http_response_body

but if i use this format, it works well.

#define CCMRAM __attribute__((section(".ccmram ")))

CCMRAM extern uint8_t ntripTxBuf[NTRIP_TX_BUFSIZE];

 .ccmram :

 {

   . = ALIGN(4);

   _sccmram = .;      /* create a global symbol at ccmram start */

   *(.ccmram)

   *(.ccmram*)

   . = ALIGN(4);

   _eccmram = .;      /* create a global symbol at ccmram end */

 } >CCMRAM AT> FLASH

the map is:

.ccmram        0x10000000    0xfacc load address 0x08073a38

               0x10000000               . = ALIGN (0x4)

               0x10000000               _sccmram = .

 *(.ccmram)

 .ccmram       0x10000000     0xfa0 .pio/build/OpenRTK/src/LWIP/lwip_app/NtripClient/src/ntripClient.o

               0x10000000               ntripTxBuf

               0x100007d0               ntripRxBuf

 .ccmram       0x10000fa0     0x800 .pio/build/OpenRTK/src/LWIP/lwip_app/webserver/src/httpd_handler.o

               0x10000fa0               http_response

               0x100013a0               http_response_body