cancel
Showing results for 
Search instead for 
Did you mean: 

Excluding DMA from Scatter File CCM memory section

JBond.1
Senior

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"?

1 ACCEPTED SOLUTION

Accepted Solutions
JBond.1
Senior

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

View solution in original post

1 REPLY 1
JBond.1
Senior

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