diff --git a/stm32cube/stm32n6xx/CMakeLists.txt b/stm32cube/stm32n6xx/CMakeLists.txt index f1b9dd1d6..f7c8bfc74 100644 --- a/stm32cube/stm32n6xx/CMakeLists.txt +++ b/stm32cube/stm32n6xx/CMakeLists.txt @@ -1,8 +1,13 @@ # Copyright (c) 2025 STMicroelectronics # # SPDX-License-Identifier: Apache-2.0 - -zephyr_library_sources(soc/system_stm32n6xx_fsbl.c) +if(CONFIG_BOOTLOADER_MCUBOOT) + zephyr_include_directories(soc) + zephyr_include_directories(soc/Templates) + zephyr_library_sources(soc/system_stm32n6xx_s.c) +else() + zephyr_library_sources(soc/system_stm32n6xx_fsbl.c) +endif() zephyr_library_sources(drivers/src/stm32n6xx_hal.c) zephyr_library_sources(drivers/src/stm32n6xx_hal_rcc.c) zephyr_library_sources(drivers/src/stm32n6xx_hal_rcc_ex.c) diff --git a/stm32cube/stm32n6xx/README b/stm32cube/stm32n6xx/README index 4ae39dca5..485ffc3e5 100644 --- a/stm32cube/stm32n6xx/README +++ b/stm32cube/stm32n6xx/README @@ -52,6 +52,7 @@ Patch List: which we don't need right now. Impacted files: -soc/system_stm32n6xx_fsbl.c + -soc/system_stm32n6xx_s.c *Fix SDIO initialization failure when skipping card identification sequence Fixes an issue in the STM32HN6 SDIO driver where HAL_SDIO_Init() fails if @@ -59,4 +60,11 @@ Patch List: Impacted files: stm32cube/stm32n6xx/drivers/src/stm32n6xx_hal_sdio.c + *Fix XSPIM initialization sequence + Don't cut XSPI2(ext NOR) clock when initializing XSPI1(PSRAM) which doesn't work + when application is running in XIP on external NOR + Impacted files: + stm32cube/stm32n6xx/drivers/src/stm32n6xx_hal_xspi.c + Internal reference: 212765 + See release_note.html from STM32Cube diff --git a/stm32cube/stm32n6xx/drivers/src/stm32n6xx_hal_xspi.c b/stm32cube/stm32n6xx/drivers/src/stm32n6xx_hal_xspi.c index a7fad61da..1b6662f88 100644 --- a/stm32cube/stm32n6xx/drivers/src/stm32n6xx_hal_xspi.c +++ b/stm32cube/stm32n6xx/drivers/src/stm32n6xx_hal_xspi.c @@ -2805,7 +2805,7 @@ HAL_StatusTypeDef HAL_XSPIM_Config(XSPI_HandleTypeDef *const hxspi, XSPIM_CfgTyp } /********** Disable all XSPI to configure XSPI IO Manager **********/ - if (__HAL_RCC_XSPI1_IS_CLK_ENABLED() != 0U) + if ((__HAL_RCC_XSPI1_IS_CLK_ENABLED() != 0U) && (hxspi->Instance == XSPI1)) { if ((XSPI1->CR & XSPI_CR_EN) != 0U) { @@ -2813,7 +2813,7 @@ HAL_StatusTypeDef HAL_XSPIM_Config(XSPI_HandleTypeDef *const hxspi, XSPIM_CfgTyp xspi_enabled |= 0x1U; } } - if (__HAL_RCC_XSPI2_IS_CLK_ENABLED() != 0U) + if ((__HAL_RCC_XSPI2_IS_CLK_ENABLED() != 0U) && (hxspi->Instance == XSPI2)) { if ((XSPI2->CR & XSPI_CR_EN) != 0U) { @@ -2821,11 +2821,11 @@ HAL_StatusTypeDef HAL_XSPIM_Config(XSPI_HandleTypeDef *const hxspi, XSPIM_CfgTyp xspi_enabled |= 0x2U; } } - if (__HAL_RCC_XSPI3_IS_CLK_ENABLED() != 0U) + if ((__HAL_RCC_XSPI3_IS_CLK_ENABLED() != 0U) && (hxspi->Instance == XSPI3)) { if ((XSPI3->CR & XSPI_CR_EN) != 0U) { - CLEAR_BIT(XSPI2->CR, XSPI_CR_EN); + CLEAR_BIT(XSPI3->CR, XSPI_CR_EN); xspi_enabled |= 0x4U; } } diff --git a/stm32cube/stm32n6xx/soc/system_stm32n6xx_s.c b/stm32cube/stm32n6xx/soc/system_stm32n6xx_s.c index 47b1365f4..ecf3ae47a 100644 --- a/stm32cube/stm32n6xx/soc/system_stm32n6xx_s.c +++ b/stm32cube/stm32n6xx/soc/system_stm32n6xx_s.c @@ -425,7 +425,7 @@ void SystemCoreClockUpdate(void) * other parameters. * @retval SystemCoreClock value */ -CMSE_NS_ENTRY uint32_t SECURE_SystemCoreClockUpdate(void) +uint32_t SECURE_SystemCoreClockUpdate(void) { SystemCoreClockUpdate();