diff --git a/configs/stm32h573i_dk_defconfig b/configs/stm32h573i_dk_defconfig new file mode 100644 index 00000000..7943d9d4 --- /dev/null +++ b/configs/stm32h573i_dk_defconfig @@ -0,0 +1,7 @@ +# SPDX-FileCopyrightText: 2025 ANSSI +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_ARCH_MCU_STM32H573=y +CONFIG_FPU_SOFTFP_ABI=y +CONFIG_DRV_STM32_LPUART=y +CONFIG_STANDALONE_MODE=y diff --git a/dts/examples/stm32h573i_dk.dts b/dts/examples/stm32h573i_dk.dts new file mode 100644 index 00000000..fcad3dfd --- /dev/null +++ b/dts/examples/stm32h573i_dk.dts @@ -0,0 +1,287 @@ +/* + * Copyright (c) 2025 ANSSI + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include +#include +#include + +/{ + chosen { + sentry,debug_stdout = <&lpuart1>; + outpost,i2c_port = <&i2c1>; + }; + + reserved-memory { + tasks_code: memory@0800a000 { + reg = <0x0800a000 0x200000>; + compatible = "outpost,memory-pool"; + }; + tasks_ram: memory@20008000 { + reg = <0x20008000 0x280000>; + compatible = "outpost,memory-pool"; + }; + /* Adding shm for task 1*/ + shm_task1: memory@2000a000 { + reg = <0x2000a000 0x512>; + dma-pool; // DMA allowed from/to this SHM + outpost,shm; + outpost,no-map; + outpost,label = <0xf00>;// shm label, unique + outpost,owner = <0xc001f001>; // task label + }; + /* Adding shm for task 2*/ + shm_task2: memory@2000a200 { + reg = <0x2000a200 0x512>; + dma-pool; // DMA allowed from/to this SHM + outpost,shm; + outpost,no-map; + outpost,label = <0xf01>;// shm label, unique + outpost,owner = <0xc001f002>; // task label + }; + }; + + aliases { + pll = &pll1; + }; + + led0: led_0 { + compatible = "gpio-leds"; + status = "disabled"; + }; + + led1: led_1 { + compatible = "gpio-leds"; + status = "disabled"; + }; + + led2: led_2 { + compatible = "gpio-leds"; + status = "disabled"; + }; + + backlight: backlight { + compatible = "gpio-leds"; + status = "disabled"; + }; + + panel: panel { + compatible = "gpio-leds"; + status = "disabled"; + }; + + touch: touch_1 { + compatible = "gpio"; + status = "disabled"; + }; + + sram1: memory@20000000 { + compatible = "mmio-sram"; + reg = <0x20000000 DT_SIZE_M(1)>; + }; + +}; + +&flash0 { + reg = <0x08000000 DT_SIZE_M(4)>; +}; + +&clk_lsi { + status = "okay"; +}; + +&clk_hsi { + status = "okay"; +}; + +&clk_hse { + status = "okay"; +}; + +&pll1 { + status = "okay"; +}; + +&pll3 { + status = "okay"; +}; + +&flash { + wait-state = <4>; /* According to voltage supply and sysclock */ + status = "okay"; +}; + +&rcc { + clocks = <&pll1>; + clock-frequency = ; + bus-prescalers = <0>, <2>, <0>, <0>; + bus-names = "ahb", "apb1", "apb2", "apb3"; + status = "okay"; +}; + +&exti { + events = <26>; + status = "okay"; +}; + +&gpioa { + status = "okay"; +}; + +&gpiob { + status = "okay"; +}; + +&gpioc { + status = "okay"; +}; + +&gpiod { + status = "okay"; +}; + +&gpioe { + status = "okay"; +}; + +&gpiof { + status = "okay"; +}; + +&gpiog { + status = "okay"; +}; + +&lpuart1{ + status = "okay"; + pinctrl-0 = <&lpuart1_tx_pc1>, <&lpuart1_rx_pc0>; +}; + +&pinctrl { + lpuart1_tx_pc1: lpuart1_tx_pc1 { + label = "usart_tx"; + pinmux = <&gpioc 1 STM32_DT_PIN_MODE_ALTFUNC(8)>; + pincfg = ; + }; + + lpuart1_rx_pc0: lpuart1_rx_pc0 { + label = "usart_rx"; + pinmux = <&gpioc 0 STM32_DT_PIN_MODE_ALTFUNC(8)>; + pincfg = ; + }; + + i2c1_scl_pb8: i2c_scl_pb8 { + label = "scl"; + pinmux = <&gpiob 8 STM32_DT_PIN_MODE_ALTFUNC(4)>; + pincfg = ; + }; + + i2c1_sda_pb9: i2c_sda_pb9 { + label = "sda"; + pinmux = <&gpiob 9 STM32_DT_PIN_MODE_ALTFUNC(4)>; + pincfg = ; + }; + + panel_reset_pf3: panel_reset_pf3 { + label = "panel_rst"; + pinmux = <&gpiof 3 STM32_DT_PIN_MODE_OUTPUT>; + pincfg = ; + }; + + backlight_pa9: backlight_pa9 { + label = "backlight"; + pinmux = <&gpioa 9 STM32_DT_PIN_MODE_OUTPUT>; + pincfg = ; + }; + + touch_rstn: touch_rstn { + label = "touch_rst"; + pinmux = <&gpiof 4 STM32_DT_PIN_MODE_OUTPUT>; + pincfg = ; + }; + + touch_int_input: touch_int_input { + label = "touch_int_input"; + pinmux = <&gpiof 5 STM32_DT_PIN_MODE_INPUT>; + pincfg = ; + }; + + touch_int_output: touch_int_output { + label = "touch_int_output"; + pinmux = <&gpiof 5 STM32_DT_PIN_MODE_OUTPUT>; + pincfg = ; + }; + + led_pa5: led_pa5 { + pinmux = <&gpioa 5 STM32_DT_PIN_MODE_OUTPUT>; + pincfg = ; + }; + + led_pa6: led_pa6 { + pinmux = <&gpioa 6 STM32_DT_PIN_MODE_OUTPUT>; + pincfg = ; + }; + + led_pf7: led_pf7 { + pinmux = <&gpiof 7 STM32_DT_PIN_MODE_OUTPUT>; + pincfg = ; + }; + + spi3_miso_pc11: spi3_miso_pc11 { + pinmux = <&gpioc 11 STM32_DT_PIN_MODE_ALTFUNC(6)>; + pincfg = ; + }; + + spi3_mosi_pc12: spi3_mosi_pc12 { + pinmux = <&gpioc 12 STM32_DT_PIN_MODE_ALTFUNC(6)>; + pincfg = ; + }; + spi3_sclk_pc10: spi3_sclk_pc10 { + pinmux = <&gpioc 10 STM32_DT_PIN_MODE_ALTFUNC(6)>; + pincfg = ; + }; + +}; + +&rng { + status = "okay"; +}; + +// &syscfg { +// status = "okay"; +// }; + diff --git a/kernel/src/arch/asm-cortex-m/Kconfig b/kernel/src/arch/asm-cortex-m/Kconfig index 408c35d4..0e844508 100644 --- a/kernel/src/arch/asm-cortex-m/Kconfig +++ b/kernel/src/arch/asm-cortex-m/Kconfig @@ -160,6 +160,20 @@ config SOC_SUBFAMILY_STM32U5 help STM32U5 family is based on Cortex-M33 with FPU, PMSAv8 MPU and TrustZone +config SOC_SUBFAMILY_STM32H5 + bool + select ARCH_ARM_CORTEX_M33 + select SOC_FAMILY_STM32 + select HAS_FPU + select HAS_FPU_FPV5 + select HAS_TRUSTZONE + select HAS_DCACHE + select HAS_ICACHE + select HAS_RNG + select HAS_GPDMA + help + STM32U5 family is based on Cortex-M33 with FPU, PMSAv8 MPU and TrustZone + config SOC_SUBFAMILY_STM32WB bool select ARCH_ARM_CORTEX_M4 @@ -237,6 +251,7 @@ config ARCH_SOCNAME default "STM32U5A9" if ARCH_MCU_STM32U5A9 default "STM32U5FX" if ARCH_MCU_STM32U5FX default "STM32U5GX" if ARCH_MCU_STM32U5GX + default "STM32H573" if ARCH_MCU_STM32H573 # User-accessible selectors @@ -284,6 +299,10 @@ config ARCH_MCU_STM32U5A9 bool "STM32U5A9" select SOC_SUBFAMILY_STM32U59_Ax +config ARCH_MCU_STM32H573 + bool "STM32H573" + select SOC_SUBFAMILY_STM32H5 + endchoice if HAS_FPU diff --git a/kernel/src/drivers/meson.build b/kernel/src/drivers/meson.build index fd8e396a..483a8440 100644 --- a/kernel/src/drivers/meson.build +++ b/kernel/src/drivers/meson.build @@ -25,7 +25,8 @@ if kconfig_data.get('CONFIG_HAS_RNG', 0) == 1 subdir('rng') endif -subdir('syscfg') +# subdir('syscfg') + if kconfig_data.get('CONFIG_DEBUG_OUTPUT_USART', 0) == 1 subdir('usart') endif