From c1e3c86a4da19aa580a537d399da6381d97641c5 Mon Sep 17 00:00:00 2001 From: Jamie Smith Date: Sun, 4 Aug 2024 23:12:53 -0700 Subject: [PATCH] A few minor H5 fixes (#318) --- .../TARGET_NUCLEO_H563ZI/PinNames.h | 44 +++++++++---------- targets/targets.json5 | 18 +++++++- targets/upload_method_cfg/NUCLEO_H503RB.cmake | 9 +++- targets/upload_method_cfg/NUCLEO_H563ZI.cmake | 9 +++- 4 files changed, 54 insertions(+), 26 deletions(-) diff --git a/targets/TARGET_STM/TARGET_STM32H5/TARGET_STM32H563xI/TARGET_NUCLEO_H563ZI/PinNames.h b/targets/TARGET_STM/TARGET_STM32H5/TARGET_STM32H563xI/TARGET_NUCLEO_H563ZI/PinNames.h index 32cedb714ee..797d6042c61 100644 --- a/targets/TARGET_STM/TARGET_STM32H5/TARGET_STM32H563xI/TARGET_NUCLEO_H563ZI/PinNames.h +++ b/targets/TARGET_STM/TARGET_STM32H5/TARGET_STM32H563xI/TARGET_NUCLEO_H563ZI/PinNames.h @@ -206,29 +206,29 @@ typedef enum { #ifdef TARGET_FF_ARDUINO_UNO // Arduino Uno (Rev3) pins - /*ARDUINO_UNO_A0 = Px_x, - ARDUINO_UNO_A1 = Px_x, - ARDUINO_UNO_A2 = Px_x, - ARDUINO_UNO_A3 = Px_x, - ARDUINO_UNO_A4 = Px_x, - ARDUINO_UNO_A5 = Px_x, + ARDUINO_UNO_A0 = PA_6, + ARDUINO_UNO_A1 = PC_0, + ARDUINO_UNO_A2 = PC_3, + ARDUINO_UNO_A3 = PB_1, + ARDUINO_UNO_A4 = PC_2, + ARDUINO_UNO_A5 = PF_11, - ARDUINO_UNO_D0 = Px_x, - ARDUINO_UNO_D1 = Px_x, - ARDUINO_UNO_D2 = Px_x, - ARDUINO_UNO_D3 = Px_x, - ARDUINO_UNO_D4 = Px_x, - ARDUINO_UNO_D5 = Px_x, - ARDUINO_UNO_D6 = Px_x, - ARDUINO_UNO_D7 = Px_x, - ARDUINO_UNO_D8 = Px_x, - ARDUINO_UNO_D9 = Px_x, - ARDUINO_UNO_D10 = Px_x, - ARDUINO_UNO_D11 = Px_x, - ARDUINO_UNO_D12 = Px_x, - ARDUINO_UNO_D13 = Px_x, - ARDUINO_UNO_D14 = Px_x, - ARDUINO_UNO_D15 = Px_x,*/ + ARDUINO_UNO_D0 = PB_7, + ARDUINO_UNO_D1 = PB_6, + ARDUINO_UNO_D2 = PG_14, + ARDUINO_UNO_D3 = PE_13, + ARDUINO_UNO_D4 = PE_14, + ARDUINO_UNO_D5 = PE_11, + ARDUINO_UNO_D6 = PE_9, + ARDUINO_UNO_D7 = PG_12, + ARDUINO_UNO_D8 = PF_3, + ARDUINO_UNO_D9 = PD_15, + ARDUINO_UNO_D10 = PD_14, + ARDUINO_UNO_D11 = PB_5, + ARDUINO_UNO_D12 = PG_9, + ARDUINO_UNO_D13 = PA_5, + ARDUINO_UNO_D14 = PB_9, + ARDUINO_UNO_D15 = PB_8, #endif // STDIO for console print diff --git a/targets/targets.json5 b/targets/targets.json5 index dbca8a0445b..b5e2d4a2053 100644 --- a/targets/targets.json5 +++ b/targets/targets.json5 @@ -3133,8 +3133,15 @@ "overrides": { "hse_value": 24000000, "lse_available": 1, - "clock_source": "USE_PLL_HSE_XTAL|USE_PLL_HSI" + "clock_source": "USE_PLL_HSE_XTAL|USE_PLL_HSI", + + // ADC reference voltage is same as MCU VDD. + // MCU VDD defaults to 3.3V though can be changed to 1.8V based on JP2 setting on nucleo board. + "default-adc-vref": 3.3 }, + "supported_form_factors": [ + "ARDUINO_UNO" + ], "detect_code": [ "0832" ], @@ -3160,8 +3167,15 @@ ], "overrides": { "lse_available": 1, - "clock_source": "USE_PLL_HSE_EXTC|USE_PLL_HSI" + "clock_source": "USE_PLL_HSE_EXTC|USE_PLL_HSI", + + // ADC reference voltage is same as MCU VDD. + // MCU VDD defaults to 3.3V though can be changed to 1.8V based on JP4 setting on nucleo board. + "default-adc-vref": 3.3 }, + "supported_form_factors": [ + "ARDUINO_UNO" + ], "detect_code": [ "0878" ], diff --git a/targets/upload_method_cfg/NUCLEO_H503RB.cmake b/targets/upload_method_cfg/NUCLEO_H503RB.cmake index e6d0bb5f08f..0a45f368ded 100644 --- a/targets/upload_method_cfg/NUCLEO_H503RB.cmake +++ b/targets/upload_method_cfg/NUCLEO_H503RB.cmake @@ -8,7 +8,7 @@ # General config parameters # ------------------------------------------------------------- -set(UPLOAD_METHOD_DEFAULT STM32CUBE) +set(UPLOAD_METHOD_DEFAULT MBED) # Config options for MBED # ------------------------------------------------------------- @@ -16,6 +16,13 @@ set(UPLOAD_METHOD_DEFAULT STM32CUBE) set(MBED_UPLOAD_ENABLED TRUE) set(MBED_RESET_BAUDRATE 115200) +# Config options for PYOCD +# ------------------------------------------------------------- + +set(PYOCD_UPLOAD_ENABLED TRUE) +set(PYOCD_TARGET_NAME stm32h503rbtx) +set(PYOCD_CLOCK_SPEED 4000k) + # Config options for STM32CubeIDE # ------------------------------------------------------------- diff --git a/targets/upload_method_cfg/NUCLEO_H563ZI.cmake b/targets/upload_method_cfg/NUCLEO_H563ZI.cmake index d0458404252..5a1477cc84e 100644 --- a/targets/upload_method_cfg/NUCLEO_H563ZI.cmake +++ b/targets/upload_method_cfg/NUCLEO_H563ZI.cmake @@ -8,7 +8,7 @@ # General config parameters # ------------------------------------------------------------- -set(UPLOAD_METHOD_DEFAULT STM32CUBE) +set(UPLOAD_METHOD_DEFAULT MBED) # Config options for MBED # ------------------------------------------------------------- @@ -16,6 +16,13 @@ set(UPLOAD_METHOD_DEFAULT STM32CUBE) set(MBED_UPLOAD_ENABLED TRUE) set(MBED_RESET_BAUDRATE 115200) +# Config options for PYOCD +# ------------------------------------------------------------- + +set(PYOCD_UPLOAD_ENABLED TRUE) +set(PYOCD_TARGET_NAME stm32h563zitx) +set(PYOCD_CLOCK_SPEED 4000k) + # Config options for STM32Cube # -------------------------------------------------------------