Skip to main content
JBond.1
Senior
October 8, 2023
Solved

Excluding DMA from Scatter File CCM memory section

Hi, I have created scatter file:

 

; *************************************************************
; *** Scatter-Loading Description File for STM32F4 ***
; *************************************************************

LR_IROM1 0x08004000 0x0007C000 { ; load region size_region
 ER_IROM1 0x08004000 0x0007C000 { ; load address = execution address
 *.o (RESET, +First)
 *(InRoot$$Sections)
 .ANY (+RO)
 .ANY (+XO)
 }
 RW_IRAM1 0x20000000 0x0001C000 { ; RW data
 .ANY (SRAM)
 ;.ANY (+RW +ZI)
 }
 RW_IRAM2 0x2001C000 0x00004000 {
 .ANY (SRAM2)
 ;.ANY (+RW +ZI)
 }
 RW_IRAM3 0x10000000 0x00010000 { ; CCM data
 .ANY (+RW +ZI)
 .ANY (CCM_DATA)
 startup_stm32f407xx.o (STACK)
 startup_stm32f407xx.o (HEAP)
 }
}

 

And added all DMA used buffers to SRAM section:

 

static uint8_t Buffer[BUFFER_SIZE] __attribute__ ((section("SRAM")));

 

The issue is if SRAM fills with other buffers, some buffers are moved to CCM section as they fall under this category ".ANY (+RW +ZI)". How to exclude SRAM sections from ".ANY (+RW +ZI)"? Whats the syntax to say ".ANY (+RW +ZI) - but not SRAM"?

This topic has been closed for replies.
JBond.1
JBond.1Best answer
Senior
October 9, 2023

Seems that defining ".ANY (.bss) .ANY (.data)" instead of ".ANY (+RW +ZI)" excludes "SRAM"

1 reply

JBond.1
JBond.1AuthorBest answer
Senior
October 9, 2023

Seems that defining ".ANY (.bss) .ANY (.data)" instead of ".ANY (+RW +ZI)" excludes "SRAM"