405
社区成员




GD32VF103V_EVAL是-兆易创新推出的一款GD32VF1系列的评估板,最高主频高达108M,该开发板具有丰富的板载资源,可以充分发挥 GD32VF103VB 的芯片性能。
开发板外观如下图所示:
该开发板常用 板载资源 如下:
本 BSP 目前对外设的支持情况如下:
片上外设 | 支持情况 | 备注 |
---|---|---|
GPIO | 支持 | PA0, PA1... ---> PIN: 0, 1...79 |
UART | 支持 | UART0 - UART4 |
I2C | 支持 | I2C1 |
SPI | 支持 | SPI0 - SPI2 |
ADC | 支持 | ADC0 - ADC2 |
扩展模块 | 支持情况 | 备注 |
暂无 | 暂不支持 | 暂不支持 |
使用说明分为如下两个章节:
快速上手
本章节是为刚接触 RT-Thread 的新手准备的使用说明,遵循简单的步骤即可将 RT-Thread 操作系统运行在该开发板上,看到实验效果 。
进阶使用
本章节是为需要在 RT-Thread 操作系统上使用更多开发板资源的开发者准备的。通过使用 ENV 工具对 BSP 进行配置,可以开启更多板载资源,实现更多高级功能。
本 BSP 为开发者提供 GCC 工程。下面介绍如何将系统运行起来。
使用数据线连接开发板到 PC,使用USB转232连接USART0,打开电源开关。
在工程目录下输入scons
命令编译工程,使用J-link/GD-Link下载程序到开发板。
下载程序成功之后,系统会自动运行,LED 闪烁。
连接开发板对应串口到 PC , 在终端工具里打开相应的串口(115200-8-1-N),复位设备后,可以看到 RT-Thread 的输出信息:
\ | /
- RT - Thread Operating System
/ | \ 4.1.1 build Jun 8 2022 00:49:01
2006 - 2022 Copyright by RT-Thread team
msh >
此 BSP 默认只开启了 GPIO 和 串口0的功能,如果需使用高级功能,需要利用 ENV 工具对BSP 进行配置,步骤如下:
在 bsp 下打开 env 工具。
输入menuconfig
命令配置工程,配置好之后保存退出。
输入pkgs --update
命令更新软件包。
输入scons
命令重新编译工程。
暂无
维护人:
/*!
\file gd32vf103_libopt.h
\brief library optional for gd32vf103
\version 2019-06-05, V1.0.0, demo for GD32VF103
\version 2020-12-18, V1.1.0, demo for GD32VF103
*/
/*
Copyright (c) 2020, GigaDevice Semiconductor Inc.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
OF SUCH DAMAGE.
*/
#ifndef GD32VF103_LIBOPT_H
#define GD32VF103_LIBOPT_H
#include "gd32vf103_adc.h"
#include "gd32vf103_bkp.h"
#include "gd32vf103_can.h"
#include "gd32vf103_crc.h"
#include "gd32vf103_dac.h"
#include "gd32vf103_dma.h"
#include "gd32vf103_eclic.h"
#include "gd32vf103_exmc.h"
#include "gd32vf103_exti.h"
#include "gd32vf103_fmc.h"
#include "gd32vf103_gpio.h"
#include "gd32vf103_i2c.h"
#include "gd32vf103_fwdgt.h"
#include "gd32vf103_dbg.h"
#include "gd32vf103_pmu.h"
#include "gd32vf103_rcu.h"
#include "gd32vf103_rtc.h"
#include "gd32vf103_spi.h"
#include "gd32vf103_timer.h"
#include "gd32vf103_usart.h"
#include "gd32vf103_wwdgt.h"
#include "n200_func.h"
#endif /* GD32VF103_LIBOPT_H */
/*
* Copyright (c) 2006-2022, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2022-06-04 BruceOu first implementation
*/
#include <stddef.h>
#include <rtthread.h>
#include <rtdevice.h>
#include "board.h"
#ifdef RT_USING_SERIAL
#include <drv_usart.h>
#endif
/* System Tick Configuration */
static void systick_config(rt_uint32_t ticks)
{
/* set value */
*(rt_uint64_t *) (TIMER_CTRL_ADDR + TIMER_MTIMECMP) = ticks;
/* enable interrupt */
eclic_irq_enable(CLIC_INT_TMR, 0, 0);
/* clear value */
*(rt_uint64_t *) (TIMER_CTRL_ADDR + TIMER_MTIME) = 0;
}
/* This is the timer interrupt service routine. */
void eclic_mtip_handler(void)
{
/* clear value */
*(rt_uint64_t *) (TIMER_CTRL_ADDR + TIMER_MTIME) = 0;
/* enter interrupt */
rt_interrupt_enter();
/* tick increase */
rt_tick_increase();
/* leave interrupt */
rt_interrupt_leave();
}
/* fixed misaligned bug for qemu */
void *__wrap_memset(void *s, int c, size_t n)
{
return rt_memset(s, c, n);
}
void rt_hw_board_init(void)
{
extern void _init(void);
_init();
systick_config(TIMER_FREQ / RT_TICK_PER_SECOND);
/* USART driver initialization is open by default */
#ifdef RT_USING_SERIAL
rt_hw_usart_init();
#endif
/* Set the shell console output device */
#if defined(RT_USING_CONSOLE) && defined(RT_USING_DEVICE)
rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
#endif
/* Board underlying hardware initialization */
#ifdef RT_USING_COMPONENTS_INIT
rt_components_board_init();
#endif
#ifdef RT_USING_HEAP
rt_system_heap_init((void *) HEAP_BEGIN, (void *) HEAP_END);
#endif
}
/******************** end of file *******************/
…\bsp\gd32\risc-v\gd32vf103v-eval