Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
build vllink lite.r4 gd32e103xx firmware
Browse files Browse the repository at this point in the history
  • Loading branch information
talpachen committed Sep 23, 2020
1 parent 99b8e9a commit f9c3506
Show file tree
Hide file tree
Showing 34 changed files with 635 additions and 378 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
/*-Editor annotation file-*/
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
/*-Specials-*/
define symbol __ICFEDIT_intvec_start__ = 0x08000000;
define symbol __ICFEDIT_intvec_start__ = 0x08003000;
/*-Memory Regions-*/
define symbol __ICFEDIT_region_ROM_start__ = 0x08000000;
define symbol __ICFEDIT_region_ROM_end__ = 0x0801FFFF;
define symbol __ICFEDIT_region_ROM_start__ = 0x08003000;
define symbol __ICFEDIT_region_ROM_end__ = 0x0800FFFF;
define symbol __ICFEDIT_region_RAM_start__ = 0x20000004;
define symbol __ICFEDIT_region_RAM_end__ = 0x20004FFF;
/*-Sizes-*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
/*-Editor annotation file-*/
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
/*-Specials-*/
define symbol __ICFEDIT_intvec_start__ = 0x08000000;
define symbol __ICFEDIT_intvec_start__ = 0x08003000;
/*-Memory Regions-*/
define symbol __ICFEDIT_region_ROM_start__ = 0x08000000;
define symbol __ICFEDIT_region_ROM_start__ = 0x08003000;
define symbol __ICFEDIT_region_ROM_end__ = 0x0800FFFF;
define symbol __ICFEDIT_region_RAM_start__ = 0x20000004;
define symbol __ICFEDIT_region_RAM_end__ = 0x20001FFF;
Expand Down
66 changes: 48 additions & 18 deletions source/project_vllink_lite/vllink_lite/EWARM/project.ewp
Original file line number Diff line number Diff line change
Expand Up @@ -651,11 +651,11 @@
</option>
<option>
<name>OCOutputOverride</name>
<state>0</state>
<state>1</state>
</option>
<option>
<name>OOCOutputFile</name>
<state>project.bin</state>
<state>vllink_lite_gd32f350xx_app.bin</state>
</option>
<option>
<name>OOCCommandLineProducer</name>
Expand Down Expand Up @@ -1135,7 +1135,7 @@
</option>
<option>
<name>OGChipSelectEditMenu</name>
<state>GD32E103x8 GD GD32E103x8</state>
<state>GD32E103xB GD GD32E103xB</state>
</option>
<option>
<name>GenLowLevelInterface</name>
Expand Down Expand Up @@ -1195,7 +1195,7 @@
</option>
<option>
<name>GFPUDeviceSlave</name>
<state>GD32E103x8 GD GD32E103x8</state>
<state>GD32E103xB GD GD32E103xB</state>
</option>
<option>
<name>FPU2</name>
Expand Down Expand Up @@ -1708,11 +1708,11 @@
</option>
<option>
<name>OCOutputOverride</name>
<state>0</state>
<state>1</state>
</option>
<option>
<name>OOCOutputFile</name>
<state>project.bin</state>
<state>vllink_lite_gd32e103xx_app.bin</state>
</option>
<option>
<name>OOCCommandLineProducer</name>
Expand Down Expand Up @@ -2144,8 +2144,26 @@
<name>$PROJ_DIR$\..\config\vsf_usr_cfg.h</name>
</file>
</group>
<file>
<name>$PROJ_DIR$\..\dap.c</name>
<group>
<name>dap</name>
<file>
<name>$PROJ_DIR$\..\dap\dap.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\dap\dap.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\dap\dap_swo.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\dap\dap_swo.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\dap\dap_vendor.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\dap\dap_vendor.h</name>
</file>
<configuration>
<name>VllinkLite_GD32F350</name>
<settings>
Expand Down Expand Up @@ -2662,10 +2680,28 @@
</data>
</settings>
</configuration>
</file>
<file>
<name>$PROJ_DIR$\..\dap.h</name>
</file>
</group>
<group>
<name>daphost</name>
<file>
<name>$PROJ_DIR$\..\daphost\daphost.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\daphost\daphost.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\daphost\daphost_jtag.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\daphost\daphost_jtag.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\daphost\daphost_swd.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\daphost\daphost_swd.h</name>
</file>
</group>
<file>
<name>$PROJ_DIR$\GD32E103xx_booted.icf</name>
</file>
Expand All @@ -2675,12 +2711,6 @@
<file>
<name>$PROJ_DIR$\..\main.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\ramuart.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\ramuart.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\usrapp_usbd_common.c</name>
<excluded>
Expand Down
57 changes: 42 additions & 15 deletions source/project_vllink_lite/vllink_lite/EWARM/project.ewt
Original file line number Diff line number Diff line change
Expand Up @@ -2400,18 +2400,51 @@
<name>$PROJ_DIR$\..\config\vsf_usr_cfg.h</name>
</file>
</group>
<file>
<name>$PROJ_DIR$\..\dap.c</name>
<configuration>
<name>VllinkLite_GD32F350</name>
</configuration>
<group>
<name>dap</name>
<file>
<name>$PROJ_DIR$\..\dap\dap.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\dap\dap.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\dap\dap_swo.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\dap\dap_swo.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\dap\dap_vendor.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\dap\dap_vendor.h</name>
</file>
<configuration>
<name>VllinkLite_GD32E103</name>
</configuration>
</file>
<file>
<name>$PROJ_DIR$\..\dap.h</name>
</file>
</group>
<group>
<name>daphost</name>
<file>
<name>$PROJ_DIR$\..\daphost\daphost.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\daphost\daphost.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\daphost\daphost_jtag.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\daphost\daphost_jtag.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\daphost\daphost_swd.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\daphost\daphost_swd.h</name>
</file>
</group>
<file>
<name>$PROJ_DIR$\GD32E103xx_booted.icf</name>
</file>
Expand All @@ -2421,12 +2454,6 @@
<file>
<name>$PROJ_DIR$\..\main.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\ramuart.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\ramuart.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\usrapp_usbd_common.c</name>
</file>
Expand Down
4 changes: 4 additions & 0 deletions source/project_vllink_lite/vllink_lite/config/brd_cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@
#define __BRD_CFG_H__

#if defined(BRD_CFG_VLLINKLITE_GD32E103)
# define PROJ_CFG_GD32E10X_HSI48M_USB_PLL_128M_OVERCLOCK
# include "chip_cfg_gd32e10x.h"
# include "brd_cfg_vllinklite_gd32e103.h"
#elif defined(BRD_CFG_VLLINKLITE_GD32F350)
# define PROJ_CFG_GD32F3X0_HSI48M_USB_PLL_128M_OVERCLOCK
# include "chip_cfg_gd32f3x0.h"
# include "brd_cfg_vllinklite_gd32f350.h"
#endif

#define VSF_SYSTIMER_FREQ (CHIP_AHB_FREQ_HZ)

#endif // __BRD_CFG_H__
14 changes: 14 additions & 0 deletions source/project_vllink_lite/vllink_lite/config/chip_cfg_gd32e10x.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,21 @@
# define CHIP_AHB_FREQ_HZ (CHIP_PLL_FREQ_HZ)
# define CHIP_APB1_FREQ_HZ (CHIP_AHB_FREQ_HZ / 2)
# define CHIP_APB2_FREQ_HZ (CHIP_AHB_FREQ_HZ / 2)
#elif defined(PROJ_CFG_GD32E10X_HSI48M_USB_PLL_72M)
# define CHIP_CLKEN (GD32E10X_CLKEN_HSI48M | GD32E10X_CLKEN_PLL0)
# define CHIP_HCLKSRC GD32E10X_HCLKSRC_PLL
# define CHIP_PLLSRC GD32E10X_PLLSRC_HSI48M
# define CHIP_USBSRC GD32E10X_USBSRC_HSI48M
# define CHIP_LSE_FREQ_HZ (32768)
# define CHIP_HSE_FREQ_HZ (12 * 1000 * 1000)
# define CHIP_PLL_FREQ_HZ (72 * 1000 * 1000)
# define CHIP_AHB_FREQ_HZ (CHIP_PLL_FREQ_HZ)
# define CHIP_APB1_FREQ_HZ (CHIP_AHB_FREQ_HZ / 2)
# define CHIP_APB2_FREQ_HZ (CHIP_AHB_FREQ_HZ / 2)
#endif

#if (VSF_USE_USB_DEVICE == ENABLED) || (VSF_USE_USB_HOST == ENABLED)
# define VSF_USE_USB_DEVICE_DCD_DWCOTG ENABLED
#endif

#endif // __CHIP_CFG_XXX_H__
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,8 @@
# define CHIP_APB2_FREQ_HZ (CHIP_AHB_FREQ_HZ / 2)
#endif

#if (VSF_USE_USB_DEVICE == ENABLED) || (VSF_USE_USB_HOST == ENABLED)
# define VSF_USE_USB_DEVICE_DCD_DWCOTG ENABLED
#endif

#endif // __CHIP_CFG_XXX_H__
82 changes: 38 additions & 44 deletions source/project_vllink_lite/vllink_lite/config/proj_cfg_vllinklite.h
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
#ifndef __PROJ_CFG_LVL2_H__
#define __PROJ_CFG_LVL2_H__

#define VSF_SYSTIMER_FREQ (CHIP_AHB_FREQ_HZ)

#if defined(BRD_CFG_VLLINKLITE_GD32E103)
# define APP_CFG_SERIAL_HEADER_STR u"GD32E103."
# define APP_CFG_SERIAL_HEADER_STR_LENGTH (sizeof(APP_CFG_SERIAL_HEADER_STR) - 2)
# define FIRMWARE_AREA_ADDR 0x08003000
# define FIRMWARE_AREA_SIZE_MAX (128 * 1024 - 12 * 1024)
# define FIRMWARE_SP_ADDR (0x20000000 + 4)
# define FIRMWARE_SP_SIZE_MAX (8 * 1024 - 4)
# define PROJ_CFG_GD32E10X_HSI48M_USB_PLL_128M_OVERCLOCK
//# define PROJ_CFG_CORE_INIT_TINY
# if (VSF_USE_USB_DEVICE == ENABLED) || (VSF_USE_USB_HOST == ENABLED)
# define VSF_USE_USB_DEVICE_DCD_DWCOTG ENABLED
# define VSF_DWCOTG_DCD_CFG_FAKE_EP ENABLED
# define USRAPP_CFG_USBD_SPEED USB_SPEED_FULL
# define APP_CFG_USBD_SPEED USB_DC_SPEED_FULL
Expand All @@ -31,10 +27,8 @@
# define FIRMWARE_AREA_SIZE_MAX (64 * 1024 - 12 * 1024)
# define FIRMWARE_SP_ADDR (0x20000000 + 4)
# define FIRMWARE_SP_SIZE_MAX (32 * 1024 - 4)
# define PROJ_CFG_GD32F3X0_HSI48M_USB_PLL_128M_OVERCLOCK
//# define PROJ_CFG_CORE_INIT_TINY
# if (VSF_USE_USB_DEVICE == ENABLED) || (VSF_USE_USB_HOST == ENABLED)
# define VSF_USE_USB_DEVICE_DCD_DWCOTG ENABLED
# define VSF_DWCOTG_DCD_CFG_FAKE_EP ENABLED
# define USRAPP_CFG_USBD_SPEED USB_SPEED_FULL
# define APP_CFG_USBD_SPEED USB_DC_SPEED_FULL
Expand All @@ -57,59 +51,59 @@
#define APP_CFG_USBD_WEBUSB_URL "vllogic.github.io/webdfu/"


#define CMSIS_DAP_V2_PACKET_SIZE 512
#define WEBUSB_DAP_PACKET_SIZE 64
#define CMSIS_DAP_V2_PACKET_SIZE 512
#define WEBUSB_DAP_PACKET_SIZE 64

#ifdef APP_CFG_CMSIS_DAP_V2_SUPPORT
# define CMSIS_DAP_V2_DESC_LENGTH 23
# define CMSIS_DAP_V2_INTERFACE_COUNT 1
# define WINUSB_BOS_DESC_LENGTH 28
# define WINUSB_BOS_COUNT 1
# define FUNCTION_CMSIS_DAP_V2_SUBSET_LEN 160
# define CMSIS_DAP_V2_STR_DESC_COUNT 2
# define CMSIS_DAP_V2_DESC_LENGTH 23
# define CMSIS_DAP_V2_INTERFACE_COUNT 1
# define WINUSB_BOS_DESC_LENGTH 28
# define WINUSB_BOS_COUNT 1
# define FUNCTION_CMSIS_DAP_V2_SUBSET_LEN 160
# define CMSIS_DAP_V2_STR_DESC_COUNT 2
#else
# define CMSIS_DAP_V2_DESC_LENGTH 0
# define CMSIS_DAP_V2_INTERFACE_COUNT 0
# define WINUSB_BOS_DESC_LENGTH 0
# define WINUSB_BOS_COUNT 0
# define FUNCTION_CMSIS_DAP_V2_SUBSET_LEN 0
# define CMSIS_DAP_V2_STR_DESC_COUNT 0
# define CMSIS_DAP_V2_DESC_LENGTH 0
# define CMSIS_DAP_V2_INTERFACE_COUNT 0
# define WINUSB_BOS_DESC_LENGTH 0
# define WINUSB_BOS_COUNT 0
# define FUNCTION_CMSIS_DAP_V2_SUBSET_LEN 0
# define CMSIS_DAP_V2_STR_DESC_COUNT 0
#endif

#ifdef APP_CFG_WEBUSB_SUPPORT
# define WEBUSB_DESC_LENGTH 9
# define WEBUSB_INTERFACE_COUNT 1
# define WEBUSB_BOS_DESC_LENGTH 24
# define WEBUSB_BOS_COUNT 1
# define FUNCTION_WEBUSB_SUBSET_LEN 160
# define WEBUSB_STR_DESC_COUNT 1
# define WEBUSB_DESC_LENGTH 9
# define WEBUSB_INTERFACE_COUNT 1
# define WEBUSB_BOS_DESC_LENGTH 24
# define WEBUSB_BOS_COUNT 1
# define FUNCTION_WEBUSB_SUBSET_LEN 160
# define WEBUSB_STR_DESC_COUNT 1
#else
# define WEBUSB_DESC_LENGTH 0
# define WEBUSB_INTERFACE_COUNT 0
# define WEBUSB_BOS_DESC_LENGTH 0
# define WEBUSB_BOS_COUNT 0
# define FUNCTION_WEBUSB_SUBSET_LEN 0
# define WEBUSB_STR_DESC_COUNT 0
# define WEBUSB_DESC_LENGTH 0
# define WEBUSB_INTERFACE_COUNT 0
# define WEBUSB_BOS_DESC_LENGTH 0
# define WEBUSB_BOS_COUNT 0
# define FUNCTION_WEBUSB_SUBSET_LEN 0
# define WEBUSB_STR_DESC_COUNT 0
#endif

#ifdef APP_CFG_CDCEXT_SUPPORT
# define CDCEXT_DESC_LENGTH 66
# define CDCEXT_INTERFACE_COUNT 2
# define CDCEXT_STR_DESC_COUNT 1
# define CDCEXT_DESC_LENGTH 66
# define CDCEXT_INTERFACE_COUNT 2
# define CDCEXT_STR_DESC_COUNT 1
#else
# define CDCEXT_DESC_LENGTH 0
# define CDCEXT_INTERFACE_COUNT 0
# define CDCEXT_STR_DESC_COUNT 0
# define CDCEXT_DESC_LENGTH 0
# define CDCEXT_INTERFACE_COUNT 0
# define CDCEXT_STR_DESC_COUNT 0
#endif

#ifdef APP_CFG_CDCSHELL_SUPPORT
# define CDCSHELL_DESC_LENGTH 66
# define CDCSHELL_INTERFACE_COUNT 2
# define CDCSHELL_STR_DESC_COUNT 1
# define CDCSHELL_DESC_LENGTH 66
# define CDCSHELL_INTERFACE_COUNT 2
# define CDCSHELL_STR_DESC_COUNT 1
#else
# define CDCSHELL_DESC_LENGTH 0
# define CDCSHELL_INTERFACE_COUNT 0
# define CDCSHELL_STR_DESC_COUNT 0
# define CDCSHELL_DESC_LENGTH 0
# define CDCSHELL_INTERFACE_COUNT 0
# define CDCSHELL_STR_DESC_COUNT 0
#endif

#define APP_CFG_USBD_CONFIGDESC_LENGTH (9 + CMSIS_DAP_V2_DESC_LENGTH + WEBUSB_DESC_LENGTH + CDCEXT_DESC_LENGTH + CDCSHELL_DESC_LENGTH)
Expand Down
Loading

0 comments on commit f9c3506

Please sign in to comment.