diff options
| author | HiFiPhile <[email protected]> | 2026-06-27 12:53:53 +0200 |
|---|---|---|
| committer | HiFiPhile <[email protected]> | 2026-06-27 12:53:53 +0200 |
| commit | 8ee82a55c9f7ab548e3f72f32c1071c837f1444e (patch) | |
| tree | 011262bd0977bf2a8174a0bc0f706dc980c36881 /hw | |
| parent | 29745b62f9c8beebb3a373c8d5a4191867e500b8 (diff) | |
bsp/stm32h5: fix uart definition
Signed-off-by: HiFiPhile <[email protected]>
Diffstat (limited to 'hw')
| -rw-r--r-- | hw/bsp/stm32h5/boards/stm32h503nucleo/board.h | 2 | ||||
| -rw-r--r-- | hw/bsp/stm32h5/boards/stm32h533nucleo/board.h | 12 | ||||
| -rw-r--r-- | hw/bsp/stm32h5/boards/stm32h563nucleo/board.h | 10 | ||||
| -rw-r--r-- | hw/bsp/stm32h5/boards/stm32h573i_dk/board.h | 18 | ||||
| -rw-r--r-- | hw/bsp/stm32h5/family.c | 6 |
5 files changed, 29 insertions, 19 deletions
diff --git a/hw/bsp/stm32h5/boards/stm32h503nucleo/board.h b/hw/bsp/stm32h5/boards/stm32h503nucleo/board.h index 9dd2b0466..79ae4aebf 100644 --- a/hw/bsp/stm32h5/boards/stm32h503nucleo/board.h +++ b/hw/bsp/stm32h5/boards/stm32h503nucleo/board.h @@ -37,6 +37,8 @@ extern "C" { #endif +#define UART_ID 3 + #define PINID_LED 0 #define PINID_BUTTON 1 #define PINID_UART_TX 2 diff --git a/hw/bsp/stm32h5/boards/stm32h533nucleo/board.h b/hw/bsp/stm32h5/boards/stm32h533nucleo/board.h index bf4f0cfb9..13d757327 100644 --- a/hw/bsp/stm32h5/boards/stm32h533nucleo/board.h +++ b/hw/bsp/stm32h5/boards/stm32h533nucleo/board.h @@ -38,6 +38,8 @@ extern "C" { #endif +#define UART_ID 2 + #define PINID_LED 0 #define PINID_BUTTON 1 #define PINID_UART_TX 2 @@ -46,22 +48,22 @@ extern "C" { static board_pindef_t board_pindef[] = { { // LED .port = GPIOA, - .pin_init = { .Pin = GPIO_PIN_5, .Mode = GPIO_MODE_OUTPUT_PP, .Pull = GPIO_PULLUP, .Speed = GPIO_SPEED_FREQ_HIGH, .Alternate = 0 }, - .active_state = 0 + .pin_init = { .Pin = GPIO_PIN_5, .Mode = GPIO_MODE_OUTPUT_PP, .Pull = GPIO_NOPULL, .Speed = GPIO_SPEED_FREQ_HIGH, .Alternate = 0 }, + .active_state = 1 }, { // Button .port = GPIOC, - .pin_init = { .Pin = GPIO_PIN_13, .Mode = GPIO_MODE_INPUT, .Pull = GPIO_PULLUP, .Speed = GPIO_SPEED_FREQ_HIGH, .Alternate = 0 }, + .pin_init = { .Pin = GPIO_PIN_13, .Mode = GPIO_MODE_INPUT, .Pull = GPIO_PULLDOWN, .Speed = GPIO_SPEED_FREQ_HIGH, .Alternate = 0 }, .active_state = 1 }, { // UART TX .port = GPIOA, - .pin_init = { .Pin = GPIO_PIN_2, .Mode = GPIO_MODE_AF_PP, .Pull = GPIO_PULLUP, .Speed = GPIO_SPEED_FREQ_HIGH, .Alternate = GPIO_AF7_USART3 }, + .pin_init = { .Pin = GPIO_PIN_2, .Mode = GPIO_MODE_AF_PP, .Pull = GPIO_PULLUP, .Speed = GPIO_SPEED_FREQ_HIGH, .Alternate = GPIO_AF7_USART2 }, .active_state = 0 }, { // UART RX .port = GPIOA, - .pin_init = { .Pin = GPIO_PIN_3, .Mode = GPIO_MODE_AF_PP, .Pull = GPIO_PULLUP, .Speed = GPIO_SPEED_FREQ_HIGH, .Alternate = GPIO_AF7_USART3 }, + .pin_init = { .Pin = GPIO_PIN_3, .Mode = GPIO_MODE_AF_PP, .Pull = GPIO_PULLUP, .Speed = GPIO_SPEED_FREQ_HIGH, .Alternate = GPIO_AF7_USART2 }, .active_state = 0 }, }; diff --git a/hw/bsp/stm32h5/boards/stm32h563nucleo/board.h b/hw/bsp/stm32h5/boards/stm32h563nucleo/board.h index 20c91f606..18c13017a 100644 --- a/hw/bsp/stm32h5/boards/stm32h563nucleo/board.h +++ b/hw/bsp/stm32h5/boards/stm32h563nucleo/board.h @@ -37,6 +37,8 @@ extern "C" { #endif +#define UART_ID 3 + #define PINID_LED 0 #define PINID_BUTTON 1 #define PINID_UART_TX 2 @@ -54,13 +56,13 @@ static board_pindef_t board_pindef[] = { .active_state = 0 }, { // UART TX - .port = GPIOA, - .pin_init = { .Pin = GPIO_PIN_9, .Mode = GPIO_MODE_AF_PP, .Pull = GPIO_PULLUP, .Speed = GPIO_SPEED_FREQ_HIGH, .Alternate = GPIO_AF7_USART1 }, + .port = GPIOD, + .pin_init = { .Pin = GPIO_PIN_8, .Mode = GPIO_MODE_AF_PP, .Pull = GPIO_PULLUP, .Speed = GPIO_SPEED_FREQ_HIGH, .Alternate = GPIO_AF7_USART3 }, .active_state = 0 }, { // UART RX - .port = GPIOA, - .pin_init = { .Pin = GPIO_PIN_10, .Mode = GPIO_MODE_AF_PP, .Pull = GPIO_PULLUP, .Speed = GPIO_SPEED_FREQ_HIGH, .Alternate = GPIO_AF7_USART1 }, + .port = GPIOD, + .pin_init = { .Pin = GPIO_PIN_9, .Mode = GPIO_MODE_AF_PP, .Pull = GPIO_PULLUP, .Speed = GPIO_SPEED_FREQ_HIGH, .Alternate = GPIO_AF7_USART3 }, .active_state = 0 }, }; diff --git a/hw/bsp/stm32h5/boards/stm32h573i_dk/board.h b/hw/bsp/stm32h5/boards/stm32h573i_dk/board.h index e9c406486..ce4ef3358 100644 --- a/hw/bsp/stm32h5/boards/stm32h573i_dk/board.h +++ b/hw/bsp/stm32h5/boards/stm32h573i_dk/board.h @@ -43,14 +43,16 @@ extern "C" { #define OTG_FS_VBUS_SENSE 1 #define OTG_HS_VBUS_SENSE 0 -#define PINID_LED 0 -#define PINID_BUTTON 1 -#define PINID_UART_TX 2 -#define PINID_UART_RX 3 -#define PINID_TCPP0203_EN 4 -#define PINID_I2C_SCL 5 -#define PINID_I2C_SDA 6 -#define PINID_TCPP0203_INT 7 +#define UART_ID 1 + +#define PINID_LED 0 +#define PINID_BUTTON 1 +#define PINID_UART_TX 2 +#define PINID_UART_RX 3 +#define PINID_TCPP0203_EN 4 +#define PINID_I2C_SCL 5 +#define PINID_I2C_SDA 6 +#define PINID_TCPP0203_INT 7 static board_pindef_t board_pindef[] = { { // LED diff --git a/hw/bsp/stm32h5/family.c b/hw/bsp/stm32h5/family.c index f52f94f32..867171734 100644 --- a/hw/bsp/stm32h5/family.c +++ b/hw/bsp/stm32h5/family.c @@ -91,8 +91,10 @@ static UART_HandleTypeDef UartHandle = { .Parity = UART_PARITY_NONE, .HwFlowCtl = UART_HWCONTROL_NONE, .Mode = UART_MODE_TX_RX, - .OverSampling = UART_OVERSAMPLING_16, - .AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT + .OverSampling = UART_OVERSAMPLING_16 + }, + .AdvancedInit = { + .AdvFeatureInit = UART_ADVFEATURE_NO_INIT } }; #endif |
