Skip to main content
dchen.2000
Associate
December 5, 2019
Question

Can ccmram be divided into data and BSS

  • December 5, 2019
  • 2 replies
  • 1217 views

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

thank you!

This topic has been closed for replies.

2 replies

Tesla DeLorean
Guru
December 5, 2019

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 VenmoUp vote any posts that you find helpful, it shows what's working..
dchen.2000
Associate
December 5, 2019

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

Tesla DeLorean
Guru
December 5, 2019

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 VenmoUp vote any posts that you find helpful, it shows what's working..
berendi
Principal
December 5, 2019

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