From 04a0aba28abda47f99bdf18344466e08fe30a801 Mon Sep 17 00:00:00 2001 From: Gunar Schorcht Date: Mon, 18 Aug 2025 09:50:02 +0200 Subject: [PATCH] boards/common/nucleo144: fix Arduino A0...A5 config for L5, U5 boards Nucleo144 boards for L5 and U5 have a completely different analog pin configuration. It's a very small change, but due to style changes it seems like a big change. In fact, the configuration has been changed just by adding an #ifdef ... #else ... #end and the six analog pins for L5 and U5 boards. --- .../common/nucleo144/include/arduino_iomap.h | 39 ++++++++++++------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/boards/common/nucleo144/include/arduino_iomap.h b/boards/common/nucleo144/include/arduino_iomap.h index b7cbb67301..dd24e0c4cb 100644 --- a/boards/common/nucleo144/include/arduino_iomap.h +++ b/boards/common/nucleo144/include/arduino_iomap.h @@ -59,22 +59,31 @@ extern "C" { #define ARDUINO_PIN_14 GPIO_PIN(PORT_B, 9) #define ARDUINO_PIN_15 GPIO_PIN(PORT_B, 8) -#define ARDUINO_PIN_16 GPIO_PIN(PORT_A, 3) -#define ARDUINO_PIN_17 GPIO_PIN(PORT_C, 0) -#define ARDUINO_PIN_18 GPIO_PIN(PORT_C, 3) -#if defined(CPU_MODEL_STM32F413ZH) || defined(CPU_MODEL_STM32F412ZG) || \ - defined(CPU_MODEL_STM32L496ZG) -# define ARDUINO_PIN_19 GPIO_PIN(PORT_C, 1) -# define ARDUINO_PIN_20 GPIO_PIN(PORT_C, 4) -# define ARDUINO_PIN_21 GPIO_PIN(PORT_C, 5) -#elif defined(CPU_MODEL_STM32F303ZE) -# define ARDUINO_PIN_19 GPIO_PIN(PORT_D, 11) -# define ARDUINO_PIN_20 GPIO_PIN(PORT_D, 12) -# define ARDUINO_PIN_21 GPIO_PIN(PORT_D, 13) +#if defined(CPU_FAM_STM32L5) || defined(CPU_FAM_STM32U5) +# define ARDUINO_PIN_16 GPIO_PIN(PORT_A, 3) +# define ARDUINO_PIN_17 GPIO_PIN(PORT_A, 2) +# define ARDUINO_PIN_18 GPIO_PIN(PORT_C, 3) +# define ARDUINO_PIN_19 GPIO_PIN(PORT_B, 0) +# define ARDUINO_PIN_20 GPIO_PIN(PORT_C, 1) +# define ARDUINO_PIN_21 GPIO_PIN(PORT_C, 0) #else -# define ARDUINO_PIN_19 GPIO_PIN(PORT_F, 3) -# define ARDUINO_PIN_20 GPIO_PIN(PORT_F, 5) -# define ARDUINO_PIN_21 GPIO_PIN(PORT_F, 10) +# define ARDUINO_PIN_16 GPIO_PIN(PORT_A, 3) +# define ARDUINO_PIN_17 GPIO_PIN(PORT_C, 0) +# define ARDUINO_PIN_18 GPIO_PIN(PORT_C, 3) +# if defined(CPU_MODEL_STM32F413ZH) || defined(CPU_MODEL_STM32F412ZG) || \ + defined(CPU_FAM_STM32L4) +# define ARDUINO_PIN_19 GPIO_PIN(PORT_C, 1) +# define ARDUINO_PIN_20 GPIO_PIN(PORT_C, 4) +# define ARDUINO_PIN_21 GPIO_PIN(PORT_C, 5) +# elif defined(CPU_MODEL_STM32F303ZE) +# define ARDUINO_PIN_19 GPIO_PIN(PORT_D, 11) +# define ARDUINO_PIN_20 GPIO_PIN(PORT_D, 12) +# define ARDUINO_PIN_21 GPIO_PIN(PORT_D, 13) +# else +# define ARDUINO_PIN_19 GPIO_PIN(PORT_F, 3) +# define ARDUINO_PIN_20 GPIO_PIN(PORT_F, 5) +# define ARDUINO_PIN_21 GPIO_PIN(PORT_F, 10) +# endif #endif #define ARDUINO_PIN_LAST 21