Skip to content

Commit 5e10f8a

Browse files
committed
soc: arm: stm32u5 device with DCACHE for writing to NOR flash
Enable the DCACHE1 in INCR burt mode to allow writing to the external NOR octoFlash when in MemoryMapped mode Signed-off-by: Francois Ramu <[email protected]>
1 parent aeed3d3 commit 5e10f8a

File tree

1 file changed

+5
-0
lines changed
  • soc/arm/st_stm32/stm32u5

1 file changed

+5
-0
lines changed

soc/arm/st_stm32/stm32u5/soc.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <stm32_ll_bus.h>
1515
#include <stm32_ll_pwr.h>
1616
#include <stm32_ll_icache.h>
17+
#include <stm32_ll_dcache.h>
1718
#include <zephyr/logging/log.h>
1819

1920
#include <cmsis_core.h>
@@ -35,6 +36,10 @@ static int stm32u5_init(void)
3536
LL_ICACHE_SetMode(LL_ICACHE_1WAY);
3637
LL_ICACHE_Enable();
3738

39+
/* Enable data cache (master port write access) */
40+
LL_DCACHE_SetReadBurstType(DCACHE1, LL_DCACHE_READ_BURST_INCR);
41+
LL_DCACHE_Enable(DCACHE1);
42+
3843
/* Update CMSIS SystemCoreClock variable (HCLK) */
3944
/* At reset, system core clock is set to 4 MHz from MSIS */
4045
SystemCoreClock = 4000000;

0 commit comments

Comments
 (0)