![GitHub](https://img.shields.io/github/license/vanvught/GD32F407RE-Bootloader-TFTP)
[![C++ Standard](https://img.shields.io/badge/C%2B%2B-11-blue.svg)](https://img.shields.io/badge/C%2B%2B-11%-blue.svg)
![GitHub issues](https://img.shields.io/github/issues-raw/vanvught/GD32F407RE-Bootloader-TFTP)
![GitHub contributors](https://img.shields.io/github/contributors/vanvught/GD32F407RE-Bootloader-TFTP)
![GitHub Sponsors](https://img.shields.io/github/sponsors/vanvught)
![Main](https://github.com/vanvught/GD32F407RE-Bootloader-TFTP/actions/workflows/c-cpp.yml/badge.svg?branch=main)
[PayPal.Me Donate](https://paypal.me/AvanVught?locale.x=nl_NL)
# GD32F407RE Bootloader TFTP
This bootloader will install your application by means of the TFTP protocol. There is no need to change your application code.
Per default DHCP is used for obtaining the ip-address.
The bootloader is active during reset of the board:
* When the `KEY_BOOTLOADER_TFTP_GPIO_PINx` is pressed. Which is defined in file:
* lib-gd32/include/board/bw_opidmx4.h
* lib-gd32/include/board/dmx4.h
* lib-gd32/include/board/gd32f407r.h
* When `bkp_data_read(BKP_DATA_1) == 0xA5A5`. This is set in your application by means of human readable UDP messages. See for more information: [https://www.gd32-dmx.org/bootloader.html](https://www.gd32-dmx.org/bootloader.html). There is also a sample Java UI application available for working with the UDP messages: [https://github.com/vanvught/GD32F-Firmware-Update-UI](https://github.com/vanvught/GD32F-Firmware-Update-UI)
Otherwise the bootloader will directly jump to your application. With the snippet:
// 8. Call the reset handler
const uint32_t* reset_p = (uint32_t *)(FLASH_BASE + OFFSET_UIMAGE + 4);
asm volatile ("bx %0;" : : "r"(*reset_p));
The bootloader can be installed with the tools supplied by GigaDevice -> [http://www.gd32mcu.com/en/download/7?kw=GD32F4](http://www.gd32mcu.com/en/download/7?kw=GD32F4)
The limitation for the firmware file to be uploaded is given by the RAM available. For example, the MCU on [https://github.com/vanvught/GD32FxxR-dev-board](https://github.com/vanvught/GD32FxxxR-dev-board) is the [GD32F407RE](https://www.gigadevice.com/microcontroller/gd32f407re6/). With the 128K RAM we have the firmware file size limit of 106K.
See also [https://www.gd32-dmx.org/bootloader.html](https://www.gd32-dmx.org/bootloader.html)
File: `flashcodeinstall.h`
# elif defined (BOARD_GD32F407RE)
# define OFFSET_UIMAGE 0x008000 // 32K
# define FIRMWARE_MAX_SIZE (106 * 1024) // 106K
# elif defined (BOARD_BW_OPIDMX4)
# define OFFSET_UIMAGE 0x008000 // 32K
# define FIRMWARE_MAX_SIZE (106 * 1024) // 106K
# elif defined (BOARD_DMX4)
# define OFFSET_UIMAGE 0x008000 // 32K
# define FIRMWARE_MAX_SIZE (106 * 1024) // 106K
The change to be made in your build configuration is in the file `gd32f407re_flash.ld `.
MEMORY
{
FLASH (rx) : ORIGIN = 0x08008000, LENGTH = 106K
TCMSRAM (rw) : ORIGIN = 0x10000000, LENGTH = 64K
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
RAMADD (xrw) : ORIGIN = 0x20030000, LENGTH = 0
BKPSRAM (rw) : ORIGIN = 0x40024000, LENGTH = 4K
}
The `FLASH ORIGIN` must match the `OFFSET_UIMAGE` from the bootloader file `flashcodeinstall.h`
The code for the bootloader is a fork from [https://github.com/vanvught/rpidmx512](https://github.com/vanvught/rpidmx512). In order to reduce the memory footprint, some functions are not available.
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
Bootloader_with_TFTP_Server_GD32F407RE-Bootloader-TFTP.zip (472个子文件)
algorithm 2KB
gd32f4xx_enet.c 149KB
gd32f4xx_timer.c 87KB
gd32f4xx_exmc.c 56KB
gd32f4xx_rcu.c 49KB
gd32f4xx_adc.c 49KB
gd32f4xx_rtc.c 46KB
gd32f4xx_can.c 40KB
gd32f4xx_dma.c 36KB
gd32f4xx_usart.c 34KB
gd32f4xx_fmc.c 31KB
gd32f4xx_spi.c 29KB
gd32f4xx_i2c.c 28KB
system_gd32f4xx.c 28KB
gd32f4xx_sdio.c 28KB
gd32f4xx_ipa.c 26KB
gd32f4xx_tli.c 24KB
gd32f4xx_dac.c 20KB
gd32f4xx_gpio.c 15KB
gd32f4xx_ctc.c 13KB
gd32f4xx_pmu.c 11KB
gd32f4xx_dci.c 10KB
printf.c 10KB
gd32f4xx_dbg.c 8KB
gd32f4xx_exti.c 8KB
console.c 8KB
gd32f4xx_syscfg.c 8KB
console.c 7KB
gd32f4xx_misc.c 7KB
malloc.c 6KB
gd32f4xx_fwdgt.c 5KB
gd32_uart0.c 5KB
gd32f4xx_wwdgt.c 5KB
gd32f4xx_trng.c 5KB
gd32f4xx_crc.c 4KB
strtok.c 4KB
gd32f4xx_iref.c 4KB
time.c 3KB
console.c 3KB
time.c 2KB
udp_send.c 2KB
assert.c 2KB
debug_dump.c 2KB
inet_aton.c 2KB
asctime.c 2KB
gd32_uart0.c 2KB
gd32_uart0.c 2KB
net.c 2KB
console.c 2KB
debug_print_bits.c 2KB
systick.c 2KB
random.c 2KB
puts.c 1KB
putchar.c 1KB
memset.c 958B
memmove.c 283B
memcpy.c 219B
cassert 1KB
cctype 1KB
cmath 1KB
lcd_font.cpp 52KB
tcp.cpp 32KB
remoteconfig.cpp 31KB
ssd1306.cpp 19KB
fmc_operation.cpp 14KB
dhcp.cpp 11KB
gd32_uart.cpp 11KB
network.cpp 10KB
spi_flash.cpp 9KB
tftpdaemon.cpp 9KB
ssd1311.cpp 9KB
configstore.cpp 9KB
igmp.cpp 9KB
networkparams.cpp 8KB
emac.cpp 8KB
hwclockrtc.cpp 8KB
udp.cpp 8KB
hd44780.cpp 8KB
hardware.cpp 7KB
gd32_i2c.cpp 7KB
arp.cpp 7KB
flashcode.cpp 7KB
remoteconfigstatic.cpp 6KB
net_phy.cpp 6KB
remoteconfigparams.cpp 6KB
gd32_spi_dma_i2s.cpp 6KB
paint.cpp 6KB
net.cpp 6KB
gd32_spi.cpp 6KB
hardware.cpp 5KB
remoteconfigjson.cpp 5KB
ili9341.cpp 5KB
display.cpp 5KB
main.cpp 5KB
usb_host_msc.cpp 4KB
flashcode.cpp 4KB
net_phy.cpp 4KB
i2s_psc_config_dump.cpp 4KB
hwclock.cpp 4KB
gd32_adc.cpp 4KB
共 472 条
- 1
- 2
- 3
- 4
- 5
资源评论
好家伙VCC
- 粉丝: 1934
- 资源: 9137
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功