Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update HAL STM32 #79089

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions drivers/clock_control/clock_stm32_ll_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,13 @@
#define z_hsi_divider(v) LL_RCC_HSI_DIV_ ## v
#define hsi_divider(v) z_hsi_divider(v)

#if defined(LL_RCC_HCLK_DIV_1)
#define fn_ahb_prescaler(v) LL_RCC_HCLK_DIV_ ## v
#define ahb_prescaler(v) fn_ahb_prescaler(v)
#else

Check notice on line 30 in drivers/clock_control/clock_stm32_ll_common.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/clock_control/clock_stm32_ll_common.c:30 -#define fn_ahb_prescaler(v) LL_RCC_HCLK_DIV_ ## v -#define ahb_prescaler(v) fn_ahb_prescaler(v) +#define fn_ahb_prescaler(v) LL_RCC_HCLK_DIV_##v +#define ahb_prescaler(v) fn_ahb_prescaler(v)
#define fn_ahb_prescaler(v) LL_RCC_SYSCLK_DIV_ ## v
#define ahb_prescaler(v) fn_ahb_prescaler(v)
#endif

#define fn_apb1_prescaler(v) LL_RCC_APB1_DIV_ ## v
#define apb1_prescaler(v) fn_apb1_prescaler(v)
Expand Down Expand Up @@ -537,7 +542,7 @@
*/
if (LL_RCC_GetSysClkSource() == LL_RCC_SYS_CLKSOURCE_STATUS_PLL) {
stm32_clock_switch_to_hsi();
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
LL_RCC_SetAHBPrescaler(ahb_prescaler(1));
}
LL_RCC_PLL_Disable();

Expand Down Expand Up @@ -800,9 +805,9 @@
set_up_plls();

if (DT_PROP(DT_NODELABEL(rcc), undershoot_prevention) &&
(STM32_CORE_PRESCALER == LL_RCC_SYSCLK_DIV_1) &&
(ahb_prescaler(STM32_CORE_PRESCALER) == ahb_prescaler(1)) &&
(MHZ(80) < CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC)) {
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_2);
LL_RCC_SetAHBPrescaler(ahb_prescaler(2));

Check notice on line 810 in drivers/clock_control/clock_stm32_ll_common.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/clock_control/clock_stm32_ll_common.c:810 - (ahb_prescaler(STM32_CORE_PRESCALER) == ahb_prescaler(1)) && - (MHZ(80) < CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC)) { + (ahb_prescaler(STM32_CORE_PRESCALER) == ahb_prescaler(1)) && + (MHZ(80) < CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC)) {
} else {
LL_RCC_SetAHBPrescaler(ahb_prescaler(STM32_CORE_PRESCALER));
}
Expand All @@ -827,9 +832,9 @@
#endif /* STM32_SYSCLK_SRC_... */

if (DT_PROP(DT_NODELABEL(rcc), undershoot_prevention) &&
(STM32_CORE_PRESCALER == LL_RCC_SYSCLK_DIV_1) &&
(ahb_prescaler(STM32_CORE_PRESCALER) == ahb_prescaler(1)) &&
(MHZ(80) < CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC)) {
LL_RCC_SetAHBPrescaler(ahb_prescaler(STM32_CORE_PRESCALER));

Check notice on line 837 in drivers/clock_control/clock_stm32_ll_common.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/clock_control/clock_stm32_ll_common.c:837 - (ahb_prescaler(STM32_CORE_PRESCALER) == ahb_prescaler(1)) && - (MHZ(80) < CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC)) { + (ahb_prescaler(STM32_CORE_PRESCALER) == ahb_prescaler(1)) && + (MHZ(80) < CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC)) {
}

#if defined(FLASH_ACR_LATENCY)
Expand Down
3 changes: 2 additions & 1 deletion drivers/dma/dmamux_stm32.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,9 @@
LISTIFY(DT_INST_PROP(0, dma_channels), DMAMUX_CHANNEL, (,))
};

#if !defined(CONFIG_SOC_SERIES_STM32G0X)
#if !defined(CONFIG_SOC_SERIES_STM32G0X) && \
!defined(CONFIG_SOC_SERIES_STM32C0X)
#define dmamux_channel_typedef DMAMUX_Channel_TypeDef

Check notice on line 75 in drivers/dma/dmamux_stm32.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/dma/dmamux_stm32.c:75 -#if !defined(CONFIG_SOC_SERIES_STM32G0X) && \ - !defined(CONFIG_SOC_SERIES_STM32C0X) +#if !defined(CONFIG_SOC_SERIES_STM32G0X) && !defined(CONFIG_SOC_SERIES_STM32C0X)
#else
#define dmamux_channel_typedef const DMAMUX_Channel_TypeDef
#endif
Expand Down
2 changes: 1 addition & 1 deletion west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ manifest:
groups:
- hal
- name: hal_stm32
revision: 1ff820533c1b1c17f1a4d7d28ab99a94a234883b
revision: 6f0e5f70cb540c487e3e3678af2e95d0937f9863
path: modules/hal/stm32
groups:
- hal
Expand Down
Loading