Repository navigation
Releases: vanvught/GD32F107RC-Bootloader-TFTP
Release list
V3.0
TFTP Bootloader Release Notes
This release contains a broad update of the shared GD32 firmware libraries and TFTP bootloader targets.
The main focus has been on consolidating common GD32 functionality, simplifying platform-specific code, improving Ethernet PHY link handling, and making the firmware and flashing workflow more consistent across the supported GD32 families.
The bootloader projects for GD32F10x, GD32F20x, GD32F4xx and GD32H7xx have been updated to use the revised shared libraries.
Highlights
- Added a Windows flash.cmd wrapper for the Python GD32 flashing utility. It automatically locates Python, creates a virtual environment when required, installs pyserial, and runs the flashing tool.
- Improved bootloader safety by detecting an empty application image before attempting to start it.
- Consolidated GD32 timer, delay and uptime functionality.
- Moved GD32 internal flash/FMC operations into the common GD32 library.
- Refactored Ethernet PHY link detection and link-state handling.
- Modernized flash and storage interfaces using C++ namespaces and std::span.
- Improved build-time selection of GD32 MCU capabilities, time sources, Ethernet options and PHY configuration.
- Numerous consistency, debug, const-correctness and conditional-compilation cleanups.
Library Overview
lib-gd32
The GD32 hardware support library received the largest update.
Timer, SysTick, delay and uptime implementations have been consolidated into the gd32_timers interface, providing common microsecond, millisecond and uptime functionality.
Internal FMC flash support has been moved into this library behind the shared gd32::fmc API, with family-specific implementations where required.
GPIO helpers and GD32-specific debug support have been reorganized, MCU capability definitions and device mappings have been updated, and several low-level platform and timer edge cases have been corrected.
lib-flashcode
GD32 flash programming now uses the shared gd32::fmc implementation from lib-gd32 instead of maintaining separate FMC implementations inside the flashcode library.
Flash read, write and erase paths received additional range, alignment and state checks. The flash/storage interfaces were also updated to use std::span where appropriate.
lib-emac / network
Ethernet PHY link handling has been consolidated into the PHY layer.
Link initialization, polling and interrupt-driven link detection now share a common implementation. PHY address and status handling have been centralized, and MAC link configuration is performed only after a valid link and completed auto-negotiation are detected.
Ethernet timing and debug output were also updated to use the new GD32 timer API.
lib-spiflash
The SPI flash interface has been modernized from the older C-style API to the C++ spi::flash and spi::flash::cmd namespaces.
Constants now follow the common naming conventions, flash operation timeouts use millisecond timing, and probe/read/write/erase call sites have been updated accordingly.
lib-configstore / storage
Flash and configuration storage paths were updated to use the revised flash interfaces and std::span.
Long-running flash operations have improved timeout/watchdog handling, and several debug and boundary checks were cleaned up.
lib-hal
I2C interfaces received const-correctness and API cleanup. The AT24Cxx EEPROM support was simplified and dedicated AT24C02 and AT24C16 convenience classes were added.
lib-remoteconfig / JSON
Remote configuration JSON output now performs additional validation of output buffers.
Shared parsing and utility functions are used in more places, reducing duplicated string/number parsing code.
Common utilities
Shared utility code has been reorganized and simplified.
Common math, floating-point, string, bitfield and unit helpers are now used instead of local or duplicated implementations. The custom include/algorithm replacement was removed.
A shared common::kUndefined value replaces duplicated "Undefined" strings across several protocol libraries.
Debug helpers were also improved, including more consistent configuration flags, I2C detection control and generalized bit-dump formatting.
Build System
The GD32 build configuration has been cleaned up and made more consistent across MCU families.
MCU capability definitions, PHY selection, Ethernet link-check configuration and time-source selection are now handled more centrally. Device mappings were corrected and expanded, and several bootloader targets now use the common GD32 makefile and linker-script structure.
Supported Bootloader Targets
The changes have been propagated across the GD32F107RC, GD32F207RG, GD32207C-EVAL, GD32F407RE, GD32F450VI, GD32F470VG and GD32H759I-EVAL TFTP bootloader projects.
V2.4
This release focuses on modernizing the codebase while preparing it for future development with GCC 15, Link Time Optimization (LTO), and C++23. The main themes are improved build infrastructure, centralized debug configuration, cleaner C++ code, enhanced type safety, and numerous maintenance and formatting improvements across the project.
Highlights
- Added full Link Time Optimization (LTO) support across firmware and libraries.
- Centralized debug configuration with compile-time control and per-module logging.
- Improved build system and linker configuration.
- Continued migration toward modern C++ coding practices.
- Reduced compiler warnings and improved type safety.
- General code cleanup, formatting consistency, and maintainability improvements.
Build System
- Added shared linker configuration.
- Enabled LTO for firmware and libraries.
- Updated toolchain to use gcc, gcc-ar, gcc-ranlib, and gcc-nm.
- Improved linker scripts and binary generation.
- Excluded RAM-only sections from generated binary images.
Debug
- Introduced centralized debug configuration.
- Replaced scattered NDEBUG handling with compile-time configuration.
- Added per-module debug headers and logging.
- Migrated debug location reporting to std::source_location.
- Improved debug dump and bit-print utilities.
- Renamed stack debug configuration to CONFIG_DEBUG_STACK.
Common / Runtime
- Added printf format attributes.
- Added strnlen.
- Moved optimized memset implementation into its own translation unit.
- Removed obsolete custom new header.
- Updated project contact information.
- General header cleanup and modernization.
Network
- Improved type safety by replacing C-style casts with static_cast.
- Replaced NULL checks with nullptr.
- Fixed numerous printf format warnings.
- Cleaned up IGMP, TCP, UDP and IP utility implementations.
- Minor NTP client formatting improvements.
Flash
- Improved flash programming implementation consistency.
- Fixed flash size logging format specifiers.
- Initialized DMA configuration structures before use.
- Cleaned up GD32 flash code implementation and internal state naming.
Storage
- Cleaned up StoreDevice implementations.
- Reduced unnecessary debug output.
- Improved formatting consistency.
Status LED
- Added API to query the status LED lock state.
- Modernized implementation and initialization.
Software Timers
- Improved API naming and readability.
- Internal cleanup without functional changes.
General
- Improved const correctness.
- Added [[nodiscard]] where appropriate.
- Improved formatting consistency throughout the codebase.
- Applied numerous small refactorings and maintenance improvements with no functional changes.
V2.3
Release Notes
- Refactor network and protocol enums, namespaces, and constants
- Add Python utilities for GD32 workflows: do-tftp.py (TFTP orchestration), flash.py (serial flasher/monitor), and udp_send.py (UDP send/recv module). Replace old shell scripts and legacy udp_send C project files with these Python implementations and add /common/scripts/gd32/venv to .gitignore.
- Codebase cleanups and tweaks: update copyright years to 2026 across several files; replace bare assert(0) with assert(false && "...") including explanatory messages; small header/include reorganizations; DMA memcpy changes (alignment checks for GD32F4, conditional IRQ enabling via DMA_MEMCPY32_DISABLE_IRQ); minor formatting and whitespace fixes.
-Build/script changes: simplify scripts/build_all.sh (use env bash, remove platform CPU detection and redundant -j flags), and remove deprecated scripts/setup.sh and scripts/do-tftp.sh along with Eclipse project artifacts for udp_send.
These changes add cross-platform Python tooling, improve diagnostics on invalid cases, and clean up legacy build/script artifacts.
V2.2
Release Notes – Codebase Refactor & Modularization
- Major project restructuring
- Reorganized libraries and source files into a clearer, more modular directory structure.
- Moved, renamed, or removed numerous files to reduce duplication and improve maintainability.
- Legacy code cleanup
- Removed deprecated and unused code from lib-lightset, lib-network, lib-properties, and older display components.
- Eliminated redundant parameter and platform-specific files no longer in use.
- Centralized common functionality
- Migrated shared network, properties, and parameter code into a unified common directory.
- Added new utility headers and source files for reusable functionality.
- JSON-based configuration support
- Added new JSON configuration and parameter files.
- Introduced JSON helper utilities and parameter classes to standardize configuration handling and prepare for future extensibility.
- DMX, RDM, and pixel refactor
- Refactored DMX, RDM device handling, and pixel-related libraries for clearer structure and better separation of responsibilities.
- Unified RDM device information handling.
- Build system updates
- Updated Makefiles, build scripts, and compile_commands.json to reflect the new project structure.
- Improved GD32 platform support and hardware abstraction organization.
- Network stack reorganization
- Flattened lib-network source layout by moving files from subdirectories into a simpler structure.
- Improved clarity of EMAC and Linux network interface implementations (no functional changes).
- Debug macro consistency
- Replaced DEBUG_ENTRY / DEBUG_EXIT macros with function-style DEBUG_ENTRY() / DEBUG_EXIT() across the codebase for consistency and readability.
- Overall impact
- Significantly improved modularity, readability, and long-term maintainability.
- Laid groundwork for future feature expansion and more robust JSON-based configuration across modules.
V2.1
- Improved startup_gd32fxxx.S
- CMSIS has its own project now
- Upgraded to CMSIS V5.0.5
- Removed lib-debug. Now part of lib-hal
- Updated to latest GD32 Firmware
- Introduced debug software UART0
- Major cleanup lib-configstore
- In order to support Newlib; removed lib-c, lib-c++ and added lib-clib
- In order to support FreeRTOS; Added Software timers in H.A.L. framework.
- Major update network stack. Added support for RFC 5227 and RFC 3927
V2.0
- Improved build system
- Added stack debug framework
- Removed not used source files
- Added support for void __libc_init_array(void)
- Changed the layout of the config store.
- Before upgrading the firmware it is advised to make a backup of the configuration.
- After the upgrade, then restore the saved configuration.