This is an automated email from the ASF dual-hosted git repository.

GUIDINGLI pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 990138b58293eae2112d2957d614b62a70dae855
Author: raiden00pl <[email protected]>
AuthorDate: Wed Nov 18 11:32:35 2026 +0100

    arch/arm/stm32n6: Enable the L1 caches.
    
    Select the ARMv8-M I- and D-cache support and enable both caches at
    start-up with CONFIG_ARMV8M_ICACHE and CONFIG_ARMV8M_DCACHE.
    
    Assisted-by: Claude:claude-opus-5-5
    Signed-off-by: raiden00pl <[email protected]>
---
 Documentation/platforms/arm/stm32n6/index.rst | 3 +--
 arch/arm/src/stm32n6/Kconfig                  | 2 ++
 arch/arm/src/stm32n6/stm32_start.c            | 8 ++++++++
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/Documentation/platforms/arm/stm32n6/index.rst 
b/Documentation/platforms/arm/stm32n6/index.rst
index ee27832ae24..1ca2c7c685e 100644
--- a/Documentation/platforms/arm/stm32n6/index.rst
+++ b/Documentation/platforms/arm/stm32n6/index.rst
@@ -25,6 +25,7 @@ The following list indicates peripherals supported in NuttX:
 ==========  =======  ===============================================
 Peripheral  Support  Notes
 ==========  =======  ===============================================
+Cache       Yes      L1 I- and D-cache.
 GPIO        Yes
 I2C         Yes      I2C1-4 through the common I2C v2 driver.
 LTDC        Yes      Common LTDC driver (v2 register layout), RGB565,
@@ -46,9 +47,7 @@ USART       Yes      USART1-3, UART4-5, USART6, UART7-9, 
USART10 and
                      LPUART1 through the common U(S)ART driver.
 
 ADC         No
-DCACHE      No
 DCMIPP      No
-ICACHE      No
 IWDG        No
 LPTIM       No
 MPU         No
diff --git a/arch/arm/src/stm32n6/Kconfig b/arch/arm/src/stm32n6/Kconfig
index 4d282804f5d..508ba13920d 100644
--- a/arch/arm/src/stm32n6/Kconfig
+++ b/arch/arm/src/stm32n6/Kconfig
@@ -122,6 +122,8 @@ choice
 
 config ARCH_CHIP_STM32N657X0
        bool "STM32N657X0"
+       select ARMV8M_HAVE_ICACHE
+       select ARMV8M_HAVE_DCACHE
        select STM32_STM32N6XXXX
 
 endchoice
diff --git a/arch/arm/src/stm32n6/stm32_start.c 
b/arch/arm/src/stm32n6/stm32_start.c
index 8b768c3408b..1dfa2540200 100644
--- a/arch/arm/src/stm32n6/stm32_start.c
+++ b/arch/arm/src/stm32n6/stm32_start.c
@@ -30,6 +30,7 @@
 #include <assert.h>
 #include <debug.h>
 
+#include <nuttx/cache.h>
 #include <nuttx/init.h>
 #include <nuttx/macro.h>
 #include <arch/barriers.h>
@@ -344,6 +345,13 @@ void __start_c(void)
 
   stm32_board_initialize();
 
+  /* Enable the L1 I- and D-caches when configured.  As on STM32H7, this
+   * is done after the board initialization.
+   */
+
+  up_enable_icache();
+  up_enable_dcache();
+
   /* Final DSB+ISB after SCB writes (VTOR, SYSTICK_CTRL, SYSCFG INITSVTORCR)
    * before handing off to NuttX.
    */

Reply via email to