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 7e89fa45463fe94795bba8fd821b3a2827ab5400 Author: Darryl Ring <[email protected]> AuthorDate: Mon Nov 23 12:28:40 2026 -0700 arch/arm/stm32u3: Add DAC support Enable the common M33 DAC driver for DAC1 on STM32U3. Analog peripherals need VDDA marked valid, so PWR_SVMCR.ASV is set when DAC1 is enabled. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Darryl Ring <[email protected]> --- Documentation/guides/chip-specific/stm32_ports.rst | 2 +- Documentation/platforms/arm/stm32u3/index.rst | 2 +- arch/arm/src/stm32u3/Kconfig | 2 ++ arch/arm/src/stm32u3/stm32u3xx_rcc.c | 6 ++++++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Documentation/guides/chip-specific/stm32_ports.rst b/Documentation/guides/chip-specific/stm32_ports.rst index 2d70725417e..4a8e4285679 100644 --- a/Documentation/guides/chip-specific/stm32_ports.rst +++ b/Documentation/guides/chip-specific/stm32_ports.rst @@ -840,7 +840,7 @@ CCB to be done not supported COMP to be done not supported CRC to be done not supported CRS to be done not supported -DAC to be done not supported +DAC M33 v1 arch/arm/src/common/stm32/stm32_dac_m33_v1.c DBGMCU v5 not supported DLYB to be done not supported EXTI M33M55 v1 arch/arm/src/common/stm32/stm32_exti_gpio_m33m55_v1.c diff --git a/Documentation/platforms/arm/stm32u3/index.rst b/Documentation/platforms/arm/stm32u3/index.rst index 7c714327808..aa5868a3ad6 100644 --- a/Documentation/platforms/arm/stm32u3/index.rst +++ b/Documentation/platforms/arm/stm32u3/index.rst @@ -28,6 +28,7 @@ GPIO Yes EXTI Yes USART/UART Yes LPUART Yes +DAC Yes ADC No ADF No @@ -36,7 +37,6 @@ CCB No COMP No CRC No CRS No -DAC No DBGMCU No DLYB No FDCAN No diff --git a/arch/arm/src/stm32u3/Kconfig b/arch/arm/src/stm32u3/Kconfig index 71a40e35a52..8c310e52ec2 100644 --- a/arch/arm/src/stm32u3/Kconfig +++ b/arch/arm/src/stm32u3/Kconfig @@ -51,6 +51,8 @@ config STM32_U3_PERIPHERALS select STM32_HAVE_UART4 select STM32_HAVE_UART5 select STM32_HAVE_LPUART1 + select STM32_HAVE_IP_DAC_M33_V1 + select STM32_HAVE_DAC1 choice prompt "STM32U3 Chip Selection" diff --git a/arch/arm/src/stm32u3/stm32u3xx_rcc.c b/arch/arm/src/stm32u3/stm32u3xx_rcc.c index 1b7a9026200..2820c90fe34 100644 --- a/arch/arm/src/stm32u3/stm32u3xx_rcc.c +++ b/arch/arm/src/stm32u3/stm32u3xx_rcc.c @@ -209,6 +209,12 @@ void stm32_rcc_enableperipherals(void) RCC_AHB2ENR1_GPIOGEN | RCC_AHB2ENR1_GPIOHEN; modifyreg32(STM32_RCC_AHB2ENR1, 0, regval); +#ifdef CONFIG_STM32_DAC1 + /* Analog peripherals need VDDA to be marked valid */ + + modifyreg32(STM32_PWR_SVMCR, 0, PWR_SVMCR_ASV); +#endif + #ifdef CONFIG_STM32_USART1 modifyreg32(STM32_RCC_APB2ENR, 0, RCC_APB2ENR_USART1EN); #endif
