From 6bc247b10dec65eea9d65dfb9f9b4df45deb15e9 Mon Sep 17 00:00:00 2001 From: Esteban Volentini Date: Wed, 18 Jun 2025 08:13:58 -0300 Subject: [PATCH] Add fix to GD32F103 support --- board/blue-pill/inc/board.h | 4 ++-- board/blue-pill/src/board.c | 3 ++- module/base/arch/cortex-m/makefile | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/board/blue-pill/inc/board.h b/board/blue-pill/inc/board.h index 6a3cc65..20a9522 100644 --- a/board/blue-pill/inc/board.h +++ b/board/blue-pill/inc/board.h @@ -48,8 +48,8 @@ extern "C" { #if defined(USE_HAL) #define LED HAL_GPIO_PC13 #elif defined(USE_DRIVERS) -// #define LED_PORT GPIOC -// #define LED_PIN GPIO_PIN_3 +#define LED_PORT GPIOC +#define LED_PIN GPIO_PIN_3 #endif /* === Public data type declarations =========================================================== */ diff --git a/board/blue-pill/src/board.c b/board/blue-pill/src/board.c index 49f5005..688bc7b 100644 --- a/board/blue-pill/src/board.c +++ b/board/blue-pill/src/board.c @@ -119,7 +119,8 @@ void BoardSetup(void) { HAL_GPIO_WritePin(GPIOA, GPIO_PIN_3, GPIO_PIN_RESET); /*Configure LED GPIO pin : PC13 */ - GPIO_InitStruct.Pin = LED_PIN GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStruct.Pin = LED_PIN; + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; HAL_GPIO_Init(LED_PORT, &GPIO_InitStruct); diff --git a/module/base/arch/cortex-m/makefile b/module/base/arch/cortex-m/makefile index 2dfa151..3d50c03 100644 --- a/module/base/arch/cortex-m/makefile +++ b/module/base/arch/cortex-m/makefile @@ -54,10 +54,10 @@ AFLAGS += -mthumb # Enable ARM Semihosting support $(if $(findstring ENABLE_ARM_SEMIHOSTING,$(DEFINES)),\ -$(eval SPECS = --specs=nano.specs --specs=rdimon.specs) \ +$(eval SPECS ?= --specs=nano.specs --specs=rdimon.specs) \ $(eval LFLAGS += -l rdimon) \ , \ -$(eval SPECS = --specs=nano.specs --specs=nosys.specs) \ +$(eval SPECS ?= --specs=nano.specs --specs=nosys.specs) \ ) # Linker flags