0
votes

I'm working with a STM32F407VG with 128kB of normal RAM and 64kB of Core Coupled Memory (CCM). I'm using a GCC toolchain (SW4STM32). In my linker script I configured the CCM like this:

MEMORY 
{ 
FLASH (rx)     : ORIGIN = 0x08000000, LENGTH = 1024K     
RAM   (xrw)    : ORIGIN = 0x20000000, LENGTH = 128K 
CCM   (xrw)    : ORIGIN = 0x10000000, LENGTH = 64K       
}

SECTIONS
{   
...
.ccram :
{
    *(.ccram)
    *(.ccram*)
} >CCM
...

When I put any variables into the .ccram section I get an ELF file which seems to tell ST-Link that it has to flash the memory at 0x10000000. This fails, of course, and tells me

"Warn : no flash bank found for address 10000000".

When I create a HEX file from the ELF file, I find a block of zeros at 0x10000000. When I delete this block from the HEX file, I can flash the HEX file successfully (with ST-Link Utility) and my code runs perfectly on the target.

So how do I tell the linker (or whoever) that the CCM region shall not be marked as FLASH?

2

2 Answers

0
votes

I think you need to replace >CCM with >CCM AT> FLASH

This should tell it to get the init values from flash

0
votes

I got the solution:

Add "(NOLOAD)" to the deklaration of the section:

.ccram (NOLOAD):
{
    *(.ccram)
    *(.ccram*)
} >CCM