From 6bc840e515fb8e0f58407ed06c202bcf5ff8d885 Mon Sep 17 00:00:00 2001 From: Gunar Schorcht Date: Mon, 18 Aug 2025 09:10:42 +0200 Subject: [PATCH] boards/common/nucleo144: fix Arduino D0/D1 config for L4, L5, U5 family On Nucleo144 boards for L4, L5, U5 Arduino connector pins D0/D1 have a different configuration. According to the User manuals for - [L4 boards]( https://www.st.com/resource/en/user_manual/um2179-stm32-nucleo144-boards-mb1312-stmicroelectronics.pdf), D0/D1 are GPIOs PD9/PD8 - [L5 boards](https://www.st.com/resource/en/user_manual/um2581-stm32l5-nucleo144-board-mb1361-stmicroelectronics.pdf), D0/D1 are GPIOs PD9/PD8 - [U5 boards](https://www.st.com/resource/en/user_manual/um2861-stm32u5-nucleo144-board-mb1549-stmicroelectronics.pdf), D0/D1 are GPIOs PG8/PG7 --- boards/common/nucleo144/include/arduino_iomap.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/boards/common/nucleo144/include/arduino_iomap.h b/boards/common/nucleo144/include/arduino_iomap.h index f123e8f63c..b12a46f4b7 100644 --- a/boards/common/nucleo144/include/arduino_iomap.h +++ b/boards/common/nucleo144/include/arduino_iomap.h @@ -30,11 +30,17 @@ extern "C" { * @{ */ #if defined(CPU_MODEL_STM32F303ZE) -#define ARDUINO_PIN_0 GPIO_PIN(PORT_C, 5) -#define ARDUINO_PIN_1 GPIO_PIN(PORT_C, 4) +# define ARDUINO_PIN_0 GPIO_PIN(PORT_C, 5) +# define ARDUINO_PIN_1 GPIO_PIN(PORT_C, 4) +#elif defined(CPU_FAM_STM32L4) || defined(CPU_FAM_STM32L5) +# define ARDUINO_PIN_0 GPIO_PIN(PORT_D, 9) +# define ARDUINO_PIN_1 GPIO_PIN(PORT_D, 8) +#elif defined(CPU_FAM_STM32U5) +# define ARDUINO_PIN_0 GPIO_PIN(PORT_G, 8) +# define ARDUINO_PIN_1 GPIO_PIN(PORT_G, 7) #else -#define ARDUINO_PIN_0 GPIO_PIN(PORT_G, 9) -#define ARDUINO_PIN_1 GPIO_PIN(PORT_G, 14) +# define ARDUINO_PIN_0 GPIO_PIN(PORT_G, 9) +# define ARDUINO_PIN_1 GPIO_PIN(PORT_G, 14) #endif #define ARDUINO_PIN_2 GPIO_PIN(PORT_F, 15) #define ARDUINO_PIN_3 GPIO_PIN(PORT_E, 13)