diff --git a/demos/STM32/RT-STM32H743I-NUCLEO144/cfg/mcuconf.h b/demos/STM32/RT-STM32H743I-NUCLEO144/cfg/mcuconf.h index 81c9b911f..c483735bb 100644 --- a/demos/STM32/RT-STM32H743I-NUCLEO144/cfg/mcuconf.h +++ b/demos/STM32/RT-STM32H743I-NUCLEO144/cfg/mcuconf.h @@ -32,6 +32,7 @@ */ #define STM32H7xx_MCUCONF +#define STM32H742_MCUCONF #define STM32H743_MCUCONF #define STM32H753_MCUCONF @@ -52,6 +53,7 @@ * Reading STM32 Reference Manual is required. * Register constants are taken from the ST header. */ +#define STM32_ODEN STM32_ODEN_DISABLED #define STM32_VOS STM32_VOS_SCALE1 #define STM32_PWR_CR1 (PWR_CR1_SVOS_1 | PWR_CR1_SVOS_0) #define STM32_PWR_CR2 (PWR_CR2_BREN) @@ -225,12 +227,8 @@ /* * CAN driver system settings. */ -#define STM32_CAN_USE_CAN1 FALSE -#define STM32_CAN_USE_CAN2 FALSE -#define STM32_CAN_USE_CAN3 FALSE -#define STM32_CAN_CAN1_IRQ_PRIORITY 11 -#define STM32_CAN_CAN2_IRQ_PRIORITY 11 -#define STM32_CAN_CAN3_IRQ_PRIORITY 11 +#define STM32_CAN_USE_FDCAN1 FALSE +#define STM32_CAN_USE_FDCAN2 FALSE /* * DAC driver system settings. @@ -473,6 +471,5 @@ #define STM32_WSPI_QUADSPI1_MDMA_CHANNEL STM32_MDMA_CHANNEL_ID_ANY #define STM32_WSPI_QUADSPI1_MDMA_PRIORITY 1 #define STM32_WSPI_MDMA_ERROR_HOOK(qspip) osalSysHalt("MDMA failure") -#define STM32_USE_STM32_D1_WORKAROUND TRUE #endif /* MCUCONF_H */ diff --git a/os/hal/ports/STM32/STM32H7xx/hal_lld.c b/os/hal/ports/STM32/STM32H7xx/hal_lld.c index 89b65a2e8..19689f55e 100644 --- a/os/hal/ports/STM32/STM32H7xx/hal_lld.c +++ b/os/hal/ports/STM32/STM32H7xx/hal_lld.c @@ -102,6 +102,9 @@ static inline void init_pwr(void) { PWR->CR3 = STM32_PWR_CR3; PWR->CPUCR = STM32_PWR_CPUCR; PWR->D3CR = STM32_VOS; +#if !defined(STM32_ENFORCE_H7_REV_V) + SYSCFG->PWRCR = STM32_ODEN; +#endif while ((PWR->D3CR & PWR_D3CR_VOSRDY) == 0) ; #if STM32_PWR_CR2 & PWR_CR2_BREN diff --git a/os/hal/ports/STM32/STM32H7xx/hal_lld.h b/os/hal/ports/STM32/STM32H7xx/hal_lld.h index a7878fef3..15c31cf93 100644 --- a/os/hal/ports/STM32/STM32H7xx/hal_lld.h +++ b/os/hal/ports/STM32/STM32H7xx/hal_lld.h @@ -645,13 +645,6 @@ #define STM32_PWR_CPUCR 0 #endif -/** - * @brief VOS setting. - */ -#if !defined(STM32_VOS) || defined(__DOXYGEN__) -#define STM32_VOS STM32_VOS_SCALE1 -#endif - /** * @brief ODEN setting. */ @@ -659,6 +652,13 @@ #define STM32_ODEN STM32_ODEN_DISABLED #endif +/** + * @brief VOS setting. + */ +#if !defined(STM32_VOS) || defined(__DOXYGEN__) +#define STM32_VOS STM32_VOS_SCALE1 +#endif + /** * @brief Enables or disables the HSI clock source. */ diff --git a/testhal/STM32/multi/ADC/cfg/stm32h743_nucleo144/mcuconf.h b/testhal/STM32/multi/ADC/cfg/stm32h743_nucleo144/mcuconf.h index db5f60900..db93264b0 100644 --- a/testhal/STM32/multi/ADC/cfg/stm32h743_nucleo144/mcuconf.h +++ b/testhal/STM32/multi/ADC/cfg/stm32h743_nucleo144/mcuconf.h @@ -32,6 +32,7 @@ */ #define STM32H7xx_MCUCONF +#define STM32H742_MCUCONF #define STM32H743_MCUCONF #define STM32H753_MCUCONF @@ -52,6 +53,7 @@ * Reading STM32 Reference Manual is required. * Register constants are taken from the ST header. */ +#define STM32_ODEN STM32_ODEN_DISABLED #define STM32_VOS STM32_VOS_SCALE1 #define STM32_PWR_CR1 (PWR_CR1_SVOS_1 | PWR_CR1_SVOS_0) #define STM32_PWR_CR2 (PWR_CR2_BREN) @@ -177,6 +179,10 @@ #define STM32_IRQ_EXTI19_PRIORITY 6 #define STM32_IRQ_EXTI20_21_PRIORITY 6 +#define STM32_IRQ_MDMA_PRIORITY 9 + +#define STM32_IRQ_QUADSPI1_PRIORITY 10 + #define STM32_IRQ_TIM1_UP_PRIORITY 7 #define STM32_IRQ_TIM1_CC_PRIORITY 7 #define STM32_IRQ_TIM2_PRIORITY 7 @@ -221,12 +227,8 @@ /* * CAN driver system settings. */ -#define STM32_CAN_USE_CAN1 FALSE -#define STM32_CAN_USE_CAN2 FALSE -#define STM32_CAN_USE_CAN3 FALSE -#define STM32_CAN_CAN1_IRQ_PRIORITY 11 -#define STM32_CAN_CAN2_IRQ_PRIORITY 11 -#define STM32_CAN_CAN3_IRQ_PRIORITY 11 +#define STM32_CAN_USE_FDCAN1 FALSE +#define STM32_CAN_USE_FDCAN2 FALSE /* * DAC driver system settings. @@ -461,4 +463,13 @@ */ #define STM32_WDG_USE_IWDG FALSE +/* + * WSPI driver system settings. + */ +#define STM32_WSPI_USE_QUADSPI1 FALSE +#define STM32_WSPI_QUADSPI1_PRESCALER_VALUE 1 +#define STM32_WSPI_QUADSPI1_MDMA_CHANNEL STM32_MDMA_CHANNEL_ID_ANY +#define STM32_WSPI_QUADSPI1_MDMA_PRIORITY 1 +#define STM32_WSPI_MDMA_ERROR_HOOK(qspip) osalSysHalt("MDMA failure") + #endif /* MCUCONF_H */ diff --git a/testhal/STM32/multi/DAC/cfg/stm32h743_nucleo144/mcuconf.h b/testhal/STM32/multi/DAC/cfg/stm32h743_nucleo144/mcuconf.h index d19c6643d..36b4420eb 100644 --- a/testhal/STM32/multi/DAC/cfg/stm32h743_nucleo144/mcuconf.h +++ b/testhal/STM32/multi/DAC/cfg/stm32h743_nucleo144/mcuconf.h @@ -32,6 +32,7 @@ */ #define STM32H7xx_MCUCONF +#define STM32H742_MCUCONF #define STM32H743_MCUCONF #define STM32H753_MCUCONF @@ -52,6 +53,7 @@ * Reading STM32 Reference Manual is required. * Register constants are taken from the ST header. */ +#define STM32_ODEN STM32_ODEN_DISABLED #define STM32_VOS STM32_VOS_SCALE1 #define STM32_PWR_CR1 (PWR_CR1_SVOS_1 | PWR_CR1_SVOS_0) #define STM32_PWR_CR2 (PWR_CR2_BREN) @@ -177,6 +179,10 @@ #define STM32_IRQ_EXTI19_PRIORITY 6 #define STM32_IRQ_EXTI20_21_PRIORITY 6 +#define STM32_IRQ_MDMA_PRIORITY 9 + +#define STM32_IRQ_QUADSPI1_PRIORITY 10 + #define STM32_IRQ_TIM1_UP_PRIORITY 7 #define STM32_IRQ_TIM1_CC_PRIORITY 7 #define STM32_IRQ_TIM2_PRIORITY 7 @@ -221,12 +227,8 @@ /* * CAN driver system settings. */ -#define STM32_CAN_USE_CAN1 FALSE -#define STM32_CAN_USE_CAN2 FALSE -#define STM32_CAN_USE_CAN3 FALSE -#define STM32_CAN_CAN1_IRQ_PRIORITY 11 -#define STM32_CAN_CAN2_IRQ_PRIORITY 11 -#define STM32_CAN_CAN3_IRQ_PRIORITY 11 +#define STM32_CAN_USE_FDCAN1 FALSE +#define STM32_CAN_USE_FDCAN2 FALSE /* * DAC driver system settings. @@ -461,4 +463,13 @@ */ #define STM32_WDG_USE_IWDG FALSE +/* + * WSPI driver system settings. + */ +#define STM32_WSPI_USE_QUADSPI1 FALSE +#define STM32_WSPI_QUADSPI1_PRESCALER_VALUE 1 +#define STM32_WSPI_QUADSPI1_MDMA_CHANNEL STM32_MDMA_CHANNEL_ID_ANY +#define STM32_WSPI_QUADSPI1_MDMA_PRIORITY 1 +#define STM32_WSPI_MDMA_ERROR_HOOK(qspip) osalSysHalt("MDMA failure") + #endif /* MCUCONF_H */ diff --git a/testhal/STM32/multi/SPI/cfg/stm32h743_nucleo144/mcuconf.h b/testhal/STM32/multi/SPI/cfg/stm32h743_nucleo144/mcuconf.h index 2ed75a904..2abd20c0d 100644 --- a/testhal/STM32/multi/SPI/cfg/stm32h743_nucleo144/mcuconf.h +++ b/testhal/STM32/multi/SPI/cfg/stm32h743_nucleo144/mcuconf.h @@ -32,6 +32,7 @@ */ #define STM32H7xx_MCUCONF +#define STM32H742_MCUCONF #define STM32H743_MCUCONF #define STM32H753_MCUCONF @@ -52,6 +53,7 @@ * Reading STM32 Reference Manual is required. * Register constants are taken from the ST header. */ +#define STM32_ODEN STM32_ODEN_DISABLED #define STM32_VOS STM32_VOS_SCALE1 #define STM32_PWR_CR1 (PWR_CR1_SVOS_1 | PWR_CR1_SVOS_0) #define STM32_PWR_CR2 (PWR_CR2_BREN) @@ -177,6 +179,10 @@ #define STM32_IRQ_EXTI19_PRIORITY 6 #define STM32_IRQ_EXTI20_21_PRIORITY 6 +#define STM32_IRQ_MDMA_PRIORITY 9 + +#define STM32_IRQ_QUADSPI1_PRIORITY 10 + #define STM32_IRQ_TIM1_UP_PRIORITY 7 #define STM32_IRQ_TIM1_CC_PRIORITY 7 #define STM32_IRQ_TIM2_PRIORITY 7 @@ -221,12 +227,8 @@ /* * CAN driver system settings. */ -#define STM32_CAN_USE_CAN1 FALSE -#define STM32_CAN_USE_CAN2 FALSE -#define STM32_CAN_USE_CAN3 FALSE -#define STM32_CAN_CAN1_IRQ_PRIORITY 11 -#define STM32_CAN_CAN2_IRQ_PRIORITY 11 -#define STM32_CAN_CAN3_IRQ_PRIORITY 11 +#define STM32_CAN_USE_FDCAN1 FALSE +#define STM32_CAN_USE_FDCAN2 FALSE /* * DAC driver system settings. @@ -461,4 +463,13 @@ */ #define STM32_WDG_USE_IWDG FALSE +/* + * WSPI driver system settings. + */ +#define STM32_WSPI_USE_QUADSPI1 FALSE +#define STM32_WSPI_QUADSPI1_PRESCALER_VALUE 1 +#define STM32_WSPI_QUADSPI1_MDMA_CHANNEL STM32_MDMA_CHANNEL_ID_ANY +#define STM32_WSPI_QUADSPI1_MDMA_PRIORITY 1 +#define STM32_WSPI_MDMA_ERROR_HOOK(qspip) osalSysHalt("MDMA failure") + #endif /* MCUCONF_H */ diff --git a/testhal/STM32/multi/USB_CDC/cfg/stm32h743_nucleo144/mcuconf.h b/testhal/STM32/multi/USB_CDC/cfg/stm32h743_nucleo144/mcuconf.h index 47576540f..ccbe8bec1 100644 --- a/testhal/STM32/multi/USB_CDC/cfg/stm32h743_nucleo144/mcuconf.h +++ b/testhal/STM32/multi/USB_CDC/cfg/stm32h743_nucleo144/mcuconf.h @@ -32,6 +32,7 @@ */ #define STM32H7xx_MCUCONF +#define STM32H742_MCUCONF #define STM32H743_MCUCONF #define STM32H753_MCUCONF @@ -52,6 +53,7 @@ * Reading STM32 Reference Manual is required. * Register constants are taken from the ST header. */ +#define STM32_ODEN STM32_ODEN_DISABLED #define STM32_VOS STM32_VOS_SCALE1 #define STM32_PWR_CR1 (PWR_CR1_SVOS_1 | PWR_CR1_SVOS_0) #define STM32_PWR_CR2 (PWR_CR2_BREN) @@ -177,6 +179,10 @@ #define STM32_IRQ_EXTI19_PRIORITY 6 #define STM32_IRQ_EXTI20_21_PRIORITY 6 +#define STM32_IRQ_MDMA_PRIORITY 9 + +#define STM32_IRQ_QUADSPI1_PRIORITY 10 + #define STM32_IRQ_TIM1_UP_PRIORITY 7 #define STM32_IRQ_TIM1_CC_PRIORITY 7 #define STM32_IRQ_TIM2_PRIORITY 7 @@ -221,12 +227,8 @@ /* * CAN driver system settings. */ -#define STM32_CAN_USE_CAN1 FALSE -#define STM32_CAN_USE_CAN2 FALSE -#define STM32_CAN_USE_CAN3 FALSE -#define STM32_CAN_CAN1_IRQ_PRIORITY 11 -#define STM32_CAN_CAN2_IRQ_PRIORITY 11 -#define STM32_CAN_CAN3_IRQ_PRIORITY 11 +#define STM32_CAN_USE_FDCAN1 FALSE +#define STM32_CAN_USE_FDCAN2 FALSE /* * DAC driver system settings. @@ -461,4 +463,13 @@ */ #define STM32_WDG_USE_IWDG FALSE +/* + * WSPI driver system settings. + */ +#define STM32_WSPI_USE_QUADSPI1 FALSE +#define STM32_WSPI_QUADSPI1_PRESCALER_VALUE 1 +#define STM32_WSPI_QUADSPI1_MDMA_CHANNEL STM32_MDMA_CHANNEL_ID_ANY +#define STM32_WSPI_QUADSPI1_MDMA_PRIORITY 1 +#define STM32_WSPI_MDMA_ERROR_HOOK(qspip) osalSysHalt("MDMA failure") + #endif /* MCUCONF_H */ diff --git a/tools/ftl/processors/conf/mcuconf_stm32h743xx/mcuconf.h.ftl b/tools/ftl/processors/conf/mcuconf_stm32h743xx/mcuconf.h.ftl index f5ad63c93..78776807c 100644 --- a/tools/ftl/processors/conf/mcuconf_stm32h743xx/mcuconf.h.ftl +++ b/tools/ftl/processors/conf/mcuconf_stm32h743xx/mcuconf.h.ftl @@ -64,6 +64,7 @@ * Reading STM32 Reference Manual is required. * Register constants are taken from the ST header. */ +#define STM32_ODEN ${doc.STM32_ODEN!"STM32_ODEN_DISABLED"} #define STM32_VOS ${doc.STM32_VOS!"STM32_VOS_SCALE1"} #define STM32_PWR_CR1 ${doc.STM32_PWR_CR1!"(PWR_CR1_SVOS_1 | PWR_CR1_SVOS_0)"} #define STM32_PWR_CR2 ${doc.STM32_PWR_CR2!"(PWR_CR2_BREN)"} @@ -473,4 +474,13 @@ */ #define STM32_WDG_USE_IWDG ${doc.STM32_WDG_USE_IWDG!"FALSE"} +/* + * WSPI driver system settings. + */ +#define STM32_WSPI_USE_QUADSPI1 ${doc.STM32_WSPI_USE_QUADSPI1!"FALSE"} +#define STM32_WSPI_QUADSPI1_PRESCALER_VALUE ${doc.STM32_WSPI_QUADSPI1_PRESCALER_VALUE!"1"} +#define STM32_WSPI_QUADSPI1_MDMA_CHANNEL ${doc.STM32_WSPI_QUADSPI1_MDMA_CHANNEL!"STM32_MDMA_CHANNEL_ID_ANY"} +#define STM32_WSPI_QUADSPI1_MDMA_PRIORITY ${doc.STM32_WSPI_QUADSPI1_MDMA_PRIORITY!"1"} +#define STM32_WSPI_MDMA_ERROR_HOOK(qspip) ${doc.STM32_WSPI_MDMA_ERROR_HOOK!"osalSysHalt(\"MDMA failure\")"} + #endif /* MCUCONF_H */