From aa678cd2d896027776728a8ca6a8d410851e89d0 Mon Sep 17 00:00:00 2001 From: Guillaume Gautier Date: Tue, 3 Dec 2024 15:47:31 +0100 Subject: [PATCH 1/4] west.yml: update hal_stm32 to latest version Update hal_stm32 to latest version Signed-off-by: Guillaume Gautier --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index deecf69acfe98..2efbfd178f660 100644 --- a/west.yml +++ b/west.yml @@ -234,7 +234,7 @@ manifest: groups: - hal - name: hal_stm32 - revision: d5fb525486544f7fcec365a89c2ca5ea936618f5 + revision: 0788d073d76bb4e6c1a4a8ff21e95bb3498da536 path: modules/hal/stm32 groups: - hal From d46f11649c6a2994fef763bbeffdf20919b71a5c Mon Sep 17 00:00:00 2001 From: Guillaume Gautier Date: Fri, 6 Dec 2024 08:49:53 +0100 Subject: [PATCH 2/4] drivers: dma: stm32: update function prototype after hal update New HAL update changed the prototype of the check DMA flag functions. H7 and U0 use a const parameter for these functions. Signed-off-by: Guillaume Gautier --- drivers/dma/dma_stm32.h | 4 +++- drivers/dma/dma_stm32_bdma.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/dma/dma_stm32.h b/drivers/dma/dma_stm32.h index 553e09838d84d..54e7ac45524d8 100644 --- a/drivers/dma/dma_stm32.h +++ b/drivers/dma/dma_stm32.h @@ -52,7 +52,9 @@ uint32_t dma_stm32_slot_to_channel(uint32_t id); #endif typedef void (*dma_stm32_clear_flag_func)(DMA_TypeDef *DMAx); -#if !defined(CONFIG_SOC_SERIES_STM32G0X) +#if !defined(CONFIG_SOC_SERIES_STM32G0X) && \ + !defined(CONFIG_SOC_SERIES_STM32H7X) && \ + !defined(CONFIG_SOC_SERIES_STM32U0X) typedef uint32_t (*dma_stm32_check_flag_func)(DMA_TypeDef *DMAx); #else typedef uint32_t (*dma_stm32_check_flag_func)(const DMA_TypeDef *DMAx); diff --git a/drivers/dma/dma_stm32_bdma.h b/drivers/dma/dma_stm32_bdma.h index 090b03b1bfdf8..ea6ee145283bd 100644 --- a/drivers/dma/dma_stm32_bdma.h +++ b/drivers/dma/dma_stm32_bdma.h @@ -53,7 +53,7 @@ uint32_t bdma_stm32_slot_to_channel(uint32_t id); #endif typedef void (*bdma_stm32_clear_flag_func)(BDMA_TypeDef *DMAx); -typedef uint32_t (*bdma_stm32_check_flag_func)(BDMA_TypeDef *DMAx); +typedef uint32_t (*bdma_stm32_check_flag_func)(const BDMA_TypeDef *DMAx); bool bdma_stm32_is_gi_active(BDMA_TypeDef *DMAx, uint32_t id); void bdma_stm32_clear_gi(BDMA_TypeDef *DMAx, uint32_t id); From b48175a3ddec4992c06094c4046fc395a85898e9 Mon Sep 17 00:00:00 2001 From: Guillaume Gautier Date: Fri, 6 Dec 2024 08:52:06 +0100 Subject: [PATCH 3/4] drivers: adc: stm32: use dedicated status function for ldo state Now that the U5 HAL contains the dedicated LDO status function, use it instead of reading the register directly. Signed-off-by: Guillaume Gautier --- drivers/adc/adc_stm32.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/adc/adc_stm32.c b/drivers/adc/adc_stm32.c index 85f12aa7e4992..ecb3d5d35392b 100644 --- a/drivers/adc/adc_stm32.c +++ b/drivers/adc/adc_stm32.c @@ -1623,10 +1623,7 @@ static int adc_stm32_init(const struct device *dev) #elif defined(CONFIG_SOC_SERIES_STM32H7X) || \ defined(CONFIG_SOC_SERIES_STM32U5X) || \ defined(CONFIG_SOC_SERIES_STM32WBAX) - /* Don't use LL_ADC_IsActiveFlag_LDORDY since not present in U5 LL (1.5.0) - * (internal issue 185106) - */ - while ((READ_BIT(adc->ISR, LL_ADC_FLAG_LDORDY) != (LL_ADC_FLAG_LDORDY))) { + while (LL_ADC_IsActiveFlag_LDORDY(adc) == 0) { } #else k_busy_wait(LL_ADC_DELAY_INTERNAL_REGUL_STAB_US); From 0242581aea1e95f9a83905f74ca48a2ff0ec6fd1 Mon Sep 17 00:00:00 2001 From: Guillaume Gautier Date: Fri, 6 Dec 2024 10:57:39 +0100 Subject: [PATCH 4/4] modules: stm32: add hal_sdio kconfig Add STM32 HAL SDIO module driver Signed-off-by: Guillaume Gautier --- modules/Kconfig.stm32 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/Kconfig.stm32 b/modules/Kconfig.stm32 index 500e2328444f8..c586a51fcf752 100644 --- a/modules/Kconfig.stm32 +++ b/modules/Kconfig.stm32 @@ -506,6 +506,12 @@ config USE_STM32_HAL_SDADC help Enable STM32Cube SDADC HAL module driver +config USE_STM32_HAL_SDIO + bool + help + Enable STM32Cube Secure digital input/output interface (SDIO) + HAL module driver + config USE_STM32_HAL_SDRAM bool help