简述
中电港萤火工场推出基于兆易创新(GigaDevice)GD32VW553是一款 RISC-V 内核的 32位 MCU 的开源硬件GD32VW553-IOT。具体可查看官方提供的三个技术手册文本 https://www.iceasy.com/product/1874659379209633793
环境搭建
https://www.gd32mcu.com/cn/download?kw=GD32VW5
GD32 All-In-One Programmer :代码下载软件。
GD32 Embedded Builder:代码开发软件。
IDE
示例代码
#include "gd32vw55x.h"
#include "systick.h"
#include <stdio.h>
#include "main.h"
#include "gd32vw553h_eval.h"
/*!
\brief toggle the led every 500ms
\param[in] none
\param[out] none
\retval none
*/
void led_spark(void)
{
static __IO uint32_t timingdelaylocal = 0U;
if(timingdelaylocal) {
if(timingdelaylocal < 500U) {
gd_eval_led_on(LED2);
gd_eval_led_on(LED3);
} else {
gd_eval_led_off(LED2);
gd_eval_led_off(LED3);
}
timingdelaylocal--;
} else {
timingdelaylocal = 1000U;
}
}
/*!
\brief main function
\param[in] none
\param[out] none
\retval none
*/
int main(void)
{
/* configure systick */
systick_config();
eclic_priority_group_set(ECLIC_PRIGROUP_LEVEL3_PRIO1);
/* initilize the LEDs, USART and key */
gd_eval_led_init(LED1);
gd_eval_led_init(LED2);
gd_eval_led_init(LED3);
gd_eval_com_init(EVAL_COM0);
gd_eval_key_init(KEY_TAMPER_WAKEUP, KEY_MODE_GPIO);
/* print out the clock frequency of system, AHB, APB1 and APB2 */
printf("\r\nCK_SYS is %d\r\n", rcu_clock_freq_get(CK_SYS));
printf("\r\nCK_AHB is %d\r\n", rcu_clock_freq_get(CK_AHB));
printf("\r\nCK_APB1 is %d\r\n", rcu_clock_freq_get(CK_APB1));
printf("\r\nCK_APB2 is %d\r\n", rcu_clock_freq_get(CK_APB2));
while(1) {
if(RESET == gd_eval_key_state_get(KEY_TAMPER_WAKEUP)) {
delay_1ms(50);
if(SET == gd_eval_key_state_get(KEY_TAMPER_WAKEUP)) {
gd_eval_led_toggle(LED1);
}
}
}
}
代码烧录
连线
一定要注意跳线帽连接方式,如图连接,使开发板进入下载模式,
根据图示Type-C口向下,利用跳线帽将BOOT0接VCC (向下),BOOT1接GND (向上) 【 左侧为BOOT1,右侧为BOOT0 】

