mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-03-27 09:32:28 +08:00
Merge branch 'master' of https://github.com/RT-Thread/rt-thread into nuvoton
# Conflicts: # bsp/gd32/gd32107c-eval/rtconfig.h
This commit is contained in:
5
.github/workflows/action.yml
vendored
5
.github/workflows/action.yml
vendored
@@ -35,10 +35,15 @@ jobs:
|
||||
- {RTT_BSP: "asm9260t", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "at91sam9260", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "allwinner_tina", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "gd32/gd32103c-eval", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "gd32/gd32105c-eval", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "gd32/gd32105r-start", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "gd32/gd32107c-eval", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "gd32/gd32205r-start", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "gd32/gd32303e-eval", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "gd32/gd32305r-start", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "gd32/gd32407v-start", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "gd32/gd32450z-eval", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "gd32e230k-start", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "gd32vf103v-eval", RTT_TOOL_CHAIN: "sourcery-riscv-none-embed"}
|
||||
- {RTT_BSP: "gd32303e-eval", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
|
||||
82
.github/workflows/action_tools.yml
vendored
Normal file
82
.github/workflows/action_tools.yml
vendored
Normal file
@@ -0,0 +1,82 @@
|
||||
name: ToolsCI
|
||||
|
||||
# Controls when the action will run. Triggers the workflow on push or pull request
|
||||
# events but only for the master branch
|
||||
on:
|
||||
# Runs at 16:00 UTC (BeiJing 00:00) on the 1st of every month
|
||||
schedule:
|
||||
- cron: '0 16 1 * *'
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths-ignore:
|
||||
- documentation/**
|
||||
- '**/README.md'
|
||||
- '**/README_zh.md'
|
||||
- '**/*.c'
|
||||
- '**/*.h'
|
||||
- '**/*.cpp'
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
paths-ignore:
|
||||
- documentation/**
|
||||
- '**/README.md'
|
||||
- '**/README_zh.md'
|
||||
- '**/*.c'
|
||||
- '**/*.h'
|
||||
- '**/*.cpp'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
name: Tools
|
||||
strategy:
|
||||
fail-fast: false
|
||||
env:
|
||||
TEST_BSP_ROOT: bsp/stm32/stm32f407-atk-explorer
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
- name: Install Tools
|
||||
shell: bash
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get -yqq install scons
|
||||
|
||||
- name: Install Arm ToolChains
|
||||
if: ${{ success() }}
|
||||
shell: bash
|
||||
run: |
|
||||
wget -q https://github.com/RT-Thread/toolchains-ci/releases/download/v1.3/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2
|
||||
sudo tar xjf gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 -C /opt
|
||||
/opt/gcc-arm-none-eabi-10-2020-q4-major/bin/arm-none-eabi-gcc --version
|
||||
echo "RTT_EXEC_PATH=/opt/gcc-arm-none-eabi-10-2020-q4-major/bin" >> $GITHUB_ENV
|
||||
|
||||
- name: Build Tools
|
||||
run: |
|
||||
scons --pyconfig-silent -C $TEST_BSP_ROOT
|
||||
scons -j$(nproc) -C $TEST_BSP_ROOT
|
||||
|
||||
- name: Project generate Tools
|
||||
if: ${{ success() }}
|
||||
run: |
|
||||
echo "Test to generate mdk project"
|
||||
scons --target=mdk -s -C $TEST_BSP_ROOT
|
||||
scons --target=mdk4 -s -C $TEST_BSP_ROOT
|
||||
scons --target=mdk5 -s -C $TEST_BSP_ROOT
|
||||
echo "Test to generate iar project"
|
||||
scons --target=iar -s -C $TEST_BSP_ROOT
|
||||
echo "Test to generate eclipse project"
|
||||
scons --target=eclipse -s -C $TEST_BSP_ROOT
|
||||
echo "Test to generate cmake project"
|
||||
scons --target=cmake -s -C $TEST_BSP_ROOT
|
||||
echo "Test to generate makefile project"
|
||||
scons --target=makefile -s -C $TEST_BSP_ROOT
|
||||
|
||||
- name: Project dist Tools
|
||||
if: ${{ success() }}
|
||||
run: |
|
||||
echo "Test to dist project"
|
||||
scons --dist -C $TEST_BSP_ROOT
|
||||
scons --dist-ide -C $TEST_BSP_ROOT
|
||||
20
.github/workflows/action_utest.yml
vendored
20
.github/workflows/action_utest.yml
vendored
@@ -1,7 +1,25 @@
|
||||
name: AutoTestCI
|
||||
|
||||
# Controls when the action will run. Triggers the workflow on push or pull request
|
||||
on: [push, pull_request]
|
||||
# events but only for the master branch
|
||||
on:
|
||||
# Runs at 16:00 UTC (BeiJing 00:00) on the 1st of every month
|
||||
schedule:
|
||||
- cron: '0 16 1 * *'
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths-ignore:
|
||||
- documentation/**
|
||||
- '**/README.md'
|
||||
- '**/README_zh.md'
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
paths-ignore:
|
||||
- documentation/**
|
||||
- '**/README.md'
|
||||
- '**/README_zh.md'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
#include <stdio.h>
|
||||
#include "app_phy.h"
|
||||
|
||||
#define PHY_BASE_ADDR 0x7
|
||||
#define PHY_BASE_ADDR 0x7
|
||||
|
||||
#define PHY_REG_CONTROL 0x0
|
||||
#define PHY_REG_STATUS 0x1
|
||||
#define PHY_REG_ANE 0x6
|
||||
#define PHY_REG_SPEC_STATUS 0x11
|
||||
#define PHY_REG_EXTEND_STATUS 0x1B
|
||||
#define PHY_REG_EXTEND_STATUS 0x1B
|
||||
|
||||
#define PHY_BIT_CONTROL_RESET 0x8000 /*!< Control reg : reset */
|
||||
#define PHY_BIT_CONTROL_ANEN 0x1000 /*!< Control reg : auto-negotiation enable */
|
||||
#define PHY_BIT_CONTROL_RSAN 0x0200 /*!< Control reg : auto-negotiation restart */
|
||||
#define PHY_BIT_CONTROL_RESET 0x8000 /*!< Control reg : reset */
|
||||
#define PHY_BIT_CONTROL_ANEN 0x1000 /*!< Control reg : auto-negotiation enable */
|
||||
#define PHY_BIT_CONTROL_RSAN 0x0200 /*!< Control reg : auto-negotiation restart */
|
||||
|
||||
#define PHY_BIT_STATUS_ANC 0x0020 /*!< Status reg : auto-negotiation complete */
|
||||
#define PHY_BIT_STATUS_LINK 0x0004 /*!< Status reg : link is up */
|
||||
#define PHY_BIT_STATUS_ANC 0x0020 /*!< Status reg : auto-negotiation complete */
|
||||
#define PHY_BIT_STATUS_LINK 0x0004 /*!< Status reg : link is up */
|
||||
|
||||
#define PHY_BIT_ANE_LPAN 0x0001 /*!< ANE reg : link partner can auto-neg */
|
||||
#define PHY_BIT_ANE_LPAN 0x0001 /*!< ANE reg : link partner can auto-neg */
|
||||
|
||||
#define PHY_BIT_SPEED 0xC000 /*!< specific status reg : speed */
|
||||
#define PHY_BIT_DUPLEX 0x2000 /*!< specific status reg : duplex */
|
||||
@@ -25,24 +25,24 @@
|
||||
#define PHY_BIT_AUTO_MEDIA_REG_DISABLE 0x0200 /*!< extended status reg : auto media register select disable */
|
||||
|
||||
void phy_Reset() {
|
||||
ETH_PhyWrite(PHY_BASE_ADDR, PHY_REG_CONTROL, PHY_BIT_CONTROL_RESET);
|
||||
ETH_PhyWrite(PHY_BASE_ADDR, PHY_REG_CONTROL, PHY_BIT_CONTROL_RESET);
|
||||
|
||||
while (1) {
|
||||
uint32_t ret = ETH_PhyRead(PHY_BASE_ADDR, PHY_REG_CONTROL);
|
||||
if ((ret & PHY_BIT_CONTROL_RESET) == 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
while (1) {
|
||||
uint32_t ret = ETH_PhyRead(PHY_BASE_ADDR, PHY_REG_CONTROL);
|
||||
if ((ret & PHY_BIT_CONTROL_RESET) == 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void phy_AutoMediaSelect() {
|
||||
uint32_t data;
|
||||
uint32_t data;
|
||||
|
||||
// auto media and auto media register selection
|
||||
data = ETH_PhyRead(PHY_BASE_ADDR, PHY_REG_EXTEND_STATUS);
|
||||
data &= ~PHY_BIT_AUTO_MEDIA_DISABLE;
|
||||
data &= ~PHY_BIT_AUTO_MEDIA_REG_DISABLE;
|
||||
ETH_PhyWrite(PHY_BASE_ADDR, PHY_REG_EXTEND_STATUS, data);
|
||||
// auto media and auto media register selection
|
||||
data = ETH_PhyRead(PHY_BASE_ADDR, PHY_REG_EXTEND_STATUS);
|
||||
data &= ~PHY_BIT_AUTO_MEDIA_DISABLE;
|
||||
data &= ~PHY_BIT_AUTO_MEDIA_REG_DISABLE;
|
||||
ETH_PhyWrite(PHY_BASE_ADDR, PHY_REG_EXTEND_STATUS, data);
|
||||
}
|
||||
|
||||
void phy_AutoNeg()
|
||||
@@ -65,61 +65,61 @@ void phy_AutoNeg()
|
||||
}
|
||||
|
||||
BOOL phy_IsLink() {
|
||||
uint32_t ret = ETH_PhyRead(PHY_BASE_ADDR, PHY_REG_STATUS);
|
||||
return (ret & PHY_BIT_STATUS_LINK) ? TRUE : FALSE;
|
||||
uint32_t ret = ETH_PhyRead(PHY_BASE_ADDR, PHY_REG_STATUS);
|
||||
return (ret & PHY_BIT_STATUS_LINK) ? TRUE : FALSE;
|
||||
}
|
||||
|
||||
BOOL phy_PartnerCanAutoNeg() {
|
||||
uint32_t ret = ETH_PhyRead(PHY_BASE_ADDR, PHY_REG_ANE);
|
||||
return (ret & PHY_BIT_ANE_LPAN) ? TRUE : FALSE;
|
||||
uint32_t ret = ETH_PhyRead(PHY_BASE_ADDR, PHY_REG_ANE);
|
||||
return (ret & PHY_BIT_ANE_LPAN) ? TRUE : FALSE;
|
||||
}
|
||||
|
||||
uint32_t phy_GetSpeed() {
|
||||
uint32_t ret = ETH_PhyRead(PHY_BASE_ADDR, PHY_REG_SPEC_STATUS);
|
||||
return ((ret & PHY_BIT_SPEED) >> 14);
|
||||
uint32_t ret = ETH_PhyRead(PHY_BASE_ADDR, PHY_REG_SPEC_STATUS);
|
||||
return ((ret & PHY_BIT_SPEED) >> 14);
|
||||
}
|
||||
|
||||
uint32_t phy_GetDuplex() {
|
||||
uint32_t ret = ETH_PhyRead(PHY_BASE_ADDR, PHY_REG_SPEC_STATUS);
|
||||
return ((ret & PHY_BIT_DUPLEX) >> 13);
|
||||
uint32_t ret = ETH_PhyRead(PHY_BASE_ADDR, PHY_REG_SPEC_STATUS);
|
||||
return ((ret & PHY_BIT_DUPLEX) >> 13);
|
||||
}
|
||||
|
||||
BOOL phy_Init() {
|
||||
phy_AutoMediaSelect();
|
||||
phy_AutoNeg();
|
||||
phy_AutoMediaSelect();
|
||||
phy_AutoNeg();
|
||||
|
||||
if (!phy_PartnerCanAutoNeg()) {
|
||||
printf("Warning:: PHY's partner can't do auto-negotiation\n");
|
||||
}
|
||||
if (!phy_PartnerCanAutoNeg()) {
|
||||
printf("Warning:: PHY's partner can't do auto-negotiation\n");
|
||||
}
|
||||
|
||||
if (!phy_IsLink()) {
|
||||
printf("link is down\n");
|
||||
return FALSE;
|
||||
}
|
||||
if (!phy_IsLink()) {
|
||||
printf("link is down\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
{
|
||||
uint32_t speed = phy_GetSpeed();
|
||||
if (speed == PHY_SPEED_10) {
|
||||
speed = 10;
|
||||
} else if (speed == PHY_SPEED_100) {
|
||||
speed = 100;
|
||||
} else if (speed == PHY_SPEED_1000) {
|
||||
speed = 1000;
|
||||
}
|
||||
{
|
||||
uint32_t speed = phy_GetSpeed();
|
||||
if (speed == PHY_SPEED_10) {
|
||||
speed = 10;
|
||||
} else if (speed == PHY_SPEED_100) {
|
||||
speed = 100;
|
||||
} else if (speed == PHY_SPEED_1000) {
|
||||
speed = 1000;
|
||||
}
|
||||
|
||||
printf("PHY runs in %dM speed %s duplex\n",
|
||||
speed, (phy_GetDuplex() == PHY_DUPLEX_HALF) ? "half" : "full");
|
||||
}
|
||||
printf("PHY runs in %dM speed %s duplex\n",
|
||||
speed, (phy_GetDuplex() == PHY_DUPLEX_HALF) ? "half" : "full");
|
||||
}
|
||||
|
||||
// After auto-negcioation, Mawell PHY need some
|
||||
// time to initial itself.
|
||||
// So we have to delay some time since different
|
||||
// connection way, such as direct wire, hub, switch.
|
||||
// If not to delay, the first several sent frame
|
||||
// may be lost.
|
||||
// Please according to actual environment to tune
|
||||
// this delay.
|
||||
udelay(200000);
|
||||
// After auto-negcioation, Mawell PHY need some
|
||||
// time to initial itself.
|
||||
// So we have to delay some time since different
|
||||
// connection way, such as direct wire, hub, switch.
|
||||
// If not to delay, the first several sent frame
|
||||
// may be lost.
|
||||
// Please according to actual environment to tune
|
||||
// this delay.
|
||||
udelay(200000);
|
||||
|
||||
return TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
|
||||
#include "cmem7_includes.h"
|
||||
|
||||
#define PHY_SPEED_10 0x0 /*!< SPEED : 10M */
|
||||
#define PHY_SPEED_100 0x1 /*!< SPEED : 100M */
|
||||
#define PHY_SPEED_1000 0x2 /*!< SPEED : 1000M */
|
||||
|
||||
#define PHY_DUPLEX_HALF 0x0 /*!< DUPLEX : half */
|
||||
#define PHY_DUPLEX_FULL 0x1 /*!< DUPLEX : full */
|
||||
|
||||
#define PHY_SPEED_10 0x0 /*!< SPEED : 10M */
|
||||
#define PHY_SPEED_100 0x1 /*!< SPEED : 100M */
|
||||
#define PHY_SPEED_1000 0x2 /*!< SPEED : 1000M */
|
||||
|
||||
#define PHY_DUPLEX_HALF 0x0 /*!< DUPLEX : half */
|
||||
#define PHY_DUPLEX_FULL 0x1 /*!< DUPLEX : full */
|
||||
|
||||
void phy_Reset(void);
|
||||
void phy_AutoNeg(void);
|
||||
BOOL phy_IsLink(void);
|
||||
@@ -26,7 +26,7 @@ BOOL phy_Init(void);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* File : emac.c
|
||||
* This file is part of RT-Thread RTOS
|
||||
* COPYRIGHT (C) 2006-2014, RT-Thread Develop Team
|
||||
* COPYRIGHT (C) 2006-2021, RT-Thread Develop Team
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
@@ -38,7 +38,7 @@ struct rt_cme_eth
|
||||
struct eth_device parent;
|
||||
|
||||
/* interface address info. */
|
||||
rt_uint8_t dev_addr[MAX_ADDR_LEN]; /* hw address */
|
||||
rt_uint8_t dev_addr[MAX_ADDR_LEN]; /* hw address */
|
||||
|
||||
uint32_t ETH_Speed;
|
||||
uint32_t ETH_Mode;
|
||||
@@ -95,8 +95,8 @@ uint32_t txTotalMemory = 0x2000;
|
||||
BOOL isRxNoBuf = FALSE;
|
||||
|
||||
#define ETH_MAX_PACKET_SIZE 1520 /* ETH_HEADER + ETH_EXTRA + MAX_ETH_PAYLOAD + ETH_CRC */
|
||||
#define ETH_RXBUFNB 4
|
||||
#define ETH_TXBUFNB 2
|
||||
#define ETH_RXBUFNB 4
|
||||
#define ETH_TXBUFNB 2
|
||||
|
||||
struct eth_rx_buffer
|
||||
{
|
||||
|
||||
@@ -32,23 +32,23 @@ static struct rt_serial_device serial2;
|
||||
static rt_err_t CME_M7_configure(struct rt_serial_device *serial, struct serial_configure *cfg)
|
||||
{
|
||||
struct CME_M7_uart* uart;
|
||||
UART_InitTypeDef init;
|
||||
UART_InitTypeDef init;
|
||||
|
||||
RT_ASSERT(serial != RT_NULL);
|
||||
RT_ASSERT(cfg != RT_NULL);
|
||||
|
||||
uart = (struct CME_M7_uart *)serial->parent.user_data;
|
||||
|
||||
init.UART_BaudRate = cfg->baud_rate;
|
||||
init.UART_StopBits = UART_StopBits_1;
|
||||
init.UART_BaudRate = cfg->baud_rate;
|
||||
init.UART_StopBits = UART_StopBits_1;
|
||||
init.UART_Parity = UART_Parity_None;
|
||||
init.UART_LoopBack = FALSE;
|
||||
init.UART_RxEn = TRUE;
|
||||
init.UART_CtsEn = FALSE;
|
||||
init.UART_LoopBack = FALSE;
|
||||
init.UART_RxEn = TRUE;
|
||||
init.UART_CtsEn = FALSE;
|
||||
|
||||
UART_Init(uart->uart_device, &init);
|
||||
uart->uart_device->RX_RESET = 1;
|
||||
UART_Enable(uart->uart_device, TRUE);
|
||||
UART_Enable(uart->uart_device, TRUE);
|
||||
uart->uart_device->RX_RESET = 0;
|
||||
|
||||
return RT_EOK;
|
||||
@@ -67,24 +67,24 @@ static rt_err_t CME_M7_control(struct rt_serial_device *serial, int cmd, void *a
|
||||
case RT_DEVICE_CTRL_CLR_INT:
|
||||
/* disable rx irq */
|
||||
NVIC_InitStructure.NVIC_IRQChannel = uart->irq;
|
||||
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;
|
||||
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
|
||||
NVIC_InitStructure.NVIC_IRQChannelCmd = FALSE;
|
||||
NVIC_Init(&NVIC_InitStructure);
|
||||
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;
|
||||
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
|
||||
NVIC_InitStructure.NVIC_IRQChannelCmd = FALSE;
|
||||
NVIC_Init(&NVIC_InitStructure);
|
||||
|
||||
UART_EnableInt(uart->uart_device, UART_Int_RxNotEmpty, FALSE);
|
||||
UART_EnableInt(uart->uart_device, UART_Int_RxNotEmpty, FALSE);
|
||||
break;
|
||||
|
||||
case RT_DEVICE_CTRL_SET_INT:
|
||||
/* enable rx irq */
|
||||
NVIC_InitStructure.NVIC_IRQChannel = uart->irq;
|
||||
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;
|
||||
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
|
||||
NVIC_InitStructure.NVIC_IRQChannelCmd = TRUE;
|
||||
NVIC_Init(&NVIC_InitStructure);
|
||||
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;
|
||||
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
|
||||
NVIC_InitStructure.NVIC_IRQChannelCmd = TRUE;
|
||||
NVIC_Init(&NVIC_InitStructure);
|
||||
|
||||
UART_ClearInt(uart->uart_device, UART_Int_RxNotEmpty);
|
||||
UART_EnableInt(uart->uart_device, UART_Int_RxNotEmpty, TRUE);
|
||||
UART_ClearInt(uart->uart_device, UART_Int_RxNotEmpty);
|
||||
UART_EnableInt(uart->uart_device, UART_Int_RxNotEmpty, TRUE);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -132,8 +132,8 @@ static const struct rt_uart_ops CME_M7_uart_ops =
|
||||
|
||||
int rt_hw_uart_init(void)
|
||||
{
|
||||
struct CME_M7_uart* uart;
|
||||
struct rt_serial_device *serial;
|
||||
struct CME_M7_uart* uart;
|
||||
struct rt_serial_device *serial;
|
||||
struct serial_configure config = RT_SERIAL_CONFIG_DEFAULT;
|
||||
|
||||
#ifdef RT_USING_UART0
|
||||
@@ -143,7 +143,7 @@ int rt_hw_uart_init(void)
|
||||
serial->ops = &CME_M7_uart_ops;
|
||||
serial->config = config;
|
||||
|
||||
/* register UART device */
|
||||
/* register UART device */
|
||||
rt_hw_serial_register(serial,
|
||||
"uart0",
|
||||
RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX,
|
||||
@@ -157,14 +157,14 @@ int rt_hw_uart_init(void)
|
||||
serial->ops = &CME_M7_uart_ops;
|
||||
serial->config = config;
|
||||
|
||||
/* register UART device */
|
||||
/* register UART device */
|
||||
rt_hw_serial_register(serial,
|
||||
"uart2",
|
||||
RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX,
|
||||
uart);
|
||||
#endif /* RT_USING_UART2 */
|
||||
|
||||
return RT_EOK;
|
||||
return RT_EOK;
|
||||
}
|
||||
INIT_BOARD_EXPORT(rt_hw_uart_init);
|
||||
|
||||
|
||||
@@ -396,6 +396,28 @@ void rt_hw_interrupt_ack(rt_uint32_t fiq_irq, rt_uint32_t id)
|
||||
at91_sys_write(AT91_AIC_EOICR, 0x0);
|
||||
}
|
||||
|
||||
void rt_interrupt_dispatch(rt_uint32_t fiq_irq)
|
||||
{
|
||||
rt_isr_handler_t isr_func;
|
||||
rt_uint32_t irq;
|
||||
void *param;
|
||||
|
||||
/* get irq number */
|
||||
irq = rt_hw_interrupt_get_active(fiq_irq);
|
||||
|
||||
/* get interrupt service routine */
|
||||
isr_func = irq_desc[irq].handler;
|
||||
param = irq_desc[irq].param;
|
||||
|
||||
/* turn to interrupt service routine */
|
||||
isr_func(irq, param);
|
||||
|
||||
rt_hw_interrupt_ack(fiq_irq, irq);
|
||||
#ifdef RT_USING_INTERRUPT_INFO
|
||||
irq_desc[irq].counter ++;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef RT_USING_FINSH
|
||||
#ifdef RT_USING_INTERRUPT_INFO
|
||||
void list_irq(void)
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
<tExt>*.txt; *.h; *.inc</tExt>
|
||||
<pExt>*.plm</pExt>
|
||||
<CppX>*.cpp</CppX>
|
||||
<nMigrate>0</nMigrate>
|
||||
</Extensions>
|
||||
|
||||
<DaveTm>
|
||||
@@ -31,6 +32,7 @@
|
||||
<BeepAtEnd>1</BeepAtEnd>
|
||||
<RunSim>1</RunSim>
|
||||
<RunTarget>0</RunTarget>
|
||||
<RunAbUc>0</RunAbUc>
|
||||
</OPTTT>
|
||||
<OPTHX>
|
||||
<HexSelection>1</HexSelection>
|
||||
@@ -108,10 +110,10 @@
|
||||
<tRtrace>1</tRtrace>
|
||||
<sRSysVw>1</sRSysVw>
|
||||
<tRSysVw>1</tRSysVw>
|
||||
<tPdscDbg>1</tPdscDbg>
|
||||
<sRunDeb>0</sRunDeb>
|
||||
<sLrtime>0</sLrtime>
|
||||
<nTsel>5</nTsel>
|
||||
<bEvRecOn>1</bEvRecOn>
|
||||
<nTsel>18</nTsel>
|
||||
<sDll></sDll>
|
||||
<sDllPa></sDllPa>
|
||||
<sDlgDll></sDlgDll>
|
||||
@@ -168,6 +170,13 @@
|
||||
</DebugFlag>
|
||||
<LintExecutable></LintExecutable>
|
||||
<LintConfigFile></LintConfigFile>
|
||||
<bLintAuto>0</bLintAuto>
|
||||
<bAutoGenD>0</bAutoGenD>
|
||||
<LntExFlags>0</LntExFlags>
|
||||
<pMisraName></pMisraName>
|
||||
<pszMrule></pszMrule>
|
||||
<pSingCmds></pSingCmds>
|
||||
<pMultCmds></pMultCmds>
|
||||
</TargetOption>
|
||||
</Target>
|
||||
|
||||
|
||||
@@ -72,14 +72,18 @@
|
||||
<UserProg2Name></UserProg2Name>
|
||||
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||
<nStopB1X>0</nStopB1X>
|
||||
<nStopB2X>0</nStopB2X>
|
||||
</BeforeMake>
|
||||
<AfterMake>
|
||||
<RunUserProg1>0</RunUserProg1>
|
||||
<RunUserProg1>1</RunUserProg1>
|
||||
<RunUserProg2>0</RunUserProg2>
|
||||
<UserProg1Name></UserProg1Name>
|
||||
<UserProg1Name>fromelf.exe --bin -o $L@L.bin #L</UserProg1Name>
|
||||
<UserProg2Name></UserProg2Name>
|
||||
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||
<nStopA1X>0</nStopA1X>
|
||||
<nStopA2X>0</nStopA2X>
|
||||
</AfterMake>
|
||||
<SelectedForBatchBuild>0</SelectedForBatchBuild>
|
||||
<SVCSIdString></SVCSIdString>
|
||||
@@ -141,10 +145,9 @@
|
||||
<RestoreToolbox>1</RestoreToolbox>
|
||||
<RestoreTracepoints>1</RestoreTracepoints>
|
||||
<RestoreSysVw>1</RestoreSysVw>
|
||||
<UsePdscDebugDescription>1</UsePdscDebugDescription>
|
||||
</Target>
|
||||
<RunDebugAfterBuild>0</RunDebugAfterBuild>
|
||||
<TargetSelection>5</TargetSelection>
|
||||
<TargetSelection>18</TargetSelection>
|
||||
<SimDlls>
|
||||
<CpuDll></CpuDll>
|
||||
<CpuDllArguments></CpuDllArguments>
|
||||
@@ -224,6 +227,7 @@
|
||||
<useUlib>0</useUlib>
|
||||
<EndSel>0</EndSel>
|
||||
<uLtcg>0</uLtcg>
|
||||
<nSecure>0</nSecure>
|
||||
<RoSelD>3</RoSelD>
|
||||
<RwSelD>3</RwSelD>
|
||||
<CodeSel>0</CodeSel>
|
||||
@@ -356,8 +360,15 @@
|
||||
<wLevel>2</wLevel>
|
||||
<uThumb>0</uThumb>
|
||||
<uSurpInc>0</uSurpInc>
|
||||
<uC99>0</uC99>
|
||||
<uC99>1</uC99>
|
||||
<useXO>0</useXO>
|
||||
<v6Lang>1</v6Lang>
|
||||
<v6LangP>1</v6LangP>
|
||||
<vShortEn>1</vShortEn>
|
||||
<vShortWch>1</vShortWch>
|
||||
<v6Lto>0</v6Lto>
|
||||
<v6WtE>0</v6WtE>
|
||||
<v6Rtti>0</v6Rtti>
|
||||
<VariousControls>
|
||||
<MiscControls></MiscControls>
|
||||
<Define>RT_USING_INTERRUPT_INFO</Define>
|
||||
@@ -375,6 +386,7 @@
|
||||
<NoWarn>0</NoWarn>
|
||||
<uSurpInc>0</uSurpInc>
|
||||
<useXO>0</useXO>
|
||||
<uClangAs>0</uClangAs>
|
||||
<VariousControls>
|
||||
<MiscControls></MiscControls>
|
||||
<Define></Define>
|
||||
|
||||
@@ -14,7 +14,11 @@
|
||||
|
||||
#include <dfs_elm.h>
|
||||
#include <dfs_fs.h>
|
||||
#include <dfs_posix.h>
|
||||
#include <dfs_file.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/statfs.h>
|
||||
#include "drv_gpio.h"
|
||||
|
||||
// #define DRV_DEBUG
|
||||
|
||||
@@ -18,12 +18,14 @@ DEPENDS = [""]
|
||||
# SOURCES: Need to compile c and c++ source, auto search when SOURCES is empty
|
||||
#
|
||||
# LOCAL_CPPPATH: Local file path (.h/.c/.cpp)
|
||||
# LOCAL_CCFLAGS: Local compilation parameter
|
||||
# LOCAL_CFLAGS: Local c compilation parameter
|
||||
# LOCAL_CCFLAGS: Local c/c++ compilation parameter
|
||||
# LOCAL_CXXFLAGS: Local c++ compilation parameter
|
||||
# LOCAL_ASFLAGS: Local assembly parameters
|
||||
#
|
||||
# CPPPATH: Global file path (.h/.c/.cpp), auto search when LOCAL_CPPPATH/CPPPATH
|
||||
# is empty # no pass!!!
|
||||
# CCFLAGS: Global compilation parameter
|
||||
# CFLAGS : Global compilation parameter
|
||||
# ASFLAGS: Global assembly parameters
|
||||
#
|
||||
# CPPDEFINES: Global macro definition
|
||||
@@ -37,12 +39,16 @@ DEPENDS = [""]
|
||||
CWD = GetCurrentDir()
|
||||
SOURCES = Glob("./source/*.c")
|
||||
|
||||
LOCAL_CPPPATH = []
|
||||
LOCAL_CCFLAGS = ""
|
||||
LOCAL_CPPPATH = []
|
||||
LOCAL_CFLAGS = ""
|
||||
LOCAL_CCFLAGS = ""
|
||||
LOCAL_CXXFLAGS = ""
|
||||
LOCAL_ASFLAGS = ""
|
||||
|
||||
CPPPATH = [GetCurrentDir(), os.path.join(GetCurrentDir(), 'include')]
|
||||
CCFLAGS = ""
|
||||
CFLAGS = ""
|
||||
CCFLAGS = ""
|
||||
CXXFLAGS = ""
|
||||
ASFLAGS = ""
|
||||
|
||||
CPPDEFINES = []
|
||||
@@ -61,10 +67,14 @@ CPPPATH_IGNORE = []
|
||||
#---------------------------------------------------------------------------------
|
||||
objs = DefineGroup(name = PKGNAME, src = SOURCES, depend = DEPENDS,
|
||||
CPPPATH = CPPPATH,
|
||||
CFLAGS = CFLAGS,
|
||||
CCFLAGS = CCFLAGS,
|
||||
CXXFLAGS = CXXFLAGS,
|
||||
ASFLAGS = ASFLAGS,
|
||||
LOCAL_CPPPATH = LOCAL_CPPPATH,
|
||||
LOCAL_CFLAGS = LOCAL_CFLAGS,
|
||||
LOCAL_CCFLAGS = LOCAL_CCFLAGS,
|
||||
LOCAL_CXXFLAGS = LOCAL_CXXFLAGS,
|
||||
LOCAL_ASFLAGS = LOCAL_ASFLAGS,
|
||||
CPPDEFINES = CPPDEFINES,
|
||||
LOCAL_CPPDEFINES = LOCAL_CPPDEFINES,
|
||||
|
||||
@@ -19,12 +19,14 @@ DEPENDS = [""]
|
||||
# SOURCES: Need to compile c and c++ source, auto search when SOURCES is empty
|
||||
#
|
||||
# LOCAL_CPPPATH: Local file path (.h/.c/.cpp)
|
||||
# LOCAL_CCFLAGS: Local compilation parameter
|
||||
# LOCAL_CFLAGS: Local c compilation parameter
|
||||
# LOCAL_CCFLAGS: Local c/c++ compilation parameter
|
||||
# LOCAL_CXXFLAGS: Local c++ compilation parameter
|
||||
# LOCAL_ASFLAGS: Local assembly parameters
|
||||
#
|
||||
# CPPPATH: Global file path (.h/.c/.cpp), auto search when LOCAL_CPPPATH/CPPPATH
|
||||
# is empty # no pass!!!
|
||||
# CCFLAGS: Global compilation parameter
|
||||
# CFLAGS : Global compilation parameter
|
||||
# ASFLAGS: Global assembly parameters
|
||||
#
|
||||
# CPPDEFINES: Global macro definition
|
||||
@@ -35,22 +37,26 @@ DEPENDS = [""]
|
||||
#
|
||||
# LINKFLAGS: Link options
|
||||
#---------------------------------------------------------------------------------
|
||||
CWD = GetCurrentDir()
|
||||
SOURCES = Glob("./source/*.c")
|
||||
SOURCES += Glob("./source/*.S")
|
||||
|
||||
LOCAL_CPPPATH = []
|
||||
LOCAL_CCFLAGS = ""
|
||||
LOCAL_CPPPATH = []
|
||||
LOCAL_CFLAGS = ""
|
||||
LOCAL_CCFLAGS = ""
|
||||
LOCAL_CXXFLAGS = ""
|
||||
LOCAL_ASFLAGS = ""
|
||||
|
||||
CPPPATH = [GetCurrentDir(), os.path.join(GetCurrentDir(), 'include')]
|
||||
CCFLAGS = ""
|
||||
CFLAGS = ""
|
||||
CCFLAGS = ""
|
||||
CXXFLAGS = ""
|
||||
ASFLAGS = ""
|
||||
|
||||
CPPDEFINES = []
|
||||
LOCAL_CPPDEFINES = []
|
||||
|
||||
LIBS = []
|
||||
LIBPATH = []
|
||||
LIBPATH = []
|
||||
|
||||
LINKFLAGS = ""
|
||||
|
||||
@@ -62,10 +68,14 @@ CPPPATH_IGNORE = []
|
||||
#---------------------------------------------------------------------------------
|
||||
objs = DefineGroup(name = PKGNAME, src = SOURCES, depend = DEPENDS,
|
||||
CPPPATH = CPPPATH,
|
||||
CFLAGS = CFLAGS,
|
||||
CCFLAGS = CCFLAGS,
|
||||
CXXFLAGS = CXXFLAGS,
|
||||
ASFLAGS = ASFLAGS,
|
||||
LOCAL_CPPPATH = LOCAL_CPPPATH,
|
||||
LOCAL_CFLAGS = LOCAL_CFLAGS,
|
||||
LOCAL_CCFLAGS = LOCAL_CCFLAGS,
|
||||
LOCAL_CXXFLAGS = LOCAL_CXXFLAGS,
|
||||
LOCAL_ASFLAGS = LOCAL_ASFLAGS,
|
||||
CPPDEFINES = CPPDEFINES,
|
||||
LOCAL_CPPDEFINES = LOCAL_CPPDEFINES,
|
||||
|
||||
@@ -6,8 +6,8 @@ cwd = os.path.join(str(Dir('#')), 'applications')
|
||||
src = Glob('*.c')
|
||||
CPPPATH = [cwd, str(Dir('#'))]
|
||||
|
||||
CCFLAGS = ' -c -mistack -ffunction-sections'
|
||||
CFLAGS = ' -c -mistack -ffunction-sections'
|
||||
|
||||
group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH, CCFLAGS=CCFLAGS)
|
||||
group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH, CFLAGS=CFLAGS)
|
||||
|
||||
Return('group')
|
||||
|
||||
@@ -69,6 +69,14 @@
|
||||
#include <dfs_posix.h>
|
||||
#define PATH_SEPARATOR '/'
|
||||
#endif
|
||||
#if defined(RTGUI_USING_DFS_FILERW)
|
||||
#include <dfs_file.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/statfs.h>
|
||||
#define PATH_SEPARATOR '/'
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
@@ -77,8 +85,8 @@ struct photo_event
|
||||
{
|
||||
struct rtgui_event_win win;
|
||||
rt_uint32_t cmd;
|
||||
rt_uint8_t* path;
|
||||
rt_uint8_t* format;
|
||||
rt_uint8_t* path;
|
||||
rt_uint8_t* format;
|
||||
};
|
||||
|
||||
/* Private defines -----------------------------------------------------------*/
|
||||
@@ -95,10 +103,10 @@ volatile rt_uint32_t rt_system_status = 0;
|
||||
#if defined(RT_USING_RTGUI)
|
||||
static rt_bool_t pic_view_event_handler(rtgui_object_t *object, rtgui_event_t *event)
|
||||
{
|
||||
rt_bool_t result;
|
||||
rt_bool_t result;
|
||||
rt_bool_t load = RT_FALSE;
|
||||
|
||||
result = rtgui_container_event_handler(object, event);
|
||||
result = rtgui_container_event_handler(object, event);
|
||||
|
||||
switch(event->type)
|
||||
{
|
||||
@@ -108,27 +116,27 @@ static rt_bool_t pic_view_event_handler(rtgui_object_t *object, rtgui_event_t *e
|
||||
|
||||
case RTGUI_EVENT_MOUSE_BUTTON:
|
||||
{
|
||||
struct rtgui_event_mouse *mouse = (struct rtgui_event_mouse *)event;
|
||||
struct rtgui_event_mouse *mouse = (struct rtgui_event_mouse *)event;
|
||||
|
||||
if (mouse->button == RTGUI_MOUSE_BUTTON_LEFT | RTGUI_MOUSE_BUTTON_UP)
|
||||
{
|
||||
if (mouse->button == RTGUI_MOUSE_BUTTON_LEFT | RTGUI_MOUSE_BUTTON_UP)
|
||||
{
|
||||
rt_kprintf("APP: left click (%x)\n", mouse->button);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (load)
|
||||
{
|
||||
struct rtgui_dc* dc;
|
||||
rtgui_rect_t rect;
|
||||
{
|
||||
struct rtgui_dc* dc;
|
||||
rtgui_rect_t rect;
|
||||
rtgui_image_t* image;
|
||||
|
||||
image = rtgui_image_create_from_file("jpg", "/test9.jpg", RT_FALSE);
|
||||
// image = rtgui_image_create_from_file("bmp", "/test_565.bmp", RT_FALSE);
|
||||
|
||||
dc = rtgui_dc_begin_drawing(RTGUI_WIDGET(object));
|
||||
if (dc == RT_NULL)
|
||||
dc = rtgui_dc_begin_drawing(RTGUI_WIDGET(object));
|
||||
if (dc == RT_NULL)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
@@ -138,9 +146,9 @@ static rt_bool_t pic_view_event_handler(rtgui_object_t *object, rtgui_event_t *e
|
||||
rect.x1 +=10;
|
||||
rect.y1 +=10;
|
||||
|
||||
if (image != RT_NULL)
|
||||
if (image != RT_NULL)
|
||||
{
|
||||
rtgui_image_blit(image, dc, &rect);
|
||||
rtgui_image_blit(image, dc, &rect);
|
||||
rtgui_image_destroy(image);
|
||||
}
|
||||
else
|
||||
@@ -148,10 +156,10 @@ static rt_bool_t pic_view_event_handler(rtgui_object_t *object, rtgui_event_t *e
|
||||
rt_kprintf("APP err: no image found!\n");
|
||||
}
|
||||
|
||||
rtgui_dc_end_drawing(dc, RT_TRUE);
|
||||
}
|
||||
rtgui_dc_end_drawing(dc, RT_TRUE);
|
||||
}
|
||||
|
||||
return result;
|
||||
return result;
|
||||
}
|
||||
|
||||
static void app_main(void *parameter)
|
||||
@@ -169,21 +177,21 @@ static void app_main(void *parameter)
|
||||
lcd->control(lcd, RTGRAPHIC_CTRL_GET_INFO, (void *)&lcd_info);
|
||||
rt_kprintf("LCD size: %dX%d\n", lcd_info.width, lcd_info.height);
|
||||
|
||||
/* create application */
|
||||
struct rtgui_app *app;
|
||||
app = rtgui_app_create("gui_app");
|
||||
if (app == RT_NULL)
|
||||
/* create application */
|
||||
struct rtgui_app *app;
|
||||
app = rtgui_app_create("gui_app");
|
||||
if (app == RT_NULL)
|
||||
{
|
||||
rt_kprintf("Create application \"gui_app\" failed!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
struct rtgui_rect rect1, rect2, rect3;
|
||||
struct rtgui_rect rect1, rect2, rect3;
|
||||
struct rtgui_win *win_info, *win_main, *win_hello;
|
||||
struct rtgui_container *container;
|
||||
struct rtgui_container *container;
|
||||
struct rtgui_label* label;
|
||||
|
||||
rtgui_graphic_driver_get_rect(rtgui_graphic_driver_get_default(), &rect1);
|
||||
rtgui_graphic_driver_get_rect(rtgui_graphic_driver_get_default(), &rect1);
|
||||
rect2.x1 = rect1.x1;
|
||||
rect2.y1 = 25;
|
||||
rect2.x2 = rect1.x2;
|
||||
@@ -191,119 +199,119 @@ static void app_main(void *parameter)
|
||||
rect1.y2 = 25;
|
||||
|
||||
/* create info window */
|
||||
win_info = rtgui_win_create(RT_NULL, "info",
|
||||
win_info = rtgui_win_create(RT_NULL, "info",
|
||||
&rect1,
|
||||
RTGUI_WIN_STYLE_NO_BORDER | RTGUI_WIN_STYLE_NO_TITLE);
|
||||
if (win_info == RT_NULL)
|
||||
{
|
||||
if (win_info == RT_NULL)
|
||||
{
|
||||
rt_kprintf("Create window \"info\" failed!\n");
|
||||
rtgui_app_destroy(app);
|
||||
rtgui_app_destroy(app);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* create container in info window */
|
||||
container = rtgui_container_create();
|
||||
if (container == RT_NULL)
|
||||
{
|
||||
container = rtgui_container_create();
|
||||
if (container == RT_NULL)
|
||||
{
|
||||
rt_kprintf("Create container failed!\n");
|
||||
return;
|
||||
}
|
||||
rtgui_widget_set_rect(RTGUI_WIDGET(container), &rect1);
|
||||
return;
|
||||
}
|
||||
rtgui_widget_set_rect(RTGUI_WIDGET(container), &rect1);
|
||||
rtgui_container_add_child(RTGUI_CONTAINER(win_info), RTGUI_WIDGET(container));
|
||||
|
||||
/* create lable in info window */
|
||||
label = rtgui_label_create("RT-Thread & RTGUI");
|
||||
label = rtgui_label_create("RT-Thread & RTGUI");
|
||||
if (label == RT_NULL)
|
||||
{
|
||||
rt_kprintf("Create lable failed!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
RTGUI_WIDGET_TEXTALIGN(RTGUI_WIDGET(label)) = RTGUI_ALIGN_LEFT;
|
||||
RTGUI_WIDGET_BACKGROUND(RTGUI_WIDGET(label)) = red;
|
||||
RTGUI_WIDGET_TEXTALIGN(RTGUI_WIDGET(label)) = RTGUI_ALIGN_LEFT;
|
||||
RTGUI_WIDGET_BACKGROUND(RTGUI_WIDGET(label)) = red;
|
||||
RTGUI_WIDGET_FOREGROUND(RTGUI_WIDGET(label)) = white;
|
||||
|
||||
rect3.x1 = rect1.x1 + 5;
|
||||
rect3.y1 = rect1.y1 + 5;
|
||||
rect3.x2 = rect1.x2 - 5;
|
||||
rect3.y2 = rect1.y2 - 5;
|
||||
rtgui_widget_set_rect(RTGUI_WIDGET(label), &rect3);
|
||||
rtgui_container_add_child(container, RTGUI_WIDGET(label));
|
||||
rect3.x1 = rect1.x1 + 5;
|
||||
rect3.y1 = rect1.y1 + 5;
|
||||
rect3.x2 = rect1.x2 - 5;
|
||||
rect3.y2 = rect1.y2 - 5;
|
||||
rtgui_widget_set_rect(RTGUI_WIDGET(label), &rect3);
|
||||
rtgui_container_add_child(container, RTGUI_WIDGET(label));
|
||||
|
||||
|
||||
/* create main window */
|
||||
win_main = rtgui_win_create(RT_NULL, "main",
|
||||
win_main = rtgui_win_create(RT_NULL, "main",
|
||||
&rect2,
|
||||
RTGUI_WIN_STYLE_NO_BORDER | RTGUI_WIN_STYLE_NO_TITLE);
|
||||
if (win_main == RT_NULL)
|
||||
{
|
||||
if (win_main == RT_NULL)
|
||||
{
|
||||
rt_kprintf("Create window \"main\" failed!\n");
|
||||
rtgui_app_destroy(app);
|
||||
rtgui_app_destroy(app);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* create container in main window */
|
||||
container = rtgui_container_create();
|
||||
if (container == RT_NULL)
|
||||
{
|
||||
container = rtgui_container_create();
|
||||
if (container == RT_NULL)
|
||||
{
|
||||
rt_kprintf("Create container failed!\n");
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
rtgui_widget_set_rect(RTGUI_WIDGET(container), &rect2);
|
||||
rtgui_widget_set_rect(RTGUI_WIDGET(container), &rect2);
|
||||
rtgui_object_set_event_handler(RTGUI_OBJECT(container), pic_view_event_handler);
|
||||
rtgui_container_add_child(RTGUI_CONTAINER(win_main), RTGUI_WIDGET(container));
|
||||
|
||||
/* create lable in main window */
|
||||
label = rtgui_label_create("EFM32GG_DK3750 Kit");
|
||||
label = rtgui_label_create("EFM32GG_DK3750 Kit");
|
||||
if (label == RT_NULL)
|
||||
{
|
||||
rt_kprintf("Create lable failed!\n");
|
||||
return;
|
||||
}
|
||||
RTGUI_WIDGET_TEXTALIGN(RTGUI_WIDGET(label)) = RTGUI_ALIGN_LEFT;
|
||||
RTGUI_WIDGET_BACKGROUND(RTGUI_WIDGET(label)) = white;
|
||||
RTGUI_WIDGET_TEXTALIGN(RTGUI_WIDGET(label)) = RTGUI_ALIGN_LEFT;
|
||||
RTGUI_WIDGET_BACKGROUND(RTGUI_WIDGET(label)) = white;
|
||||
RTGUI_WIDGET_FOREGROUND(RTGUI_WIDGET(label)) = blue;
|
||||
|
||||
rect3.x1 = rect2.x1 + 5;
|
||||
rect3.y1 = rect2.y1 + 5;
|
||||
rect3.x2 = rect2.x2 - 5;
|
||||
rect3.y2 = rect2.y1 + 20;
|
||||
rtgui_widget_set_rect(RTGUI_WIDGET(label), &rect3);
|
||||
rtgui_container_add_child(container, RTGUI_WIDGET(label));
|
||||
rect3.x1 = rect2.x1 + 5;
|
||||
rect3.y1 = rect2.y1 + 5;
|
||||
rect3.x2 = rect2.x2 - 5;
|
||||
rect3.y2 = rect2.y1 + 20;
|
||||
rtgui_widget_set_rect(RTGUI_WIDGET(label), &rect3);
|
||||
rtgui_container_add_child(container, RTGUI_WIDGET(label));
|
||||
|
||||
|
||||
/* create hello window */
|
||||
rect3.x1 = 80;
|
||||
rect3.y1 = 50;
|
||||
rect3.x2 = 320 - 80;
|
||||
rect3.y2 = 240 - 50;
|
||||
win_hello = rtgui_win_create(RT_NULL, "hello",
|
||||
rect3.x1 = 80;
|
||||
rect3.y1 = 50;
|
||||
rect3.x2 = 320 - 80;
|
||||
rect3.y2 = 240 - 50;
|
||||
win_hello = rtgui_win_create(RT_NULL, "hello",
|
||||
&rect3,
|
||||
RTGUI_WIN_STYLE_DEFAULT);
|
||||
if (win_hello == RT_NULL)
|
||||
{
|
||||
if (win_hello == RT_NULL)
|
||||
{
|
||||
rt_kprintf("Create window \"hello\" failed!\n");
|
||||
rtgui_app_destroy(app);
|
||||
rtgui_app_destroy(app);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* create a box */
|
||||
rtgui_box_t *box = rtgui_box_create(RTGUI_VERTICAL, RT_NULL);
|
||||
if(box == RT_NULL)
|
||||
if(box == RT_NULL)
|
||||
{
|
||||
rt_kprintf("Create box failed!\n");
|
||||
return;
|
||||
}
|
||||
// rtgui_win_set_box(win_hello, box);
|
||||
|
||||
label = rtgui_label_create("¹þÂÞ,íïÅÖ!");
|
||||
if(label == RT_NULL)
|
||||
label = rtgui_label_create("哈罗,盹胖!");
|
||||
if(label == RT_NULL)
|
||||
{
|
||||
rt_kprintf("Create lable failed!\n");
|
||||
return;
|
||||
}
|
||||
RTGUI_WIDGET_BACKGROUND(RTGUI_WIDGET(label)) = white;
|
||||
RTGUI_WIDGET_BACKGROUND(RTGUI_WIDGET(label)) = white;
|
||||
RTGUI_WIDGET_FOREGROUND(RTGUI_WIDGET(label)) = black;
|
||||
RTGUI_WIDGET(label)->align = RTGUI_ALIGN_CENTER_HORIZONTAL | RTGUI_ALIGN_CENTER_VERTICAL;
|
||||
rtgui_widget_set_miniwidth(RTGUI_WIDGET(label),130);
|
||||
@@ -322,18 +330,18 @@ static void app_main(void *parameter)
|
||||
|
||||
static rt_bool_t photo_view_event_handler(rtgui_object_t *object, rtgui_event_t *event)
|
||||
{
|
||||
rt_bool_t result = RT_FALSE;
|
||||
rt_bool_t result = RT_FALSE;
|
||||
struct photo_event *photo_event = (struct photo_event *)event;
|
||||
|
||||
result = rtgui_container_event_handler(object, event);
|
||||
result = rtgui_container_event_handler(object, event);
|
||||
rt_kprintf("container event %x\n", event->type);
|
||||
|
||||
struct rtgui_event_win* wevent = (struct rtgui_event_win*)event;
|
||||
struct rtgui_event_win* wevent = (struct rtgui_event_win*)event;
|
||||
rt_kprintf("wevent->wid %x\n", wevent->wid);
|
||||
|
||||
if ((event->type == RTGUI_EVENT_COMMAND) && \
|
||||
(photo_event->cmd == APP_CMD_PHOTO_FRAME))
|
||||
{
|
||||
{
|
||||
rtgui_rect_t rect;
|
||||
rtgui_image_t* image;
|
||||
struct rtgui_dc* dc;
|
||||
@@ -361,25 +369,25 @@ static rt_bool_t photo_view_event_handler(rtgui_object_t *object, rtgui_event_t
|
||||
return RT_TRUE;
|
||||
}
|
||||
|
||||
return result;
|
||||
return result;
|
||||
}
|
||||
|
||||
static rt_bool_t photo_lable_event_handler(rtgui_object_t *object, rtgui_event_t *event)
|
||||
{
|
||||
rt_bool_t result = RT_FALSE;
|
||||
rt_bool_t result = RT_FALSE;
|
||||
|
||||
result = rtgui_label_event_handler(object, event);
|
||||
result = rtgui_label_event_handler(object, event);
|
||||
rt_kprintf("lable event %x\n", event->type);
|
||||
|
||||
if (event->type == RTGUI_EVENT_COMMAND)
|
||||
{
|
||||
{
|
||||
struct photo_event *photo = (struct photo_event *)event;
|
||||
|
||||
rtgui_label_set_text((rtgui_label_t *)object, photo->path);
|
||||
rt_kprintf("path %s\n", photo->path);
|
||||
}
|
||||
|
||||
return result;
|
||||
return result;
|
||||
}
|
||||
|
||||
static void app_photo(void *parameter)
|
||||
@@ -399,64 +407,64 @@ static void app_photo(void *parameter)
|
||||
lcd->control(lcd, RTGRAPHIC_CTRL_GET_INFO, (void *)&lcd_info);
|
||||
rt_kprintf("LCD size: %dX%d\n", lcd_info.width, lcd_info.height);
|
||||
|
||||
/* create application */
|
||||
struct rtgui_app *app;
|
||||
app = rtgui_app_create("pho_app");
|
||||
if (app == RT_NULL)
|
||||
/* create application */
|
||||
struct rtgui_app *app;
|
||||
app = rtgui_app_create("pho_app");
|
||||
if (app == RT_NULL)
|
||||
{
|
||||
rt_kprintf("Create application \"pho_app\" failed!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
struct rtgui_rect rect1, rect2;
|
||||
struct rtgui_rect rect1, rect2;
|
||||
struct rtgui_win *window;
|
||||
struct rtgui_container *container;
|
||||
struct rtgui_container *container;
|
||||
struct rtgui_label* label;
|
||||
|
||||
rtgui_graphic_driver_get_rect(rtgui_graphic_driver_get_default(), &rect1);
|
||||
rtgui_graphic_driver_get_rect(rtgui_graphic_driver_get_default(), &rect1);
|
||||
|
||||
/* create window */
|
||||
window = rtgui_win_create(RT_NULL, "photo",
|
||||
window = rtgui_win_create(RT_NULL, "photo",
|
||||
&rect1,
|
||||
RTGUI_WIN_STYLE_NO_BORDER | RTGUI_WIN_STYLE_NO_TITLE);
|
||||
if (window == RT_NULL)
|
||||
{
|
||||
if (window == RT_NULL)
|
||||
{
|
||||
rt_kprintf("Create window \"photo\" failed!\n");
|
||||
rtgui_app_destroy(app);
|
||||
rtgui_app_destroy(app);
|
||||
return;
|
||||
}
|
||||
}
|
||||
event->win.wid = window;
|
||||
|
||||
/* create container */
|
||||
container = rtgui_container_create();
|
||||
if (container == RT_NULL)
|
||||
{
|
||||
container = rtgui_container_create();
|
||||
if (container == RT_NULL)
|
||||
{
|
||||
rt_kprintf("Create container failed!\n");
|
||||
return;
|
||||
}
|
||||
rtgui_widget_set_rect(RTGUI_WIDGET(container), &rect1);
|
||||
return;
|
||||
}
|
||||
rtgui_widget_set_rect(RTGUI_WIDGET(container), &rect1);
|
||||
rtgui_object_set_event_handler(RTGUI_OBJECT(container), photo_view_event_handler);
|
||||
rtgui_container_add_child(RTGUI_CONTAINER(window), RTGUI_WIDGET(container));
|
||||
|
||||
/* create lable in info window */
|
||||
label = rtgui_label_create("Photo Frame Demo");
|
||||
label = rtgui_label_create("Photo Frame Demo");
|
||||
if (label == RT_NULL)
|
||||
{
|
||||
rt_kprintf("Create lable failed!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
RTGUI_WIDGET_TEXTALIGN(RTGUI_WIDGET(label)) = RTGUI_ALIGN_LEFT;
|
||||
RTGUI_WIDGET_BACKGROUND(RTGUI_WIDGET(label)) = white;
|
||||
RTGUI_WIDGET_TEXTALIGN(RTGUI_WIDGET(label)) = RTGUI_ALIGN_LEFT;
|
||||
RTGUI_WIDGET_BACKGROUND(RTGUI_WIDGET(label)) = white;
|
||||
RTGUI_WIDGET_FOREGROUND(RTGUI_WIDGET(label)) = blue;
|
||||
|
||||
rect2.x1 = rect1.x1;
|
||||
rect2.y1 = rect1.y1;
|
||||
rect2.x2 = rect1.x2;
|
||||
rect2.y2 = 15;
|
||||
rtgui_widget_set_rect(RTGUI_WIDGET(label), &rect2);
|
||||
rtgui_widget_set_rect(RTGUI_WIDGET(label), &rect2);
|
||||
rtgui_object_set_event_handler(RTGUI_OBJECT(label), photo_lable_event_handler);
|
||||
rtgui_container_add_child(container, RTGUI_WIDGET(label));
|
||||
rtgui_container_add_child(container, RTGUI_WIDGET(label));
|
||||
|
||||
rtgui_win_show(window, RT_FALSE);
|
||||
|
||||
|
||||
@@ -14,7 +14,11 @@
|
||||
|
||||
#include <dfs_elm.h>
|
||||
#include <dfs_fs.h>
|
||||
#include <dfs_posix.h>
|
||||
#include <dfs_file.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/statfs.h>
|
||||
#include "drv_sdctrl.h"
|
||||
|
||||
#define DBG_TAG "app.card"
|
||||
|
||||
@@ -6,13 +6,18 @@ GD32 系列 BSP 目前支持情况如下表所示:
|
||||
| **BSP 文件夹名称** | **开发板名称** |
|
||||
|:------------------------- |:-------------------------- |
|
||||
| **F1 系列** | |
|
||||
| [gd32105r-start](gd32105r-start) | 兆易创新 官方 GD32105r-START 开发板 |
|
||||
| [gd32103c-eval](gd32103c-eval) | 兆易创新 官方 GD32103C-EVAL 开发板 |
|
||||
| [gd32105c-eval](gd32105c-eval) | 兆易创新 官方 GD32105C-EVAL 开发板 |
|
||||
| [gd32105r-start](gd32105r-start) | 兆易创新 官方 GD32105R-START 开发板 |
|
||||
| [gd32107c-eval](gd32107c-eval) | 兆易创新 官方 GD32107C-EVAL 开发板 |
|
||||
| **F2 系列** | |
|
||||
| [gd32205r-start](gd32205r-start) | 兆易创新 官方 GD32205r-START 开发板 |
|
||||
| [gd32205r-start](gd32205r-start) | 兆易创新 官方 GD32205R-START 开发板 |
|
||||
| **F3 系列** | |
|
||||
| [gd32305r-start](gd32305r-start) | 兆易创新 官方 GD32305r-START 开发板 |
|
||||
| [gd32303e-eval](gd32303e-eval) | 兆易创新 官方 GD32303E-EVAL 开发板 |
|
||||
| [gd32305r-start](gd32305r-start) | 兆易创新 官方 GD32305R-START 开发板 |
|
||||
| **F4 系列** | |
|
||||
| [gd32407v-start](gd32407v-start) | 兆易创新 官方 GD32407V-START 开发板 |
|
||||
| [gd32450z-eval](gd32450z-eval) | 兆易创新 官方 GD32450Z-EVAL 开发板 |
|
||||
|
||||
可以通过阅读相应 BSP 下的 README 来快速上手,如果想要使用 BSP 更多功能可参考 docs 文件夹下提供的说明文档,如下表所示:
|
||||
|
||||
|
||||
@@ -145,14 +145,14 @@ TARGET = 'rtthread.' + rtconfig.TARGET_EXT
|
||||
DefaultEnvironment(tools=[])
|
||||
env = Environment(tools = ['mingw'],
|
||||
AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
|
||||
CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS,
|
||||
CC = rtconfig.CC, CFLAGS = rtconfig.CFLAGS,
|
||||
AR = rtconfig.AR, ARFLAGS = '-rc',
|
||||
CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS,
|
||||
LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS)
|
||||
env.PrependENVPath('PATH', rtconfig.EXEC_PATH)
|
||||
|
||||
if rtconfig.PLATFORM == 'iar':
|
||||
env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES'])
|
||||
env.Replace(CCCOM = ['$CC $CFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES'])
|
||||
env.Replace(ARFLAGS = [''])
|
||||
env.Replace(LINKCOM = env["LINKCOM"] + ' --map rtthread.map')
|
||||
|
||||
|
||||
636
bsp/gd32/gd32103c-eval/.config
Normal file
636
bsp/gd32/gd32103c-eval/.config
Normal file
File diff suppressed because it is too large
Load Diff
21
bsp/gd32/gd32103c-eval/Kconfig
Normal file
21
bsp/gd32/gd32103c-eval/Kconfig
Normal file
@@ -0,0 +1,21 @@
|
||||
mainmenu "RT-Thread Configuration"
|
||||
|
||||
config BSP_DIR
|
||||
string
|
||||
option env="BSP_ROOT"
|
||||
default "."
|
||||
|
||||
config RTT_DIR
|
||||
string
|
||||
option env="RTT_ROOT"
|
||||
default "../../.."
|
||||
|
||||
config PKGS_DIR
|
||||
string
|
||||
option env="PKGS_ROOT"
|
||||
default "packages"
|
||||
|
||||
source "$RTT_DIR/Kconfig"
|
||||
source "$PKGS_DIR/Kconfig"
|
||||
source "../libraries/Kconfig"
|
||||
source "board/Kconfig"
|
||||
94
bsp/gd32/gd32103c-eval/README.md
Normal file
94
bsp/gd32/gd32103c-eval/README.md
Normal file
@@ -0,0 +1,94 @@
|
||||
# GD32103C-EVAL开发板BSP说明
|
||||
|
||||
## 简介
|
||||
|
||||
GD3103C-EVAL是-兆易创新推出的一款GD32F10X系列的评估板,最高主频高达108M,该开发板具有丰富的板载资源,可以充分发挥 GD32103VCT6的芯片性能。
|
||||
|
||||
该开发板常用 **板载资源** 如下:
|
||||
|
||||
- GD32103VCT6,主频 108MHz,256KB FLASH ,48KB RAM
|
||||
|
||||
- 常用外设
|
||||
|
||||
- LED :5个,LED1 (电源指示灯),LED2(PC0),LED3(PC2),LED4(PE0),LED5(PE1)
|
||||
- 按键:3个,K1(用户按键,PA0),K2(用户按键,PC13),K3(用户按键,PB14)
|
||||
|
||||
- 常用接口:USB 接口
|
||||
|
||||
- 调试接口:GD-LINK
|
||||
|
||||
## 外设支持
|
||||
|
||||
本 BSP 目前对外设的支持情况如下:
|
||||
|
||||
| **片上外设** | **支持情况** | **备注** |
|
||||
|:--------- |:--------:|:------------------------------------- |
|
||||
| GPIO | 支持 | PA0, PA1... PK15 ---> PIN: 0, 1...144 |
|
||||
| UART | 支持 | UART0 - UART7 |
|
||||
| I2C | 支持 | I2C1 |
|
||||
| SPI | 支持 | SPI0 - SPI2 |
|
||||
| SPI FLASH | 支持 | |
|
||||
| **扩展模块** | **支持情况** | **备注** |
|
||||
| 暂无 | 暂不支持 | 暂不支持 |
|
||||
|
||||
## 使用说明
|
||||
|
||||
使用说明分为如下两个章节:
|
||||
|
||||
- 快速上手
|
||||
|
||||
本章节是为刚接触 RT-Thread 的新手准备的使用说明,遵循简单的步骤即可将 RT-Thread 操作系统运行在该开发板上,看到实验效果 。
|
||||
|
||||
- 进阶使用
|
||||
|
||||
本章节是为需要在 RT-Thread 操作系统上使用更多开发板资源的开发者准备的。通过使用 ENV 工具对 BSP 进行配置,可以开启更多板载资源,实现更多高级功能。
|
||||
|
||||
### 快速上手
|
||||
|
||||
本 BSP 为开发者提供 MDK5 工程,并且支持 GCC 开发环境,也可使用RT-Thread Studio开发。下面以 MDK5 开发环境为例,介绍如何将系统运行起来。
|
||||
|
||||
#### 硬件连接
|
||||
|
||||
使用数据线连接开发板到 PC,使用USB转TTL模块连接PA2(MCU TX)和PA3(MCU RX),打开电源开关。
|
||||
|
||||
#### 编译下载
|
||||
|
||||
双击 project.uvprojx 文件,打开 MDK5 工程,编译并下载程序到开发板。
|
||||
|
||||
> 工程默认配置使用 GD-Link 仿真器下载程序,在通过 GD-Link 连接开发板的基础上,点击下载按钮即可下载程序到开发板
|
||||
|
||||
#### 运行结果
|
||||
|
||||
下载程序成功之后,系统会自动运行,LED 闪烁。
|
||||
|
||||
连接开发板对应串口到 PC , 在终端工具里打开相应的串口(115200-8-1-N),复位设备后,可以看到 RT-Thread 的输出信息:
|
||||
|
||||
```bash
|
||||
\ | /
|
||||
- RT - Thread Operating System
|
||||
/ | \ 4.0.4 build Dec 19 2021 10:00:27
|
||||
2006 - 2021 Copyright by rt-thread team
|
||||
msh >
|
||||
```
|
||||
|
||||
### 进阶使用
|
||||
|
||||
此 BSP 默认只开启了 GPIO 和 串口1的功能,如果需使用高级功能,需要利用 ENV 工具对BSP 进行配置,步骤如下:
|
||||
|
||||
1. 在 bsp 下打开 env 工具。
|
||||
|
||||
2. 输入`menuconfig`命令配置工程,配置好之后保存退出。
|
||||
|
||||
3. 输入`pkgs --update`命令更新软件包。
|
||||
|
||||
4. 输入`scons --target=mdk4/mdk5` 命令重新生成工程。
|
||||
|
||||
## 注意事项
|
||||
|
||||
暂无
|
||||
|
||||
## 联系人信息
|
||||
|
||||
维护人:
|
||||
|
||||
- [BruceOu](https://github.com/Ouxiaolong/), 邮箱:<ouxiaolong@bruceou.cn>
|
||||
@@ -1,6 +1,6 @@
|
||||
# RT-Thread building script for bridge
|
||||
|
||||
# for module compiling
|
||||
import os
|
||||
Import('RTT_ROOT')
|
||||
from building import *
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
60
bsp/gd32/gd32103c-eval/SConstruct
Normal file
60
bsp/gd32/gd32103c-eval/SConstruct
Normal file
@@ -0,0 +1,60 @@
|
||||
import os
|
||||
import sys
|
||||
import rtconfig
|
||||
|
||||
if os.getenv('RTT_ROOT'):
|
||||
RTT_ROOT = os.getenv('RTT_ROOT')
|
||||
else:
|
||||
RTT_ROOT = os.path.normpath(os.getcwd() + '/../../..')
|
||||
|
||||
sys.path = sys.path + [os.path.join(RTT_ROOT, 'tools')]
|
||||
try:
|
||||
from building import *
|
||||
except:
|
||||
print('Cannot found RT-Thread root directory, please check RTT_ROOT')
|
||||
print(RTT_ROOT)
|
||||
exit(-1)
|
||||
|
||||
TARGET = 'rtthread.' + rtconfig.TARGET_EXT
|
||||
|
||||
DefaultEnvironment(tools=[])
|
||||
env = Environment(tools = ['mingw'],
|
||||
AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
|
||||
CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS,
|
||||
AR = rtconfig.AR, ARFLAGS = '-rc',
|
||||
CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS,
|
||||
LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS)
|
||||
env.PrependENVPath('PATH', rtconfig.EXEC_PATH)
|
||||
|
||||
if rtconfig.PLATFORM == 'iar':
|
||||
env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES'])
|
||||
env.Replace(ARFLAGS = [''])
|
||||
env.Replace(LINKCOM = env["LINKCOM"] + ' --map rtthread.map')
|
||||
|
||||
Export('RTT_ROOT')
|
||||
Export('rtconfig')
|
||||
|
||||
SDK_ROOT = os.path.abspath('./')
|
||||
|
||||
if os.path.exists(SDK_ROOT + '/libraries'):
|
||||
libraries_path_prefix = SDK_ROOT + '/libraries'
|
||||
else:
|
||||
libraries_path_prefix = os.path.dirname(SDK_ROOT) + '/libraries'
|
||||
|
||||
SDK_LIB = libraries_path_prefix
|
||||
Export('SDK_LIB')
|
||||
|
||||
# prepare building environment
|
||||
objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False)
|
||||
|
||||
gd32_library = 'GD32F10x_Firmware_Library'
|
||||
rtconfig.BSP_LIBRARY_TYPE = gd32_library
|
||||
|
||||
# include libraries
|
||||
objs.extend(SConscript(os.path.join(libraries_path_prefix, gd32_library, 'SConscript')))
|
||||
|
||||
# include drivers
|
||||
objs.extend(SConscript(os.path.join(libraries_path_prefix, 'gd32_drivers', 'SConscript')))
|
||||
|
||||
# make a building
|
||||
DoBuilding(TARGET, objs)
|
||||
11
bsp/gd32/gd32103c-eval/applications/SConscript
Normal file
11
bsp/gd32/gd32103c-eval/applications/SConscript
Normal file
@@ -0,0 +1,11 @@
|
||||
Import('RTT_ROOT')
|
||||
Import('rtconfig')
|
||||
from building import *
|
||||
|
||||
cwd = os.path.join(str(Dir('#')), 'applications')
|
||||
src = Glob('*.c')
|
||||
CPPPATH = [cwd, str(Dir('#'))]
|
||||
|
||||
group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH)
|
||||
|
||||
Return('group')
|
||||
35
bsp/gd32/gd32103c-eval/applications/main.c
Normal file
35
bsp/gd32/gd32103c-eval/applications/main.c
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2021-12-18 BruceOu first implementation
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <rtthread.h>
|
||||
#include <rtdevice.h>
|
||||
#include <board.h>
|
||||
|
||||
/* defined the LED2 pin: PC0 */
|
||||
#define LED2_PIN GET_PIN(C, 0)
|
||||
|
||||
int main(void)
|
||||
{
|
||||
int count = 1;
|
||||
|
||||
/* set LED2 pin mode to output */
|
||||
rt_pin_mode(LED2_PIN, PIN_MODE_OUTPUT);
|
||||
|
||||
while (count++)
|
||||
{
|
||||
rt_pin_write(LED2_PIN, PIN_HIGH);
|
||||
rt_thread_mdelay(500);
|
||||
rt_pin_write(LED2_PIN, PIN_LOW);
|
||||
rt_thread_mdelay(500);
|
||||
}
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
85
bsp/gd32/gd32103c-eval/board/Kconfig
Normal file
85
bsp/gd32/gd32103c-eval/board/Kconfig
Normal file
@@ -0,0 +1,85 @@
|
||||
menu "Hardware Drivers Config"
|
||||
|
||||
config SOC_SERIES_GD32F10x
|
||||
bool
|
||||
default y
|
||||
|
||||
config SOC_GD32103V
|
||||
bool
|
||||
select SOC_SERIES_GD32F10x
|
||||
select RT_USING_COMPONENTS_INIT
|
||||
select RT_USING_USER_MAIN
|
||||
default y
|
||||
|
||||
menu "Onboard Peripheral Drivers"
|
||||
|
||||
endmenu
|
||||
|
||||
menu "On-chip Peripheral Drivers"
|
||||
|
||||
config BSP_USING_GPIO
|
||||
bool "Enable GPIO"
|
||||
select RT_USING_PIN
|
||||
default y
|
||||
|
||||
menuconfig BSP_USING_UART
|
||||
bool "Enable UART"
|
||||
default y
|
||||
select RT_USING_SERIAL
|
||||
if BSP_USING_UART
|
||||
config BSP_USING_UART1
|
||||
bool "Enable UART1"
|
||||
default y
|
||||
|
||||
config BSP_UART1_RX_USING_DMA
|
||||
bool "Enable UART1 RX DMA"
|
||||
depends on BSP_USING_UART1 && RT_SERIAL_USING_DMA
|
||||
default n
|
||||
endif
|
||||
|
||||
menuconfig BSP_USING_SPI
|
||||
bool "Enable SPI BUS"
|
||||
default n
|
||||
select RT_USING_SPI
|
||||
if BSP_USING_SPI
|
||||
config BSP_USING_SPI1
|
||||
bool "Enable SPI1 BUS"
|
||||
default n
|
||||
|
||||
config BSP_SPI1_TX_USING_DMA
|
||||
bool "Enable SPI1 TX DMA"
|
||||
depends on BSP_USING_SPI1
|
||||
default n
|
||||
|
||||
config BSP_SPI1_RX_USING_DMA
|
||||
bool "Enable SPI1 RX DMA"
|
||||
depends on BSP_USING_SPI1
|
||||
select BSP_SPI1_TX_USING_DMA
|
||||
default n
|
||||
endif
|
||||
|
||||
menuconfig BSP_USING_I2C1
|
||||
bool "Enable I2C1 BUS (software simulation)"
|
||||
default n
|
||||
select RT_USING_I2C
|
||||
select RT_USING_I2C_BITOPS
|
||||
select RT_USING_PIN
|
||||
if BSP_USING_I2C1
|
||||
config BSP_I2C1_SCL_PIN
|
||||
int "i2c1 scl pin number"
|
||||
range 1 216
|
||||
default 24
|
||||
config BSP_I2C1_SDA_PIN
|
||||
int "I2C1 sda pin number"
|
||||
range 1 216
|
||||
default 25
|
||||
endif
|
||||
source "../libraries/gd32_drivers/Kconfig"
|
||||
|
||||
endmenu
|
||||
|
||||
menu "Board extended module Drivers"
|
||||
|
||||
endmenu
|
||||
|
||||
endmenu
|
||||
28
bsp/gd32/gd32103c-eval/board/SConscript
Normal file
28
bsp/gd32/gd32103c-eval/board/SConscript
Normal file
@@ -0,0 +1,28 @@
|
||||
import os
|
||||
import rtconfig
|
||||
from building import *
|
||||
|
||||
Import('SDK_LIB')
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
|
||||
# add general drivers
|
||||
src = Split('''
|
||||
board.c
|
||||
''')
|
||||
|
||||
path = [cwd]
|
||||
|
||||
startup_path_prefix = SDK_LIB
|
||||
|
||||
if rtconfig.CROSS_TOOL == 'gcc':
|
||||
src += [startup_path_prefix + '/GD32F10x_Firmware_Library/CMSIS/GD/GD32F10x/Source/GCC/startup_gd32f10x_hd.s']
|
||||
elif rtconfig.CROSS_TOOL == 'keil':
|
||||
src += [startup_path_prefix + '/GD32F10x_Firmware_Library/CMSIS/GD/GD32F10x/Source/ARM/startup_gd32f10x_hd.s']
|
||||
elif rtconfig.CROSS_TOOL == 'iar':
|
||||
src += [startup_path_prefix + '/GD32F10x_Firmware_Library/CMSIS/GD/GD32F10x/Source/IAR/startup_gd32f10x_hd.s']
|
||||
|
||||
CPPDEFINES = ['GD32F10X_HD']
|
||||
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
|
||||
|
||||
Return('group')
|
||||
85
bsp/gd32/gd32103c-eval/board/board.c
Normal file
85
bsp/gd32/gd32103c-eval/board/board.c
Normal file
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2021-12-18 BruceOu first implementation
|
||||
*/
|
||||
#include <stdint.h>
|
||||
#include <rthw.h>
|
||||
#include <rtthread.h>
|
||||
#include <board.h>
|
||||
|
||||
/**
|
||||
* @brief This function is executed in case of error occurrence.
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void Error_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN Error_Handler */
|
||||
/* User can add his own implementation to report the HAL error return state */
|
||||
while (1)
|
||||
{
|
||||
}
|
||||
/* USER CODE END Error_Handler */
|
||||
}
|
||||
|
||||
/** System Clock Configuration
|
||||
*/
|
||||
void SystemClock_Config(void)
|
||||
{
|
||||
SysTick_Config(SystemCoreClock / RT_TICK_PER_SECOND);
|
||||
NVIC_SetPriority(SysTick_IRQn, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* This is the timer interrupt service routine.
|
||||
*
|
||||
*/
|
||||
void SysTick_Handler(void)
|
||||
{
|
||||
/* enter interrupt */
|
||||
rt_interrupt_enter();
|
||||
|
||||
rt_tick_increase();
|
||||
|
||||
/* leave interrupt */
|
||||
rt_interrupt_leave();
|
||||
}
|
||||
|
||||
/**
|
||||
* This function will initial GD32 board.
|
||||
*/
|
||||
void rt_hw_board_init()
|
||||
{
|
||||
/* NVIC Configuration */
|
||||
#define NVIC_VTOR_MASK 0x3FFFFF80
|
||||
#ifdef VECT_TAB_RAM
|
||||
/* Set the Vector Table base location at 0x10000000 */
|
||||
SCB->VTOR = (0x10000000 & NVIC_VTOR_MASK);
|
||||
#else /* VECT_TAB_FLASH */
|
||||
/* Set the Vector Table base location at 0x08000000 */
|
||||
SCB->VTOR = (0x08000000 & NVIC_VTOR_MASK);
|
||||
#endif
|
||||
|
||||
SystemClock_Config();
|
||||
|
||||
#ifdef RT_USING_COMPONENTS_INIT
|
||||
rt_components_board_init();
|
||||
#endif
|
||||
|
||||
#ifdef RT_USING_CONSOLE
|
||||
rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
|
||||
#endif
|
||||
|
||||
#ifdef BSP_USING_SDRAM
|
||||
rt_system_heap_init((void *)EXT_SDRAM_BEGIN, (void *)EXT_SDRAM_END);
|
||||
#else
|
||||
rt_system_heap_init((void *)HEAP_BEGIN, (void *)HEAP_END);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*@}*/
|
||||
47
bsp/gd32/gd32103c-eval/board/board.h
Normal file
47
bsp/gd32/gd32103c-eval/board/board.h
Normal file
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2021-12-18 BruceOu first implementation
|
||||
*/
|
||||
#ifndef __BOARD_H__
|
||||
#define __BOARD_H__
|
||||
|
||||
#include "gd32f10x.h"
|
||||
#include "drv_usart.h"
|
||||
#include "drv_gpio.h"
|
||||
|
||||
#include "gd32f10x_exti.h"
|
||||
|
||||
#define EXT_SDRAM_BEGIN (0xC0000000U) /* the begining address of external SDRAM */
|
||||
#define EXT_SDRAM_END (EXT_SDRAM_BEGIN + (32U * 1024 * 1024)) /* the end address of external SDRAM */
|
||||
|
||||
// <o> Internal SRAM memory size[Kbytes] <8-48>
|
||||
// <i>Default: 48
|
||||
#ifdef __ICCARM__
|
||||
// Use *.icf ram symbal, to avoid hardcode.
|
||||
extern char __ICFEDIT_region_RAM_end__;
|
||||
#define GD32_SRAM_END &__ICFEDIT_region_RAM_end__
|
||||
#else
|
||||
#define GD32_SRAM_SIZE 48
|
||||
#define GD32_SRAM_END (0x20000000 + GD32_SRAM_SIZE * 1024)
|
||||
#endif
|
||||
|
||||
#ifdef __CC_ARM
|
||||
extern int Image$$RW_IRAM1$$ZI$$Limit;
|
||||
#define HEAP_BEGIN (&Image$$RW_IRAM1$$ZI$$Limit)
|
||||
#elif __ICCARM__
|
||||
#pragma section="HEAP"
|
||||
#define HEAP_BEGIN (__segment_end("HEAP"))
|
||||
#else
|
||||
extern int __bss_end;
|
||||
#define HEAP_BEGIN (&__bss_end)
|
||||
#endif
|
||||
|
||||
#define HEAP_END GD32_SRAM_END
|
||||
|
||||
#endif
|
||||
|
||||
64
bsp/gd32/gd32103c-eval/board/gd32f10x_libopt.h
Normal file
64
bsp/gd32/gd32103c-eval/board/gd32f10x_libopt.h
Normal file
@@ -0,0 +1,64 @@
|
||||
/*!
|
||||
\file gd32f10x_libopt.h
|
||||
\brief library optional for gd32f10x
|
||||
|
||||
\version 2014-12-26, V1.0.0, demo for GD32F10x
|
||||
\version 2017-06-30, V2.0.0, demo for GD32F10x
|
||||
\version 2021-04-30, V2.1.0, demo for GD32F10x
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (c) 2021, 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 GD32F10X_LIBOPT_H
|
||||
#define GD32F10X_LIBOPT_H
|
||||
|
||||
#include "gd32f10x_fmc.h"
|
||||
#include "gd32f10x_pmu.h"
|
||||
#include "gd32f10x_bkp.h"
|
||||
#include "gd32f10x_rcu.h"
|
||||
#include "gd32f10x_exti.h"
|
||||
#include "gd32f10x_gpio.h"
|
||||
#include "gd32f10x_crc.h"
|
||||
#include "gd32f10x_dma.h"
|
||||
#include "gd32f10x_dbg.h"
|
||||
#include "gd32f10x_adc.h"
|
||||
#include "gd32f10x_dac.h"
|
||||
#include "gd32f10x_fwdgt.h"
|
||||
#include "gd32f10x_wwdgt.h"
|
||||
#include "gd32f10x_rtc.h"
|
||||
#include "gd32f10x_timer.h"
|
||||
#include "gd32f10x_usart.h"
|
||||
#include "gd32f10x_i2c.h"
|
||||
#include "gd32f10x_spi.h"
|
||||
#include "gd32f10x_sdio.h"
|
||||
#include "gd32f10x_exmc.h"
|
||||
#include "gd32f10x_can.h"
|
||||
#include "gd32f10x_enet.h"
|
||||
#include "gd32f10x_misc.h"
|
||||
|
||||
#endif /* GD32F10X_LIBOPT_H */
|
||||
40
bsp/gd32/gd32103c-eval/board/linker_scripts/link.icf
Normal file
40
bsp/gd32/gd32103c-eval/board/linker_scripts/link.icf
Normal file
@@ -0,0 +1,40 @@
|
||||
/*###ICF### Section handled by ICF editor, don't touch! ****/
|
||||
/*-Editor annotation file-*/
|
||||
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
|
||||
/*-Specials-*/
|
||||
define symbol __ICFEDIT_intvec_start__ = 0x08000000;
|
||||
/*-Memory Regions-*/
|
||||
define symbol __ICFEDIT_region_ROM_start__ = 0x08000000;
|
||||
define symbol __ICFEDIT_region_ROM_end__ = 0x0803FFFF;
|
||||
define symbol __ICFEDIT_region_RAM_start__ = 0x20000000;
|
||||
define symbol __ICFEDIT_region_RAM_end__ = 0x2000BFFF;
|
||||
/*-Sizes-*/
|
||||
define symbol __ICFEDIT_size_cstack__ = 0x200;
|
||||
define symbol __ICFEDIT_size_heap__ = 0x200;
|
||||
/**** End of ICF editor section. ###ICF###*/
|
||||
|
||||
export symbol __ICFEDIT_region_RAM_end__;
|
||||
|
||||
define symbol __region_RAM1_start__ = 0x10000000;
|
||||
define symbol __region_RAM1_end__ = 0x1000FFFF;
|
||||
|
||||
define memory mem with size = 4G;
|
||||
define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
|
||||
define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
|
||||
define region RAM1_region = mem:[from __region_RAM1_start__ to __region_RAM1_end__];
|
||||
|
||||
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
|
||||
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
|
||||
|
||||
initialize by copy { readwrite };
|
||||
do not initialize { section .noinit };
|
||||
|
||||
keep { section FSymTab };
|
||||
keep { section VSymTab };
|
||||
keep { section .rti_fn* };
|
||||
place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
|
||||
|
||||
place in ROM_region { readonly };
|
||||
place in RAM_region { readwrite,
|
||||
block CSTACK, block HEAP };
|
||||
place in RAM1_region { section .sram };
|
||||
142
bsp/gd32/gd32103c-eval/board/linker_scripts/link.ld
Normal file
142
bsp/gd32/gd32103c-eval/board/linker_scripts/link.ld
Normal file
@@ -0,0 +1,142 @@
|
||||
/*
|
||||
* linker script for GD32F30x with GNU ld
|
||||
* BruceOu 2021-12-18
|
||||
*/
|
||||
|
||||
/* Program Entry, set to mark it as "used" and avoid gc */
|
||||
MEMORY
|
||||
{
|
||||
CODE (rx) : ORIGIN = 0x08000000, LENGTH = 256k /* 256KB flash */
|
||||
DATA (rw) : ORIGIN = 0x20000000, LENGTH = 48k /* 48KB sram */
|
||||
}
|
||||
ENTRY(Reset_Handler)
|
||||
_system_stack_size = 0x200;
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.text :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
_stext = .;
|
||||
KEEP(*(.isr_vector)) /* Startup code */
|
||||
. = ALIGN(4);
|
||||
*(.text) /* remaining code */
|
||||
*(.text.*) /* remaining code */
|
||||
*(.rodata) /* read-only data (constants) */
|
||||
*(.rodata*)
|
||||
*(.glue_7)
|
||||
*(.glue_7t)
|
||||
*(.gnu.linkonce.t*)
|
||||
|
||||
/* section information for finsh shell */
|
||||
. = ALIGN(4);
|
||||
__fsymtab_start = .;
|
||||
KEEP(*(FSymTab))
|
||||
__fsymtab_end = .;
|
||||
. = ALIGN(4);
|
||||
__vsymtab_start = .;
|
||||
KEEP(*(VSymTab))
|
||||
__vsymtab_end = .;
|
||||
. = ALIGN(4);
|
||||
|
||||
/* section information for initial. */
|
||||
. = ALIGN(4);
|
||||
__rt_init_start = .;
|
||||
KEEP(*(SORT(.rti_fn*)))
|
||||
__rt_init_end = .;
|
||||
. = ALIGN(4);
|
||||
|
||||
. = ALIGN(4);
|
||||
_etext = .;
|
||||
} > CODE = 0
|
||||
|
||||
/* .ARM.exidx is sorted, so has to go in its own output section. */
|
||||
__exidx_start = .;
|
||||
.ARM.exidx :
|
||||
{
|
||||
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
|
||||
|
||||
/* This is used by the startup in order to initialize the .data secion */
|
||||
_sidata = .;
|
||||
} > CODE
|
||||
__exidx_end = .;
|
||||
|
||||
/* .data section which is used for initialized data */
|
||||
|
||||
.data : AT (_sidata)
|
||||
{
|
||||
. = ALIGN(4);
|
||||
/* This is used by the startup in order to initialize the .data secion */
|
||||
_sdata = . ;
|
||||
|
||||
*(.data)
|
||||
*(.data.*)
|
||||
*(.gnu.linkonce.d*)
|
||||
|
||||
. = ALIGN(4);
|
||||
/* This is used by the startup in order to initialize the .data secion */
|
||||
_edata = . ;
|
||||
} >DATA
|
||||
|
||||
.stack :
|
||||
{
|
||||
. = . + _system_stack_size;
|
||||
. = ALIGN(4);
|
||||
_estack = .;
|
||||
} >DATA
|
||||
|
||||
__bss_start = .;
|
||||
.bss :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
/* This is used by the startup in order to initialize the .bss secion */
|
||||
_sbss = .;
|
||||
|
||||
*(.bss)
|
||||
*(.bss.*)
|
||||
*(COMMON)
|
||||
|
||||
. = ALIGN(4);
|
||||
/* This is used by the startup in order to initialize the .bss secion */
|
||||
_ebss = . ;
|
||||
|
||||
*(.bss.init)
|
||||
} > DATA
|
||||
__bss_end = .;
|
||||
|
||||
_end = .;
|
||||
|
||||
/* Stabs debugging sections. */
|
||||
.stab 0 : { *(.stab) }
|
||||
.stabstr 0 : { *(.stabstr) }
|
||||
.stab.excl 0 : { *(.stab.excl) }
|
||||
.stab.exclstr 0 : { *(.stab.exclstr) }
|
||||
.stab.index 0 : { *(.stab.index) }
|
||||
.stab.indexstr 0 : { *(.stab.indexstr) }
|
||||
.comment 0 : { *(.comment) }
|
||||
/* DWARF debug sections.
|
||||
* Symbols in the DWARF debugging sections are relative to the beginning
|
||||
* of the section so we begin them at 0. */
|
||||
/* DWARF 1 */
|
||||
.debug 0 : { *(.debug) }
|
||||
.line 0 : { *(.line) }
|
||||
/* GNU DWARF 1 extensions */
|
||||
.debug_srcinfo 0 : { *(.debug_srcinfo) }
|
||||
.debug_sfnames 0 : { *(.debug_sfnames) }
|
||||
/* DWARF 1.1 and DWARF 2 */
|
||||
.debug_aranges 0 : { *(.debug_aranges) }
|
||||
.debug_pubnames 0 : { *(.debug_pubnames) }
|
||||
/* DWARF 2 */
|
||||
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
|
||||
.debug_abbrev 0 : { *(.debug_abbrev) }
|
||||
.debug_line 0 : { *(.debug_line) }
|
||||
.debug_frame 0 : { *(.debug_frame) }
|
||||
.debug_str 0 : { *(.debug_str) }
|
||||
.debug_loc 0 : { *(.debug_loc) }
|
||||
.debug_macinfo 0 : { *(.debug_macinfo) }
|
||||
/* SGI/MIPS DWARF 2 extensions */
|
||||
.debug_weaknames 0 : { *(.debug_weaknames) }
|
||||
.debug_funcnames 0 : { *(.debug_funcnames) }
|
||||
.debug_typenames 0 : { *(.debug_typenames) }
|
||||
.debug_varnames 0 : { *(.debug_varnames) }
|
||||
}
|
||||
15
bsp/gd32/gd32103c-eval/board/linker_scripts/link.sct
Normal file
15
bsp/gd32/gd32103c-eval/board/linker_scripts/link.sct
Normal file
@@ -0,0 +1,15 @@
|
||||
; *************************************************************
|
||||
; *** Scatter-Loading Description File generated by uVision ***
|
||||
; *************************************************************
|
||||
|
||||
LR_IROM1 0x08000000 0x00040000 { ; load region size_region
|
||||
ER_IROM1 0x08000000 0x00040000 { ; load address = execution address
|
||||
*.o (RESET, +First)
|
||||
*(InRoot$$Sections)
|
||||
.ANY (+RO)
|
||||
}
|
||||
RW_IRAM1 0x20000000 0x0000C000 { ; RW data
|
||||
.ANY (+RW +ZI)
|
||||
}
|
||||
}
|
||||
|
||||
748
bsp/gd32/gd32103c-eval/project.uvoptx
Normal file
748
bsp/gd32/gd32103c-eval/project.uvoptx
Normal file
File diff suppressed because it is too large
Load Diff
737
bsp/gd32/gd32103c-eval/project.uvproj
Normal file
737
bsp/gd32/gd32103c-eval/project.uvproj
Normal file
File diff suppressed because it is too large
Load Diff
668
bsp/gd32/gd32103c-eval/project.uvprojx
Normal file
668
bsp/gd32/gd32103c-eval/project.uvprojx
Normal file
File diff suppressed because it is too large
Load Diff
200
bsp/gd32/gd32103c-eval/rtconfig.h
Normal file
200
bsp/gd32/gd32103c-eval/rtconfig.h
Normal file
@@ -0,0 +1,200 @@
|
||||
#ifndef RT_CONFIG_H__
|
||||
#define RT_CONFIG_H__
|
||||
|
||||
/* Automatically generated file; DO NOT EDIT. */
|
||||
/* RT-Thread Configuration */
|
||||
|
||||
/* RT-Thread Kernel */
|
||||
|
||||
#define RT_NAME_MAX 8
|
||||
#define RT_ALIGN_SIZE 4
|
||||
#define RT_THREAD_PRIORITY_32
|
||||
#define RT_THREAD_PRIORITY_MAX 32
|
||||
#define RT_TICK_PER_SECOND 100
|
||||
#define RT_USING_OVERFLOW_CHECK
|
||||
#define RT_USING_HOOK
|
||||
#define RT_USING_IDLE_HOOK
|
||||
#define RT_IDLE_HOOK_LIST_SIZE 4
|
||||
#define IDLE_THREAD_STACK_SIZE 256
|
||||
|
||||
/* kservice optimization */
|
||||
|
||||
#define RT_DEBUG
|
||||
#define RT_DEBUG_COLOR
|
||||
|
||||
/* Inter-Thread communication */
|
||||
|
||||
#define RT_USING_SEMAPHORE
|
||||
#define RT_USING_MUTEX
|
||||
#define RT_USING_EVENT
|
||||
#define RT_USING_MAILBOX
|
||||
#define RT_USING_MESSAGEQUEUE
|
||||
|
||||
/* Memory Management */
|
||||
|
||||
#define RT_USING_MEMPOOL
|
||||
#define RT_USING_SMALL_MEM
|
||||
#define RT_USING_HEAP
|
||||
|
||||
/* Kernel Device Object */
|
||||
|
||||
#define RT_USING_DEVICE
|
||||
#define RT_USING_CONSOLE
|
||||
#define RT_CONSOLEBUF_SIZE 128
|
||||
#define RT_CONSOLE_DEVICE_NAME "uart1"
|
||||
#define RT_VER_NUM 0x40004
|
||||
|
||||
/* RT-Thread Components */
|
||||
|
||||
#define RT_USING_COMPONENTS_INIT
|
||||
#define RT_USING_USER_MAIN
|
||||
#define RT_MAIN_THREAD_STACK_SIZE 2048
|
||||
#define RT_MAIN_THREAD_PRIORITY 10
|
||||
|
||||
/* C++ features */
|
||||
|
||||
|
||||
/* Command shell */
|
||||
|
||||
#define RT_USING_FINSH
|
||||
#define RT_USING_MSH
|
||||
#define FINSH_USING_MSH
|
||||
#define FINSH_THREAD_NAME "tshell"
|
||||
#define FINSH_THREAD_PRIORITY 20
|
||||
#define FINSH_THREAD_STACK_SIZE 4096
|
||||
#define FINSH_USING_HISTORY
|
||||
#define FINSH_HISTORY_LINES 5
|
||||
#define FINSH_USING_SYMTAB
|
||||
#define FINSH_CMD_SIZE 80
|
||||
#define MSH_USING_BUILT_IN_COMMANDS
|
||||
#define FINSH_USING_DESCRIPTION
|
||||
#define FINSH_ARG_MAX 10
|
||||
|
||||
/* Device virtual file system */
|
||||
|
||||
|
||||
/* Device Drivers */
|
||||
|
||||
#define RT_USING_DEVICE_IPC
|
||||
#define RT_PIPE_BUFSZ 512
|
||||
#define RT_USING_SYSTEM_WORKQUEUE
|
||||
#define RT_SYSTEM_WORKQUEUE_STACKSIZE 2048
|
||||
#define RT_SYSTEM_WORKQUEUE_PRIORITY 23
|
||||
#define RT_USING_SERIAL
|
||||
#define RT_USING_SERIAL_V1
|
||||
#define RT_SERIAL_USING_DMA
|
||||
#define RT_SERIAL_RB_BUFSZ 64
|
||||
#define RT_USING_PIN
|
||||
|
||||
/* Using USB */
|
||||
|
||||
|
||||
/* POSIX layer and C standard library */
|
||||
|
||||
#define RT_LIBC_USING_TIME
|
||||
#define RT_LIBC_DEFAULT_TIMEZONE 8
|
||||
|
||||
/* Network */
|
||||
|
||||
/* Socket abstraction layer */
|
||||
|
||||
|
||||
/* Network interface device */
|
||||
|
||||
|
||||
/* light weight TCP/IP stack */
|
||||
|
||||
|
||||
/* AT commands */
|
||||
|
||||
|
||||
/* VBUS(Virtual Software BUS) */
|
||||
|
||||
|
||||
/* Utilities */
|
||||
|
||||
|
||||
/* RT-Thread Utestcases */
|
||||
|
||||
|
||||
/* RT-Thread online packages */
|
||||
|
||||
/* IoT - internet of things */
|
||||
|
||||
|
||||
/* Wi-Fi */
|
||||
|
||||
/* Marvell WiFi */
|
||||
|
||||
|
||||
/* Wiced WiFi */
|
||||
|
||||
|
||||
/* IoT Cloud */
|
||||
|
||||
|
||||
/* security packages */
|
||||
|
||||
|
||||
/* language packages */
|
||||
|
||||
|
||||
/* multimedia packages */
|
||||
|
||||
/* LVGL: powerful and easy-to-use embedded GUI library */
|
||||
|
||||
|
||||
/* u8g2: a monochrome graphic library */
|
||||
|
||||
|
||||
/* PainterEngine: A cross-platform graphics application framework written in C language */
|
||||
|
||||
|
||||
/* tools packages */
|
||||
|
||||
|
||||
/* system packages */
|
||||
|
||||
/* enhanced kernel services */
|
||||
|
||||
|
||||
/* acceleration: Assembly language or algorithmic acceleration packages */
|
||||
|
||||
|
||||
/* CMSIS: ARM Cortex-M Microcontroller Software Interface Standard */
|
||||
|
||||
|
||||
/* Micrium: Micrium software products porting for RT-Thread */
|
||||
|
||||
|
||||
/* peripheral libraries and drivers */
|
||||
|
||||
|
||||
/* AI packages */
|
||||
|
||||
|
||||
/* miscellaneous packages */
|
||||
|
||||
/* samples: kernel and components samples */
|
||||
|
||||
|
||||
/* entertainment: terminal games and other interesting software packages */
|
||||
|
||||
|
||||
/* Hardware Drivers Config */
|
||||
|
||||
#define SOC_SERIES_GD32F10x
|
||||
#define SOC_GD32103V
|
||||
|
||||
/* Onboard Peripheral Drivers */
|
||||
|
||||
/* On-chip Peripheral Drivers */
|
||||
|
||||
#define BSP_USING_GPIO
|
||||
#define BSP_USING_UART
|
||||
#define BSP_USING_UART1
|
||||
|
||||
/* Board extended module Drivers */
|
||||
|
||||
|
||||
#endif
|
||||
150
bsp/gd32/gd32103c-eval/rtconfig.py
Normal file
150
bsp/gd32/gd32103c-eval/rtconfig.py
Normal file
@@ -0,0 +1,150 @@
|
||||
import os
|
||||
|
||||
# toolchains options
|
||||
ARCH='arm'
|
||||
CPU='cortex-m3'
|
||||
CROSS_TOOL='keil'
|
||||
|
||||
# bsp lib config
|
||||
BSP_LIBRARY_TYPE = None
|
||||
|
||||
if os.getenv('RTT_CC'):
|
||||
CROSS_TOOL = os.getenv('RTT_CC')
|
||||
if os.getenv('RTT_ROOT'):
|
||||
RTT_ROOT = os.getenv('RTT_ROOT')
|
||||
|
||||
# cross_tool provides the cross compiler
|
||||
# EXEC_PATH is the compiler execute path, for example, CodeSourcery, Keil MDK, IAR
|
||||
if CROSS_TOOL == 'gcc':
|
||||
PLATFORM = 'gcc'
|
||||
EXEC_PATH = r'C:\Users\XXYYZZ'
|
||||
elif CROSS_TOOL == 'keil':
|
||||
PLATFORM = 'armcc'
|
||||
EXEC_PATH = r'C:/Keil_v5'
|
||||
elif CROSS_TOOL == 'iar':
|
||||
PLATFORM = 'iar'
|
||||
EXEC_PATH = r'C:/Program Files (x86)/IAR Systems/Embedded Workbench 8.0'
|
||||
|
||||
if os.getenv('RTT_EXEC_PATH'):
|
||||
EXEC_PATH = os.getenv('RTT_EXEC_PATH')
|
||||
|
||||
BUILD = 'debug'
|
||||
|
||||
if PLATFORM == 'gcc':
|
||||
# toolchains
|
||||
PREFIX = 'arm-none-eabi-'
|
||||
CC = PREFIX + 'gcc'
|
||||
AS = PREFIX + 'gcc'
|
||||
AR = PREFIX + 'ar'
|
||||
CXX = PREFIX + 'g++'
|
||||
LINK = PREFIX + 'gcc'
|
||||
TARGET_EXT = 'elf'
|
||||
SIZE = PREFIX + 'size'
|
||||
OBJDUMP = PREFIX + 'objdump'
|
||||
OBJCPY = PREFIX + 'objcopy'
|
||||
|
||||
DEVICE = ' -mcpu=cortex-m3 -mthumb -ffunction-sections -fdata-sections'
|
||||
CFLAGS = DEVICE + ' -Dgcc'
|
||||
AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp -Wa,-mimplicit-it=thumb '
|
||||
LFLAGS = DEVICE + ' -Wl,--gc-sections,-Map=rtthread.map,-cref,-u,Reset_Handler -T board/linker_scripts/link.ld'
|
||||
|
||||
CPATH = ''
|
||||
LPATH = ''
|
||||
|
||||
if BUILD == 'debug':
|
||||
CFLAGS += ' -O0 -gdwarf-2 -g'
|
||||
AFLAGS += ' -gdwarf-2'
|
||||
else:
|
||||
CFLAGS += ' -O2'
|
||||
|
||||
CXXFLAGS = CFLAGS
|
||||
|
||||
POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n'
|
||||
|
||||
elif PLATFORM == 'armcc':
|
||||
# toolchains
|
||||
CC = 'armcc'
|
||||
CXX = 'armcc'
|
||||
AS = 'armasm'
|
||||
AR = 'armar'
|
||||
LINK = 'armlink'
|
||||
TARGET_EXT = 'axf'
|
||||
|
||||
DEVICE = ' --cpu Cortex-M3.fp '
|
||||
CFLAGS = '-c ' + DEVICE + ' --apcs=interwork --c99'
|
||||
AFLAGS = DEVICE + ' --apcs=interwork '
|
||||
LFLAGS = DEVICE + ' --scatter "board\linker_scripts\link.sct" --info sizes --info totals --info unused --info veneers --list rtthread.map --strict'
|
||||
CFLAGS += ' -I' + EXEC_PATH + '/ARM/ARMCC/include'
|
||||
LFLAGS += ' --libpath=' + EXEC_PATH + '/ARM/ARMCC/lib'
|
||||
|
||||
CFLAGS += ' -D__MICROLIB '
|
||||
AFLAGS += ' --pd "__MICROLIB SETA 1" '
|
||||
LFLAGS += ' --library_type=microlib '
|
||||
EXEC_PATH += '/ARM/ARMCC/bin/'
|
||||
|
||||
if BUILD == 'debug':
|
||||
CFLAGS += ' -g -O0'
|
||||
AFLAGS += ' -g'
|
||||
else:
|
||||
CFLAGS += ' -O2'
|
||||
|
||||
CXXFLAGS = CFLAGS
|
||||
CFLAGS += ' -std=c99'
|
||||
|
||||
POST_ACTION = 'fromelf --bin $TARGET --output rtthread.bin \nfromelf -z $TARGET'
|
||||
|
||||
elif PLATFORM == 'iar':
|
||||
# toolchains
|
||||
CC = 'iccarm'
|
||||
CXX = 'iccarm'
|
||||
AS = 'iasmarm'
|
||||
AR = 'iarchive'
|
||||
LINK = 'ilinkarm'
|
||||
TARGET_EXT = 'out'
|
||||
|
||||
DEVICE = '-Dewarm'
|
||||
|
||||
CFLAGS = DEVICE
|
||||
CFLAGS += ' --diag_suppress Pa050'
|
||||
CFLAGS += ' --no_cse'
|
||||
CFLAGS += ' --no_unroll'
|
||||
CFLAGS += ' --no_inline'
|
||||
CFLAGS += ' --no_code_motion'
|
||||
CFLAGS += ' --no_tbaa'
|
||||
CFLAGS += ' --no_clustering'
|
||||
CFLAGS += ' --no_scheduling'
|
||||
CFLAGS += ' --endian=little'
|
||||
CFLAGS += ' --cpu=Cortex-M3'
|
||||
CFLAGS += ' -e'
|
||||
CFLAGS += ' --fpu=None'
|
||||
CFLAGS += ' --dlib_config "' + EXEC_PATH + '/arm/INC/c/DLib_Config_Normal.h"'
|
||||
CFLAGS += ' --silent'
|
||||
|
||||
AFLAGS = DEVICE
|
||||
AFLAGS += ' -s+'
|
||||
AFLAGS += ' -w+'
|
||||
AFLAGS += ' -r'
|
||||
AFLAGS += ' --cpu Cortex-M3'
|
||||
AFLAGS += ' --fpu None'
|
||||
AFLAGS += ' -S'
|
||||
|
||||
if BUILD == 'debug':
|
||||
CFLAGS += ' --debug'
|
||||
CFLAGS += ' -On'
|
||||
else:
|
||||
CFLAGS += ' -Oh'
|
||||
|
||||
LFLAGS = ' --config "board/linker_scripts/link.icf"'
|
||||
LFLAGS += ' --entry __iar_program_start'
|
||||
|
||||
CXXFLAGS = CFLAGS
|
||||
|
||||
EXEC_PATH = EXEC_PATH + '/arm/bin/'
|
||||
POST_ACTION = 'ielftool --bin $TARGET rtthread.bin'
|
||||
|
||||
def dist_handle(BSP_ROOT, dist_dir):
|
||||
import sys
|
||||
cwd_path = os.getcwd()
|
||||
sys.path.append(os.path.join(os.path.dirname(BSP_ROOT), 'tools'))
|
||||
from sdk_dist import dist_do_building
|
||||
dist_do_building(BSP_ROOT, dist_dir)
|
||||
180
bsp/gd32/gd32103c-eval/template.uvoptx
Normal file
180
bsp/gd32/gd32103c-eval/template.uvoptx
Normal file
@@ -0,0 +1,180 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<ProjectOpt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_optx.xsd">
|
||||
|
||||
<SchemaVersion>1.0</SchemaVersion>
|
||||
|
||||
<Header>### uVision Project, (C) Keil Software</Header>
|
||||
|
||||
<Extensions>
|
||||
<cExt>*.c</cExt>
|
||||
<aExt>*.s*; *.src; *.a*</aExt>
|
||||
<oExt>*.obj; *.o</oExt>
|
||||
<lExt>*.lib</lExt>
|
||||
<tExt>*.txt; *.h; *.inc</tExt>
|
||||
<pExt>*.plm</pExt>
|
||||
<CppX>*.cpp</CppX>
|
||||
<nMigrate>0</nMigrate>
|
||||
</Extensions>
|
||||
|
||||
<DaveTm>
|
||||
<dwLowDateTime>0</dwLowDateTime>
|
||||
<dwHighDateTime>0</dwHighDateTime>
|
||||
</DaveTm>
|
||||
|
||||
<Target>
|
||||
<TargetName>rt-thread</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<TargetOption>
|
||||
<CLKADS>12000000</CLKADS>
|
||||
<OPTTT>
|
||||
<gFlags>1</gFlags>
|
||||
<BeepAtEnd>1</BeepAtEnd>
|
||||
<RunSim>0</RunSim>
|
||||
<RunTarget>1</RunTarget>
|
||||
<RunAbUc>0</RunAbUc>
|
||||
</OPTTT>
|
||||
<OPTHX>
|
||||
<HexSelection>1</HexSelection>
|
||||
<FlashByte>65535</FlashByte>
|
||||
<HexRangeLowAddress>0</HexRangeLowAddress>
|
||||
<HexRangeHighAddress>0</HexRangeHighAddress>
|
||||
<HexOffset>0</HexOffset>
|
||||
</OPTHX>
|
||||
<OPTLEX>
|
||||
<PageWidth>79</PageWidth>
|
||||
<PageLength>66</PageLength>
|
||||
<TabStop>8</TabStop>
|
||||
<ListingPath>.\build\</ListingPath>
|
||||
</OPTLEX>
|
||||
<ListingPage>
|
||||
<CreateCListing>1</CreateCListing>
|
||||
<CreateAListing>1</CreateAListing>
|
||||
<CreateLListing>1</CreateLListing>
|
||||
<CreateIListing>0</CreateIListing>
|
||||
<AsmCond>1</AsmCond>
|
||||
<AsmSymb>1</AsmSymb>
|
||||
<AsmXref>0</AsmXref>
|
||||
<CCond>1</CCond>
|
||||
<CCode>0</CCode>
|
||||
<CListInc>0</CListInc>
|
||||
<CSymb>0</CSymb>
|
||||
<LinkerCodeListing>0</LinkerCodeListing>
|
||||
</ListingPage>
|
||||
<OPTXL>
|
||||
<LMap>1</LMap>
|
||||
<LComments>1</LComments>
|
||||
<LGenerateSymbols>1</LGenerateSymbols>
|
||||
<LLibSym>1</LLibSym>
|
||||
<LLines>1</LLines>
|
||||
<LLocSym>1</LLocSym>
|
||||
<LPubSym>1</LPubSym>
|
||||
<LXref>0</LXref>
|
||||
<LExpSel>0</LExpSel>
|
||||
</OPTXL>
|
||||
<OPTFL>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<IsCurrentTarget>1</IsCurrentTarget>
|
||||
</OPTFL>
|
||||
<CpuCode>255</CpuCode>
|
||||
<DebugOpt>
|
||||
<uSim>0</uSim>
|
||||
<uTrg>1</uTrg>
|
||||
<sLdApp>1</sLdApp>
|
||||
<sGomain>1</sGomain>
|
||||
<sRbreak>1</sRbreak>
|
||||
<sRwatch>1</sRwatch>
|
||||
<sRmem>1</sRmem>
|
||||
<sRfunc>1</sRfunc>
|
||||
<sRbox>1</sRbox>
|
||||
<tLdApp>1</tLdApp>
|
||||
<tGomain>1</tGomain>
|
||||
<tRbreak>1</tRbreak>
|
||||
<tRwatch>1</tRwatch>
|
||||
<tRmem>1</tRmem>
|
||||
<tRfunc>0</tRfunc>
|
||||
<tRbox>1</tRbox>
|
||||
<tRtrace>1</tRtrace>
|
||||
<sRSysVw>1</sRSysVw>
|
||||
<tRSysVw>1</tRSysVw>
|
||||
<sRunDeb>0</sRunDeb>
|
||||
<sLrtime>0</sLrtime>
|
||||
<bEvRecOn>1</bEvRecOn>
|
||||
<bSchkAxf>0</bSchkAxf>
|
||||
<bTchkAxf>0</bTchkAxf>
|
||||
<nTsel>3</nTsel>
|
||||
<sDll></sDll>
|
||||
<sDllPa></sDllPa>
|
||||
<sDlgDll></sDlgDll>
|
||||
<sDlgPa></sDlgPa>
|
||||
<sIfile></sIfile>
|
||||
<tDll></tDll>
|
||||
<tDllPa></tDllPa>
|
||||
<tDlgDll></tDlgDll>
|
||||
<tDlgPa></tDlgPa>
|
||||
<tIfile></tIfile>
|
||||
<pMon>BIN\CMSIS_AGDI.dll</pMon>
|
||||
</DebugOpt>
|
||||
<TargetDriverDllRegistry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>UL2CM3</Key>
|
||||
<Name>UL2CM3(-S0 -C0 -P0 ) -FN1 -FC1000 -FD20000000 -FF0GD32F10x_CL -FL040000 -FS08000000 -FP0($$Device:GD32F105RC$Flash\GD32F10x_CL.FLM)</Name>
|
||||
</SetRegEntry>
|
||||
</TargetDriverDllRegistry>
|
||||
<Breakpoint/>
|
||||
<Tracepoint>
|
||||
<THDelay>0</THDelay>
|
||||
</Tracepoint>
|
||||
<DebugFlag>
|
||||
<trace>0</trace>
|
||||
<periodic>0</periodic>
|
||||
<aLwin>0</aLwin>
|
||||
<aCover>0</aCover>
|
||||
<aSer1>0</aSer1>
|
||||
<aSer2>0</aSer2>
|
||||
<aPa>0</aPa>
|
||||
<viewmode>0</viewmode>
|
||||
<vrSel>0</vrSel>
|
||||
<aSym>0</aSym>
|
||||
<aTbox>0</aTbox>
|
||||
<AscS1>0</AscS1>
|
||||
<AscS2>0</AscS2>
|
||||
<AscS3>0</AscS3>
|
||||
<aSer3>0</aSer3>
|
||||
<eProf>0</eProf>
|
||||
<aLa>0</aLa>
|
||||
<aPa1>0</aPa1>
|
||||
<AscS4>0</AscS4>
|
||||
<aSer4>0</aSer4>
|
||||
<StkLoc>0</StkLoc>
|
||||
<TrcWin>0</TrcWin>
|
||||
<newCpu>0</newCpu>
|
||||
<uProt>0</uProt>
|
||||
</DebugFlag>
|
||||
<LintExecutable></LintExecutable>
|
||||
<LintConfigFile></LintConfigFile>
|
||||
<bLintAuto>0</bLintAuto>
|
||||
<bAutoGenD>0</bAutoGenD>
|
||||
<LntExFlags>0</LntExFlags>
|
||||
<pMisraName></pMisraName>
|
||||
<pszMrule></pszMrule>
|
||||
<pSingCmds></pSingCmds>
|
||||
<pMultCmds></pMultCmds>
|
||||
<pMisraNamep></pMisraNamep>
|
||||
<pszMrulep></pszMrulep>
|
||||
<pSingCmdsp></pSingCmdsp>
|
||||
<pMultCmdsp></pMultCmdsp>
|
||||
</TargetOption>
|
||||
</Target>
|
||||
|
||||
<Group>
|
||||
<GroupName>::CMSIS</GroupName>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>1</RteFlg>
|
||||
</Group>
|
||||
|
||||
</ProjectOpt>
|
||||
628
bsp/gd32/gd32103c-eval/template.uvproj
Normal file
628
bsp/gd32/gd32103c-eval/template.uvproj
Normal file
File diff suppressed because it is too large
Load Diff
418
bsp/gd32/gd32103c-eval/template.uvprojx
Normal file
418
bsp/gd32/gd32103c-eval/template.uvprojx
Normal file
@@ -0,0 +1,418 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_projx.xsd">
|
||||
|
||||
<SchemaVersion>2.1</SchemaVersion>
|
||||
|
||||
<Header>### uVision Project, (C) Keil Software</Header>
|
||||
|
||||
<Targets>
|
||||
<Target>
|
||||
<TargetName>rt-thread</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<pCCUsed>5060750::V5.06 update 6 (build 750)::.\ARMCC</pCCUsed>
|
||||
<uAC6>0</uAC6>
|
||||
<TargetOption>
|
||||
<TargetCommonOption>
|
||||
<Device>GD32F103VC</Device>
|
||||
<Vendor>GigaDevice</Vendor>
|
||||
<PackID>GigaDevice.GD32F10x_DFP.2.0.1</PackID>
|
||||
<PackURL>http://www.keil.com/pack/</PackURL>
|
||||
<Cpu>IRAM(0x20000000,0x0000C000) IROM(0x08000000,0x00040000) CPUTYPE("Cortex-M3") CLOCK(10800000) ELITTLE</Cpu>
|
||||
<FlashUtilSpec></FlashUtilSpec>
|
||||
<StartupFile></StartupFile>
|
||||
<FlashDriverDll>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0GD32F10x_CL -FS08000000 -FL040000 -FP0($$Device:GD32F103VC$Flash\GD32F10x_CL.FLM))</FlashDriverDll>
|
||||
<DeviceId>0</DeviceId>
|
||||
<RegisterFile>$$Device:GD32F103VC$Device\Include\gd32f10x.h</RegisterFile>
|
||||
<MemoryEnv></MemoryEnv>
|
||||
<Cmp></Cmp>
|
||||
<Asm></Asm>
|
||||
<Linker></Linker>
|
||||
<OHString></OHString>
|
||||
<InfinionOptionDll></InfinionOptionDll>
|
||||
<SLE66CMisc></SLE66CMisc>
|
||||
<SLE66AMisc></SLE66AMisc>
|
||||
<SLE66LinkerMisc></SLE66LinkerMisc>
|
||||
<SFDFile>$$Device:GD32F103VC$SVD\GD32F10x\GD32F10x_CL.svd</SFDFile>
|
||||
<bCustSvd>0</bCustSvd>
|
||||
<UseEnv>0</UseEnv>
|
||||
<BinPath></BinPath>
|
||||
<IncludePath></IncludePath>
|
||||
<LibPath></LibPath>
|
||||
<RegisterFilePath></RegisterFilePath>
|
||||
<DBRegisterFilePath></DBRegisterFilePath>
|
||||
<TargetStatus>
|
||||
<Error>0</Error>
|
||||
<ExitCodeStop>0</ExitCodeStop>
|
||||
<ButtonStop>0</ButtonStop>
|
||||
<NotGenerated>0</NotGenerated>
|
||||
<InvalidFlash>1</InvalidFlash>
|
||||
</TargetStatus>
|
||||
<OutputDirectory>.\build\</OutputDirectory>
|
||||
<OutputName>rtthread</OutputName>
|
||||
<CreateExecutable>1</CreateExecutable>
|
||||
<CreateLib>0</CreateLib>
|
||||
<CreateHexFile>0</CreateHexFile>
|
||||
<DebugInformation>1</DebugInformation>
|
||||
<BrowseInformation>0</BrowseInformation>
|
||||
<ListingPath>.\build\</ListingPath>
|
||||
<HexFormatSelection>1</HexFormatSelection>
|
||||
<Merge32K>0</Merge32K>
|
||||
<CreateBatchFile>0</CreateBatchFile>
|
||||
<BeforeCompile>
|
||||
<RunUserProg1>0</RunUserProg1>
|
||||
<RunUserProg2>0</RunUserProg2>
|
||||
<UserProg1Name></UserProg1Name>
|
||||
<UserProg2Name></UserProg2Name>
|
||||
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||
<nStopU1X>0</nStopU1X>
|
||||
<nStopU2X>0</nStopU2X>
|
||||
</BeforeCompile>
|
||||
<BeforeMake>
|
||||
<RunUserProg1>0</RunUserProg1>
|
||||
<RunUserProg2>0</RunUserProg2>
|
||||
<UserProg1Name></UserProg1Name>
|
||||
<UserProg2Name></UserProg2Name>
|
||||
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||
<nStopB1X>0</nStopB1X>
|
||||
<nStopB2X>0</nStopB2X>
|
||||
</BeforeMake>
|
||||
<AfterMake>
|
||||
<RunUserProg1>1</RunUserProg1>
|
||||
<RunUserProg2>0</RunUserProg2>
|
||||
<UserProg1Name>fromelf --bin !L --output rtthread.bin</UserProg1Name>
|
||||
<UserProg2Name></UserProg2Name>
|
||||
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||
<nStopA1X>0</nStopA1X>
|
||||
<nStopA2X>0</nStopA2X>
|
||||
</AfterMake>
|
||||
<SelectedForBatchBuild>0</SelectedForBatchBuild>
|
||||
<SVCSIdString></SVCSIdString>
|
||||
</TargetCommonOption>
|
||||
<CommonProperty>
|
||||
<UseCPPCompiler>0</UseCPPCompiler>
|
||||
<RVCTCodeConst>0</RVCTCodeConst>
|
||||
<RVCTZI>0</RVCTZI>
|
||||
<RVCTOtherData>0</RVCTOtherData>
|
||||
<ModuleSelection>0</ModuleSelection>
|
||||
<IncludeInBuild>1</IncludeInBuild>
|
||||
<AlwaysBuild>0</AlwaysBuild>
|
||||
<GenerateAssemblyFile>0</GenerateAssemblyFile>
|
||||
<AssembleAssemblyFile>0</AssembleAssemblyFile>
|
||||
<PublicsOnly>0</PublicsOnly>
|
||||
<StopOnExitCode>3</StopOnExitCode>
|
||||
<CustomArgument></CustomArgument>
|
||||
<IncludeLibraryModules></IncludeLibraryModules>
|
||||
<ComprImg>1</ComprImg>
|
||||
</CommonProperty>
|
||||
<DllOption>
|
||||
<SimDllName>SARMCM3.DLL</SimDllName>
|
||||
<SimDllArguments> -REMAP</SimDllArguments>
|
||||
<SimDlgDll>DCM.DLL</SimDlgDll>
|
||||
<SimDlgDllArguments>-pCM3</SimDlgDllArguments>
|
||||
<TargetDllName>SARMCM3.DLL</TargetDllName>
|
||||
<TargetDllArguments></TargetDllArguments>
|
||||
<TargetDlgDll>TCM.DLL</TargetDlgDll>
|
||||
<TargetDlgDllArguments>-pCM3</TargetDlgDllArguments>
|
||||
</DllOption>
|
||||
<DebugOption>
|
||||
<OPTHX>
|
||||
<HexSelection>1</HexSelection>
|
||||
<HexRangeLowAddress>0</HexRangeLowAddress>
|
||||
<HexRangeHighAddress>0</HexRangeHighAddress>
|
||||
<HexOffset>0</HexOffset>
|
||||
<Oh166RecLen>16</Oh166RecLen>
|
||||
</OPTHX>
|
||||
</DebugOption>
|
||||
<Utilities>
|
||||
<Flash1>
|
||||
<UseTargetDll>1</UseTargetDll>
|
||||
<UseExternalTool>0</UseExternalTool>
|
||||
<RunIndependent>0</RunIndependent>
|
||||
<UpdateFlashBeforeDebugging>1</UpdateFlashBeforeDebugging>
|
||||
<Capability>1</Capability>
|
||||
<DriverSelection>4096</DriverSelection>
|
||||
</Flash1>
|
||||
<bUseTDR>1</bUseTDR>
|
||||
<Flash2>BIN\UL2CM3.DLL</Flash2>
|
||||
<Flash3></Flash3>
|
||||
<Flash4></Flash4>
|
||||
<pFcarmOut></pFcarmOut>
|
||||
<pFcarmGrp></pFcarmGrp>
|
||||
<pFcArmRoot></pFcArmRoot>
|
||||
<FcArmLst>0</FcArmLst>
|
||||
</Utilities>
|
||||
<TargetArmAds>
|
||||
<ArmAdsMisc>
|
||||
<GenerateListings>0</GenerateListings>
|
||||
<asHll>1</asHll>
|
||||
<asAsm>1</asAsm>
|
||||
<asMacX>1</asMacX>
|
||||
<asSyms>1</asSyms>
|
||||
<asFals>1</asFals>
|
||||
<asDbgD>1</asDbgD>
|
||||
<asForm>1</asForm>
|
||||
<ldLst>0</ldLst>
|
||||
<ldmm>1</ldmm>
|
||||
<ldXref>1</ldXref>
|
||||
<BigEnd>0</BigEnd>
|
||||
<AdsALst>1</AdsALst>
|
||||
<AdsACrf>1</AdsACrf>
|
||||
<AdsANop>0</AdsANop>
|
||||
<AdsANot>0</AdsANot>
|
||||
<AdsLLst>1</AdsLLst>
|
||||
<AdsLmap>1</AdsLmap>
|
||||
<AdsLcgr>1</AdsLcgr>
|
||||
<AdsLsym>1</AdsLsym>
|
||||
<AdsLszi>1</AdsLszi>
|
||||
<AdsLtoi>1</AdsLtoi>
|
||||
<AdsLsun>1</AdsLsun>
|
||||
<AdsLven>1</AdsLven>
|
||||
<AdsLsxf>1</AdsLsxf>
|
||||
<RvctClst>0</RvctClst>
|
||||
<GenPPlst>0</GenPPlst>
|
||||
<AdsCpuType>"Cortex-M3"</AdsCpuType>
|
||||
<RvctDeviceName></RvctDeviceName>
|
||||
<mOS>0</mOS>
|
||||
<uocRom>0</uocRom>
|
||||
<uocRam>0</uocRam>
|
||||
<hadIROM>1</hadIROM>
|
||||
<hadIRAM>1</hadIRAM>
|
||||
<hadXRAM>0</hadXRAM>
|
||||
<uocXRam>0</uocXRam>
|
||||
<RvdsVP>0</RvdsVP>
|
||||
<RvdsMve>0</RvdsMve>
|
||||
<RvdsCdeCp>0</RvdsCdeCp>
|
||||
<hadIRAM2>0</hadIRAM2>
|
||||
<hadIROM2>0</hadIROM2>
|
||||
<StupSel>8</StupSel>
|
||||
<useUlib>0</useUlib>
|
||||
<EndSel>0</EndSel>
|
||||
<uLtcg>0</uLtcg>
|
||||
<nSecure>0</nSecure>
|
||||
<RoSelD>3</RoSelD>
|
||||
<RwSelD>3</RwSelD>
|
||||
<CodeSel>0</CodeSel>
|
||||
<OptFeed>0</OptFeed>
|
||||
<NoZi1>0</NoZi1>
|
||||
<NoZi2>0</NoZi2>
|
||||
<NoZi3>0</NoZi3>
|
||||
<NoZi4>0</NoZi4>
|
||||
<NoZi5>0</NoZi5>
|
||||
<Ro1Chk>0</Ro1Chk>
|
||||
<Ro2Chk>0</Ro2Chk>
|
||||
<Ro3Chk>0</Ro3Chk>
|
||||
<Ir1Chk>1</Ir1Chk>
|
||||
<Ir2Chk>0</Ir2Chk>
|
||||
<Ra1Chk>0</Ra1Chk>
|
||||
<Ra2Chk>0</Ra2Chk>
|
||||
<Ra3Chk>0</Ra3Chk>
|
||||
<Im1Chk>1</Im1Chk>
|
||||
<Im2Chk>0</Im2Chk>
|
||||
<OnChipMemories>
|
||||
<Ocm1>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm1>
|
||||
<Ocm2>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm2>
|
||||
<Ocm3>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm3>
|
||||
<Ocm4>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm4>
|
||||
<Ocm5>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm5>
|
||||
<Ocm6>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm6>
|
||||
<IRAM>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x20000000</StartAddress>
|
||||
<Size>0xc000</Size>
|
||||
</IRAM>
|
||||
<IROM>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x8000000</StartAddress>
|
||||
<Size>0x40000</Size>
|
||||
</IROM>
|
||||
<XRAM>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</XRAM>
|
||||
<OCR_RVCT1>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT1>
|
||||
<OCR_RVCT2>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT2>
|
||||
<OCR_RVCT3>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT3>
|
||||
<OCR_RVCT4>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x8000000</StartAddress>
|
||||
<Size>0x40000</Size>
|
||||
</OCR_RVCT4>
|
||||
<OCR_RVCT5>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT5>
|
||||
<OCR_RVCT6>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT6>
|
||||
<OCR_RVCT7>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT7>
|
||||
<OCR_RVCT8>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT8>
|
||||
<OCR_RVCT9>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x20000000</StartAddress>
|
||||
<Size>0x18000</Size>
|
||||
</OCR_RVCT9>
|
||||
<OCR_RVCT10>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT10>
|
||||
</OnChipMemories>
|
||||
<RvctStartVector></RvctStartVector>
|
||||
</ArmAdsMisc>
|
||||
<Cads>
|
||||
<interw>1</interw>
|
||||
<Optim>4</Optim>
|
||||
<oTime>0</oTime>
|
||||
<SplitLS>0</SplitLS>
|
||||
<OneElfS>0</OneElfS>
|
||||
<Strict>0</Strict>
|
||||
<EnumInt>0</EnumInt>
|
||||
<PlainCh>0</PlainCh>
|
||||
<Ropi>0</Ropi>
|
||||
<Rwpi>0</Rwpi>
|
||||
<wLevel>0</wLevel>
|
||||
<uThumb>0</uThumb>
|
||||
<uSurpInc>0</uSurpInc>
|
||||
<uC99>1</uC99>
|
||||
<uGnu>0</uGnu>
|
||||
<useXO>0</useXO>
|
||||
<v6Lang>1</v6Lang>
|
||||
<v6LangP>1</v6LangP>
|
||||
<vShortEn>1</vShortEn>
|
||||
<vShortWch>1</vShortWch>
|
||||
<v6Lto>0</v6Lto>
|
||||
<v6WtE>0</v6WtE>
|
||||
<v6Rtti>0</v6Rtti>
|
||||
<VariousControls>
|
||||
<MiscControls></MiscControls>
|
||||
<Define></Define>
|
||||
<Undefine></Undefine>
|
||||
<IncludePath></IncludePath>
|
||||
</VariousControls>
|
||||
</Cads>
|
||||
<Aads>
|
||||
<interw>1</interw>
|
||||
<Ropi>0</Ropi>
|
||||
<Rwpi>0</Rwpi>
|
||||
<thumb>0</thumb>
|
||||
<SplitLS>0</SplitLS>
|
||||
<SwStkChk>0</SwStkChk>
|
||||
<NoWarn>0</NoWarn>
|
||||
<uSurpInc>0</uSurpInc>
|
||||
<useXO>0</useXO>
|
||||
<ClangAsOpt>4</ClangAsOpt>
|
||||
<VariousControls>
|
||||
<MiscControls></MiscControls>
|
||||
<Define></Define>
|
||||
<Undefine></Undefine>
|
||||
<IncludePath></IncludePath>
|
||||
</VariousControls>
|
||||
</Aads>
|
||||
<LDads>
|
||||
<umfTarg>1</umfTarg>
|
||||
<Ropi>0</Ropi>
|
||||
<Rwpi>0</Rwpi>
|
||||
<noStLib>0</noStLib>
|
||||
<RepFail>1</RepFail>
|
||||
<useFile>0</useFile>
|
||||
<TextAddressRange>0x08000000</TextAddressRange>
|
||||
<DataAddressRange>0x20000000</DataAddressRange>
|
||||
<pXoBase></pXoBase>
|
||||
<ScatterFile>.\gd32_rom.ld</ScatterFile>
|
||||
<IncludeLibs></IncludeLibs>
|
||||
<IncludeLibsPath></IncludeLibsPath>
|
||||
<Misc></Misc>
|
||||
<LinkerInputFile></LinkerInputFile>
|
||||
<DisabledWarnings></DisabledWarnings>
|
||||
</LDads>
|
||||
</TargetArmAds>
|
||||
</TargetOption>
|
||||
<Groups>
|
||||
<Group>
|
||||
<GroupName>::CMSIS</GroupName>
|
||||
</Group>
|
||||
</Groups>
|
||||
</Target>
|
||||
</Targets>
|
||||
|
||||
<RTE>
|
||||
<apis/>
|
||||
<components>
|
||||
<component Cclass="CMSIS" Cgroup="CORE" Cvendor="ARM" Cversion="5.4.0" condition="ARMv6_7_8-M Device">
|
||||
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.7.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="rt-thread"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
</components>
|
||||
<files/>
|
||||
</RTE>
|
||||
|
||||
<LayerInfo>
|
||||
<Layers>
|
||||
<Layer>
|
||||
<LayName><Project Info></LayName>
|
||||
<LayDesc></LayDesc>
|
||||
<LayUrl></LayUrl>
|
||||
<LayKeys></LayKeys>
|
||||
<LayCat></LayCat>
|
||||
<LayLic></LayLic>
|
||||
<LayTarg>0</LayTarg>
|
||||
<LayPrjMark>1</LayPrjMark>
|
||||
</Layer>
|
||||
</Layers>
|
||||
</LayerInfo>
|
||||
|
||||
</Project>
|
||||
636
bsp/gd32/gd32105c-eval/.config
Normal file
636
bsp/gd32/gd32105c-eval/.config
Normal file
File diff suppressed because it is too large
Load Diff
21
bsp/gd32/gd32105c-eval/Kconfig
Normal file
21
bsp/gd32/gd32105c-eval/Kconfig
Normal file
@@ -0,0 +1,21 @@
|
||||
mainmenu "RT-Thread Configuration"
|
||||
|
||||
config BSP_DIR
|
||||
string
|
||||
option env="BSP_ROOT"
|
||||
default "."
|
||||
|
||||
config RTT_DIR
|
||||
string
|
||||
option env="RTT_ROOT"
|
||||
default "../../.."
|
||||
|
||||
config PKGS_DIR
|
||||
string
|
||||
option env="PKGS_ROOT"
|
||||
default "packages"
|
||||
|
||||
source "$RTT_DIR/Kconfig"
|
||||
source "$PKGS_DIR/Kconfig"
|
||||
source "../libraries/Kconfig"
|
||||
source "board/Kconfig"
|
||||
98
bsp/gd32/gd32105c-eval/README.md
Normal file
98
bsp/gd32/gd32105c-eval/README.md
Normal file
@@ -0,0 +1,98 @@
|
||||
# GD32105C-EVAL开发板BSP说明
|
||||
|
||||
## 简介
|
||||
|
||||
GD3105C-EVAL是-兆易创新推出的一款GD32F10X系列的评估板,最高主频高达108M,该开发板具有丰富的板载资源,可以充分发挥 GD32105VCT6 的芯片性能。
|
||||
|
||||
开发板外观如下图所示:
|
||||
|
||||

|
||||
|
||||
该开发板常用 **板载资源** 如下:
|
||||
|
||||
- GD32105VCT6,主频 108MHz,256KB FLASH ,96KB RAM
|
||||
|
||||
- 常用外设
|
||||
|
||||
- LED :5个,LED1 (电源指示灯),LED2(PC0),LED3(PC2),LED4(PE0),LED5(PE1)
|
||||
- 按键:3个,K1(用户按键,PA0),K2(用户按键,PC13),K3(用户按键,PB14)
|
||||
|
||||
- 常用接口:USB 接口
|
||||
|
||||
- 调试接口:GD-LINK
|
||||
|
||||
## 外设支持
|
||||
|
||||
本 BSP 目前对外设的支持情况如下:
|
||||
|
||||
| **片上外设** | **支持情况** | **备注** |
|
||||
|:--------- |:--------:|:------------------------------------- |
|
||||
| GPIO | 支持 | PA0, PA1... PK15 ---> PIN: 0, 1...144 |
|
||||
| UART | 支持 | UART0 - UART7 |
|
||||
| I2C | 支持 | I2C1 |
|
||||
| SPI | 支持 | SPI0 - SPI2 |
|
||||
| SPI FLASH | 支持 | |
|
||||
| **扩展模块** | **支持情况** | **备注** |
|
||||
| 暂无 | 暂不支持 | 暂不支持 |
|
||||
|
||||
## 使用说明
|
||||
|
||||
使用说明分为如下两个章节:
|
||||
|
||||
- 快速上手
|
||||
|
||||
本章节是为刚接触 RT-Thread 的新手准备的使用说明,遵循简单的步骤即可将 RT-Thread 操作系统运行在该开发板上,看到实验效果 。
|
||||
|
||||
- 进阶使用
|
||||
|
||||
本章节是为需要在 RT-Thread 操作系统上使用更多开发板资源的开发者准备的。通过使用 ENV 工具对 BSP 进行配置,可以开启更多板载资源,实现更多高级功能。
|
||||
|
||||
### 快速上手
|
||||
|
||||
本 BSP 为开发者提供 MDK5 工程,并且支持 GCC 开发环境,也可使用RT-Thread Studio开发。下面以 MDK5 开发环境为例,介绍如何将系统运行起来。
|
||||
|
||||
#### 硬件连接
|
||||
|
||||
使用数据线连接开发板到 PC,使用USB转TTL模块连接PA2(MCU TX)和PA3(MCU RX),打开电源开关。
|
||||
|
||||
#### 编译下载
|
||||
|
||||
双击 project.uvprojx 文件,打开 MDK5 工程,编译并下载程序到开发板。
|
||||
|
||||
> 工程默认配置使用 GD-Link 仿真器下载程序,在通过 GD-Link 连接开发板的基础上,点击下载按钮即可下载程序到开发板
|
||||
|
||||
#### 运行结果
|
||||
|
||||
下载程序成功之后,系统会自动运行,LED 闪烁。
|
||||
|
||||
连接开发板对应串口到 PC , 在终端工具里打开相应的串口(115200-8-1-N),复位设备后,可以看到 RT-Thread 的输出信息:
|
||||
|
||||
```bash
|
||||
\ | /
|
||||
- RT - Thread Operating System
|
||||
/ | \ 4.0.4 build Dec 19 2021 10:00:27
|
||||
2006 - 2021 Copyright by rt-thread team
|
||||
msh >
|
||||
```
|
||||
|
||||
### 进阶使用
|
||||
|
||||
此 BSP 默认只开启了 GPIO 和 串口1的功能,如果需使用高级功能,需要利用 ENV 工具对BSP 进行配置,步骤如下:
|
||||
|
||||
1. 在 bsp 下打开 env 工具。
|
||||
|
||||
2. 输入`menuconfig`命令配置工程,配置好之后保存退出。
|
||||
|
||||
3. 输入`pkgs --update`命令更新软件包。
|
||||
|
||||
4. 输入`scons --target=mdk4/mdk5` 命令重新生成工程。
|
||||
|
||||
## 注意事项
|
||||
|
||||
暂无
|
||||
|
||||
## 联系人信息
|
||||
|
||||
维护人:
|
||||
|
||||
- [BruceOu](https://github.com/Ouxiaolong/), 邮箱:<ouxiaolong@bruceou.cn>
|
||||
15
bsp/gd32/gd32105c-eval/SConscript
Normal file
15
bsp/gd32/gd32105c-eval/SConscript
Normal file
@@ -0,0 +1,15 @@
|
||||
# for module compiling
|
||||
import os
|
||||
Import('RTT_ROOT')
|
||||
from building import *
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
objs = []
|
||||
list = os.listdir(cwd)
|
||||
|
||||
for d in list:
|
||||
path = os.path.join(cwd, d)
|
||||
if os.path.isfile(os.path.join(path, 'SConscript')):
|
||||
objs = objs + SConscript(os.path.join(d, 'SConscript'))
|
||||
|
||||
Return('objs')
|
||||
60
bsp/gd32/gd32105c-eval/SConstruct
Normal file
60
bsp/gd32/gd32105c-eval/SConstruct
Normal file
@@ -0,0 +1,60 @@
|
||||
import os
|
||||
import sys
|
||||
import rtconfig
|
||||
|
||||
if os.getenv('RTT_ROOT'):
|
||||
RTT_ROOT = os.getenv('RTT_ROOT')
|
||||
else:
|
||||
RTT_ROOT = os.path.normpath(os.getcwd() + '/../../..')
|
||||
|
||||
sys.path = sys.path + [os.path.join(RTT_ROOT, 'tools')]
|
||||
try:
|
||||
from building import *
|
||||
except:
|
||||
print('Cannot found RT-Thread root directory, please check RTT_ROOT')
|
||||
print(RTT_ROOT)
|
||||
exit(-1)
|
||||
|
||||
TARGET = 'rtthread.' + rtconfig.TARGET_EXT
|
||||
|
||||
DefaultEnvironment(tools=[])
|
||||
env = Environment(tools = ['mingw'],
|
||||
AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
|
||||
CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS,
|
||||
AR = rtconfig.AR, ARFLAGS = '-rc',
|
||||
CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS,
|
||||
LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS)
|
||||
env.PrependENVPath('PATH', rtconfig.EXEC_PATH)
|
||||
|
||||
if rtconfig.PLATFORM == 'iar':
|
||||
env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES'])
|
||||
env.Replace(ARFLAGS = [''])
|
||||
env.Replace(LINKCOM = env["LINKCOM"] + ' --map rtthread.map')
|
||||
|
||||
Export('RTT_ROOT')
|
||||
Export('rtconfig')
|
||||
|
||||
SDK_ROOT = os.path.abspath('./')
|
||||
|
||||
if os.path.exists(SDK_ROOT + '/libraries'):
|
||||
libraries_path_prefix = SDK_ROOT + '/libraries'
|
||||
else:
|
||||
libraries_path_prefix = os.path.dirname(SDK_ROOT) + '/libraries'
|
||||
|
||||
SDK_LIB = libraries_path_prefix
|
||||
Export('SDK_LIB')
|
||||
|
||||
# prepare building environment
|
||||
objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False)
|
||||
|
||||
gd32_library = 'GD32F10x_Firmware_Library'
|
||||
rtconfig.BSP_LIBRARY_TYPE = gd32_library
|
||||
|
||||
# include libraries
|
||||
objs.extend(SConscript(os.path.join(libraries_path_prefix, gd32_library, 'SConscript')))
|
||||
|
||||
# include drivers
|
||||
objs.extend(SConscript(os.path.join(libraries_path_prefix, 'gd32_drivers', 'SConscript')))
|
||||
|
||||
# make a building
|
||||
DoBuilding(TARGET, objs)
|
||||
11
bsp/gd32/gd32105c-eval/applications/SConscript
Normal file
11
bsp/gd32/gd32105c-eval/applications/SConscript
Normal file
@@ -0,0 +1,11 @@
|
||||
Import('RTT_ROOT')
|
||||
Import('rtconfig')
|
||||
from building import *
|
||||
|
||||
cwd = os.path.join(str(Dir('#')), 'applications')
|
||||
src = Glob('*.c')
|
||||
CPPPATH = [cwd, str(Dir('#'))]
|
||||
|
||||
group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH)
|
||||
|
||||
Return('group')
|
||||
35
bsp/gd32/gd32105c-eval/applications/main.c
Normal file
35
bsp/gd32/gd32105c-eval/applications/main.c
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2021-08-20 BruceOu first implementation
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <rtthread.h>
|
||||
#include <rtdevice.h>
|
||||
#include <board.h>
|
||||
|
||||
/* defined the LED2 pin: PC6 */
|
||||
#define LED2_PIN GET_PIN(C, 6)
|
||||
|
||||
int main(void)
|
||||
{
|
||||
int count = 1;
|
||||
|
||||
/* set LED2 pin mode to output */
|
||||
rt_pin_mode(LED2_PIN, PIN_MODE_OUTPUT);
|
||||
|
||||
while (count++)
|
||||
{
|
||||
rt_pin_write(LED2_PIN, PIN_HIGH);
|
||||
rt_thread_mdelay(500);
|
||||
rt_pin_write(LED2_PIN, PIN_LOW);
|
||||
rt_thread_mdelay(500);
|
||||
}
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
85
bsp/gd32/gd32105c-eval/board/Kconfig
Normal file
85
bsp/gd32/gd32105c-eval/board/Kconfig
Normal file
@@ -0,0 +1,85 @@
|
||||
menu "Hardware Drivers Config"
|
||||
|
||||
config SOC_SERIES_GD32F10x
|
||||
bool
|
||||
default y
|
||||
|
||||
config SOC_GD32105V
|
||||
bool
|
||||
select SOC_SERIES_GD32F10x
|
||||
select RT_USING_COMPONENTS_INIT
|
||||
select RT_USING_USER_MAIN
|
||||
default y
|
||||
|
||||
menu "Onboard Peripheral Drivers"
|
||||
|
||||
endmenu
|
||||
|
||||
menu "On-chip Peripheral Drivers"
|
||||
|
||||
config BSP_USING_GPIO
|
||||
bool "Enable GPIO"
|
||||
select RT_USING_PIN
|
||||
default y
|
||||
|
||||
menuconfig BSP_USING_UART
|
||||
bool "Enable UART"
|
||||
default y
|
||||
select RT_USING_SERIAL
|
||||
if BSP_USING_UART
|
||||
config BSP_USING_UART1
|
||||
bool "Enable UART1"
|
||||
default y
|
||||
|
||||
config BSP_UART1_RX_USING_DMA
|
||||
bool "Enable UART1 RX DMA"
|
||||
depends on BSP_USING_UART1 && RT_SERIAL_USING_DMA
|
||||
default n
|
||||
endif
|
||||
|
||||
menuconfig BSP_USING_SPI
|
||||
bool "Enable SPI BUS"
|
||||
default n
|
||||
select RT_USING_SPI
|
||||
if BSP_USING_SPI
|
||||
config BSP_USING_SPI1
|
||||
bool "Enable SPI1 BUS"
|
||||
default n
|
||||
|
||||
config BSP_SPI1_TX_USING_DMA
|
||||
bool "Enable SPI1 TX DMA"
|
||||
depends on BSP_USING_SPI1
|
||||
default n
|
||||
|
||||
config BSP_SPI1_RX_USING_DMA
|
||||
bool "Enable SPI1 RX DMA"
|
||||
depends on BSP_USING_SPI1
|
||||
select BSP_SPI1_TX_USING_DMA
|
||||
default n
|
||||
endif
|
||||
|
||||
menuconfig BSP_USING_I2C1
|
||||
bool "Enable I2C1 BUS (software simulation)"
|
||||
default n
|
||||
select RT_USING_I2C
|
||||
select RT_USING_I2C_BITOPS
|
||||
select RT_USING_PIN
|
||||
if BSP_USING_I2C1
|
||||
config BSP_I2C1_SCL_PIN
|
||||
int "i2c1 scl pin number"
|
||||
range 1 216
|
||||
default 24
|
||||
config BSP_I2C1_SDA_PIN
|
||||
int "I2C1 sda pin number"
|
||||
range 1 216
|
||||
default 25
|
||||
endif
|
||||
source "../libraries/gd32_drivers/Kconfig"
|
||||
|
||||
endmenu
|
||||
|
||||
menu "Board extended module Drivers"
|
||||
|
||||
endmenu
|
||||
|
||||
endmenu
|
||||
28
bsp/gd32/gd32105c-eval/board/SConscript
Normal file
28
bsp/gd32/gd32105c-eval/board/SConscript
Normal file
@@ -0,0 +1,28 @@
|
||||
import os
|
||||
import rtconfig
|
||||
from building import *
|
||||
|
||||
Import('SDK_LIB')
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
|
||||
# add general drivers
|
||||
src = Split('''
|
||||
board.c
|
||||
''')
|
||||
|
||||
path = [cwd]
|
||||
|
||||
startup_path_prefix = SDK_LIB
|
||||
|
||||
if rtconfig.CROSS_TOOL == 'gcc':
|
||||
src += [startup_path_prefix + '/GD32F10x_Firmware_Library/CMSIS/GD/GD32F10x/Source/GCC/startup_gd32f10x_cl.s']
|
||||
elif rtconfig.CROSS_TOOL == 'keil':
|
||||
src += [startup_path_prefix + '/GD32F10x_Firmware_Library/CMSIS/GD/GD32F10x/Source/ARM/startup_gd32f10x_cl.s']
|
||||
elif rtconfig.CROSS_TOOL == 'iar':
|
||||
src += [startup_path_prefix + '/GD32F10x_Firmware_Library/CMSIS/GD/GD32F10x/Source/IAR/startup_gd32f10x_cl.s']
|
||||
|
||||
CPPDEFINES = ['GD32F10X_CL']
|
||||
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
|
||||
|
||||
Return('group')
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user