3899 views|2 replies

374

Posts

3

Resources
The OP
 

Modification of a file in the GD32F3x0 firmware library [Copy link]

This post was last edited by wenyangzeng on 2018-8-29 22:10 Download the GD32F3x0__Flrmware_Library_V1.0.0 firmware library and find that: 1. The macro definitions of the three LEDs do not correspond to the hardware GPIO port of the development board; 2. The macro definition of button B3 does not correspond to the GPIO port; As a result, the LED cannot light up and button B3 is invalid. As shown in the figure below, LED4, LED5, and LED6 on the development board are connected to PB10, PB8, and PB9 respectively. Button B3 is connected to PB7 But the LED defined in gd32f3x0_eval.h is as follows:
  1. #define LED1_PIN GPIO_PIN_10 #define LED1_GPIO_PORT GPIOC #define LED1_GPIO_CLK RCU_GPIOC #define LED2_PIN GPIO_PIN_11 #define LED2_GPIO_PORT GPIOC #define LED2_GPIO_CLK RCU_GPIOC #define LED3_PIN GPIO_PIN_12 #define LED3_GPIO_PORT GPIOC #define LED3_GPIO_CLK RCU_GPIOC #define LED4_PIN GPIO_PIN_2 #define LED4_GPIO_PORT GPIOC #define LED4_GPIO_CLK RCU_GPIOC The connection for button B3 is defined in PF7 #define USER_KEY_PIN GPIO_PIN_7 #define USER_KEY_GPIO_PORT GPIOF #define USER_KEY_GPIO_CLK RCU_GPIOF #define USER_KEY_EXTI_LINE EXTI_7 #define USER_KEY_EXTI_PORT_SOURCE EXTI_SOURCE_GPIOF #define USER_KEY_EXTI_PIN_SOURCE EXTI_SOURCE_PIN7 #define USER_KEY_EXTI_IRQn EXTI4_15_IRQn It is necessary to modify this to suit the board: [code]typedef enum { LED4 = 0, LED5 = 1, LED6 = 2, }led_typedef_enum;
复制代码
  1. #define LED4_PIN GPIO_PIN_10 #define LED4_GPIO_PORT GPIOB #define LED4_GPIO_CLK RCU_GPIOB #define LED5_PIN GPIO_PIN_8 #define LED5_GPIO_PORT GPIOB #define LED5_GPIO_CLK RCU_GPIOB #define LED6_PIN GPIO_PIN_9 #define LED6_GPIO_PORT GPIOB #define LED6_GPIO_CLK RCU_GPIOB #define USER_KEY_PIN GPIO_PIN_7 #define USER_KEY_GPIO_PORT GPIOB #define USER_KEY_GPIO_CLK RCU_GPIOB #define USER_KEY_EXTI_LINE EXTI_7 #define USER_KEY_EXTI_PORT_SOURCE EXTI_SOURCE_GPIOB #define USER_KEY_EXTI_PIN_SOURCE EXTI_SOURCE_PIN7 #define USER_KEY_EXTI_IRQn EXTI4_15_IRQn
复制代码
In this way, the three LEDs and button b3 can be used normally.















This post is from GD32 MCU

Latest reply

Thanks for sharing this little pit  Details Published on 2018-8-29 20:54
 

1903

Posts

0

Resources
2
 
This needs to be learned, maybe it will be useful
This post is from GD32 MCU
 
 
 

16

Posts

0

Resources
3
 
Thanks for sharing this little pit
This post is from GD32 MCU
 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list