Skip to content

Commit

Permalink
soc: arm: stm32u5 device with DCACHE for writing to NOR flash
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
FRASTM committed Oct 27, 2023
1 parent fab31ce commit 33babf7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions soc/arm/st_stm32/stm32u5/soc.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <stm32_ll_bus.h>
#include <stm32_ll_pwr.h>
#include <stm32_ll_icache.h>
#include <stm32_ll_dcache.h>
#include <zephyr/logging/log.h>

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

/* Enable data cache (master port write access) */
LL_DCACHE_SetReadBurstType(DCACHE1, LL_DCACHE_READ_BURST_INCR);
LL_DCACHE_Enable(DCACHE1);

/* Update CMSIS SystemCoreClock variable (HCLK) */
/* At reset, system core clock is set to 4 MHz from MSIS */
SystemCoreClock = 4000000;
Expand Down

0 comments on commit 33babf7

Please sign in to comment.