Skip to content

Commit 2e71d5d

Browse files
committed
ports: stm32h723: NO_CACHE in AXI RAM support
1 parent 202822c commit 2e71d5d

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

firmware/hw_layer/ports/stm32/stm32h7/cfg/mcuconf_stm32h723.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,20 @@
44
#ifndef STM32_NOCACHE_ENABLE
55
#define STM32_NOCACHE_ENABLE TRUE
66
#endif
7+
8+
#if STM32_NOCACHE_IN_AXI
9+
// first 16 Kb in AXI SRAM.
10+
#define STM32_NOCACHE_MPU_REGION MPU_REGION_6
11+
#define STM32_NOCACHE_RBAR 0x24000000U
12+
#define STM32_NOCACHE_RASR MPU_RASR_SIZE_16K
13+
#else
14+
// whole SRAM2 region.
15+
// NOTE: this region is not accesable by some bus master
16+
// For example by SDMMC1 !!!
717
#define STM32_NOCACHE_MPU_REGION MPU_REGION_6
818
#define STM32_NOCACHE_RBAR 0x30002000U
919
#define STM32_NOCACHE_RASR MPU_RASR_SIZE_16K
20+
#endif
1021

1122
/*
1223
* PWR system settings.

firmware/hw_layer/ports/stm32/stm32h7/global_port.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
#define CCM_OPTIONAL __attribute__((section(".ram5")))
33
//TODO: update LD file!
44
#define SDRAM_OPTIONAL __attribute__((section(".ram8")))
5-
// SRAM3 is 32k and set to disable dcache
6-
#define NO_CACHE __attribute__((aligned(4))) __attribute__((section(".ram3")))
5+
#if STM32_NOCACHE_IN_AXI
6+
#define NO_CACHE __attribute__((aligned(4))) __attribute__((section(".ram0")))
7+
#else
8+
// SRAM3 is 32k and set to disable dcache
9+
#define NO_CACHE __attribute__((aligned(4))) __attribute__((section(".ram3")))
10+
#endif
711

812
#define BKUP_RAM_NOINIT __attribute__((section(".bkup_ram_noinit")))

0 commit comments

Comments
 (0)