risc-v/gd32vw55x: add GigaDevice GD32VW553 port (Wi-Fi 6)#19445
Merged
Conversation
JorgeGzm
requested review from
acassis,
anchao,
davids5,
eren-terzioglu,
jerpelea,
johannes-nivus,
lupyuen,
pussuw and
raiden00pl
as code owners
July 15, 2026 16:46
linguini1
previously requested changes
Jul 15, 2026
linguini1
left a comment
Contributor
There was a problem hiding this comment.
Can you please attach some logs from your testing of the WiFi, BLE and other peripherals? And an OSTest log for the new board?
xiaoxiang781216
previously approved these changes
Jul 15, 2026
JorgeGzm
marked this pull request as draft
July 15, 2026 21:06
Contributor
Author
|
I made a rebase with the master and the wifi and ble broke, i revising all. The intention is to submit this PR is send a a functional and fully tested version. |
Contributor
Author
|
All tested and fixed!! |
jerpelea
approved these changes
Jul 16, 2026
New RISC-V chip port for the GigaDevice GD32VW55x (Nuclei N307, Wi-Fi 6 and BLE 5.3 combo), with the GD32VW553K-START board. Core: - ECLIC interrupt controller, clock tree (160 MHz / 40 MHz HXTAL), 64-bit machine timer, serial (USART0/UART1/UART2) and RTC. - The instruction cache must be enabled in head.S or the UART drops characters under load; the mask ROM uses the first 0x200 bytes of SRAM so the image is linked at 0x20000200; the RTC needs PMU_CTL0.BKPWEN or the register writes are silently discarded. - The ECLIC only auto-clears the interrupt pending bit in hardware-vectored mode, so the trap dispatch clears it for edge-triggered sources or they re-fire forever (level-triggered peripherals clear their own). Peripherals: DMA (8 channels), GPIO + EXTI, SPI (optional DMA), I2C0/I2C1 (the new STM32-v2-style IP, not the GD32F4 one), ADC, PWM and input capture on the timers, both watchdogs, PROGMEM, TRNG and CRC. All use the standard NuttX lower-half interfaces and direct register access, not the vendor SPL. Three user LEDs (GPIOC), and a software reset through the Nuclei SysTimer. Internal flash: it is a system-in-package NOR die behind the real-time decryption block, so it is not programmed through the FMC registers -- the driver goes through the mask ROM API (rom_flash_*), the same way the vendor code does. PROGMEM can be mounted as LittleFS; the region sits below the Wi-Fi NVDS and must not overlap it. Wi-Fi (wlan0), station and softAP: - The MAC/PHY, RF and WPA supplicant are linked as prebuilt BSD-3 libraries. They are RTOS-agnostic, so the OS binding is a sys_* facade on NuttX primitives (gdwifi/wrapper_nuttx.c). Critical sections mask by ECLIC priority threshold, not by disabling every interrupt, or the MAC misses its microsecond deadlines. - The lwIP stack of the SDK is not used: the interface is a netdev_lowerhalf driver driven by the standard tools (wapi, ifup, renew, ping, dhcpd). EAPOL is handed to the supplicant instead of the IP stack. The lowerhalf "priority" field is the work-queue id (HPWORK/ LPWORK), not a task priority -- a wrong value makes receive() never run and every packet is dropped. - The vendor gives the radio 32 KB of shared SRAM as an extra heap; this needs CONFIG_MM_REGIONS >= 2 or the kernel silently drops the region. - The DHCP client needs CONFIG_NETUTILS_DHCPC_BOOTP_FLAGS=0x8000 so the server answers the OFFER by broadcast. - softAP (wapi master mode -> wifi_management_ap_start): the single-VIF firmware does station or AP at a time. Use WPA2, not WPA3: the SAE handshake is deep on the stack and overflows the elliptic-curve crypto with the default task stacks, so the Wi-Fi configs raise CONFIG_INIT_STACKSIZE/DEFAULT_TASK_STACKSIZE. Vendor SDK: cloned by the build at "context" time, pinned to a validated commit and patched in place -- so CI can build with nothing preinstalled, the same pattern as esp-hal-3rdparty. The prebuilt libraries are built for the hard-float ilp32f ABI. BLE 5.3, marked EXPERIMENTAL and off by default: the prebuilt libble is an all-in-one controller plus RivieraWaves host (GAP/GATT/SMP inside the blob) with no HCI transport, so the port drives the vendor host directly (ble_adp_*, ble_adv_*, ble_gap_*) instead of registering a bt_driver_s. The SDK's radio interrupt handlers must be attached to the NuttX IRQ table (they are reached through the ECLIC hardware vector table in the vendor build); attaching also keeps --gc-sections from dropping them. It ships with no configuration; enabling it advertises as "NuttX", connectable. Boards: gd32vw553k-start with nsh, wapi, sta_softap, periph and littlefs configurations, and the board added to the CI build list. Tested on hardware (GD32VW553K-START): NSH, the peripheral drivers (TRNG entropy and the LEDs exercised), LittleFS (write, read, survives a reboot), the full Wi-Fi station path (scan, WPA2, DHCP, ping to the internet), the softAP (a client associates with WPA2, gets an address from the board's DHCP server, and pings the board), and BLE (advertises as "NuttX"; a central connects and enumerates the GATT database). Assisted-by: Claude Opus 4.8 Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
acassis
approved these changes
Jul 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
New RISC-V chip port for the GigaDevice GD32VW55x (Nuclei N307, Wi-Fi 6 + BLE 5.3) and the GD32VW553K-START board. The radio comes from the prebuilt vendor libraries behind a thin sys_* facade; the SDK is cloned and pinned at build time (same pattern as esp-hal-3rdparty). Everything that touches hardware registers is a native NuttX driver.
HAL drivers: serial, DMA, GPIO/EXTI, SPI, I2C, ADC, PWM, input capture, FWDGT and WWDGT watchdogs, PROGMEM (internal flash via the mask ROM API), TRNG, CRC, RTC, plus board LEDs and software reset. Wi-Fi (wlan0, station and softAP) is a netdev_lowerhalf driver on the NuttX network stack. BLE 5.3 is present but EXPERIMENTAL and off by default.
Full details are in the new documentation under Documentation/platforms/risc-v/gd32vw55x/.
Impact
New arch/chip and board; no existing code is changed. The Wi-Fi/BLE configurations need the vendor SDK (fetched at build time); nsh and periph build without it.
Testing
Build host: Linux,
riscv-none-elf-gcc14.2.0.All seven configurations build,
nxstyleis clean, and the docs build withoutwarnings.
nshandperiphbuild without the vendor SDK; the Wi-Fi/BLEconfigurations fetch it at build time.
Build and flash (per configuration):
Validated on hardware (GD32VW553K-START, console on the GD-Link VCP,
115200 8N1). Verbatim console output below; MAC/BSSID addresses are the only
redaction (
XX:XX:XX:XX:XX:XX), and the Wi-Fi passphrase is masked.nsh
periph
littlefs
LittleFS is auto-mounted at
/data; a file is written, read back, andsurvives a
reboot.wapi - Wi-Fi station
sta_softap - Wi-Fi softAP
Board side: the board becomes the
nuttxwifiAP at 10.0.0.1 and starts a DHCPserver.
A laptop joins
nuttxwifiand the board's DHCP server leases it 10.0.0.2:The board pings the leased client:
ble (EXPERIMENTAL)
wapiplus BLE and the demo GATT service. The board advertisesNuttXandregisters a "transparent UART" service (16-bit UUIDs
0xffe0/ RX0xffe1/TX
0xffe2). A central connects, discovers the service, and a write to the RXcharacteristic is received on the board console.
Host side (bleak):
Board console:
ostest
The OS test suite runs to completion (every sub-test reports
nerrors=0and itends with
ostest_main: Exiting with status 0). Therr_testprime workloadmakes the full run take a couple of minutes on this core.