Skip to content

Commit 7d0c2a4

Browse files
committed
doc/boards: Add Documentation to GD32VW553-HMQ board
This PR adds Documentatio to GD32VM553-HMQ board. Signed-off-by: Alan C. Assis <acassis@gmail.com>
1 parent 0a24c1a commit 7d0c2a4

2 files changed

Lines changed: 254 additions & 0 deletions

File tree

164 KB
Loading
Lines changed: 254 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,254 @@
1+
=============
2+
GD32VW553-HMQ
3+
=============
4+
5+
The GD32VW553-HMQ is the generic evaluation board for the GD32VW553HMQ6
6+
(Nuclei N307, Wi-Fi 6 + BLE 5.3). It carries an on-board USB/Serial port
7+
provides the USB serial console.
8+
9+
.. figure:: gd35vw553-hmq.png
10+
:align: center
11+
:width: 500px
12+
13+
The GD32VW553-HMQ board.
14+
15+
Features
16+
========
17+
18+
- GD32VW553HMQ (QFN40, 4096 KB flash,
19+
320 KB SRAM) and a PCB antenna
20+
- USB/Serial COM port over the USB Type-C connector
21+
- One LED on PC13
22+
- BOOT0/BOOT1 buttons, a power jumper and a reset button (NRST)
23+
24+
Serial Console
25+
==============
26+
27+
The console is UART0 (PB15 TX / PA8 RX), wired to the USB/Serial port.
28+
It shows up on the host as ``/dev/ttyUSB0`` at 115200 8N1.
29+
30+
LEDs
31+
====
32+
33+
One LED sit on GPIO PC13 and is driven push-pull, active HIGH.
34+
35+
====== ==== =========================================
36+
LED Pin Meaning in the vendor SDK
37+
====== ==== =========================================
38+
LED1 PC13 CPU running
39+
====== ==== =========================================
40+
41+
With ``CONFIG_USERLED`` they belong to the application and are exposed as
42+
``/dev/userleds``. With ``CONFIG_ARCH_LEDS`` the OS takes them over instead
43+
and uses them to show its state: LED1 comes on once NuttX has started.
44+
45+
Flashing
46+
========
47+
48+
The board is programmed with OpenOCD through a JTAG Probe. The GigaDevice
49+
OpenOCD fork (shipped with the vendor SDK) is required::
50+
51+
$ openocd -f openocd_gdlink.cfg \
52+
-c "program nuttx.bin 0x08000000 verify reset exit"
53+
54+
NuttX is linked at 0x08000000, bypassing the vendor MBL bootloader.
55+
56+
.. note::
57+
The chip mask ROM uses the first 0x200 bytes of SRAM. The linker script
58+
starts the application at 0x20000200 for that reason; do not move it.
59+
60+
If you prefer to use JLink, you wire this way:
61+
62+
========= =====================
63+
JLink Pin GD32VW553 board Pin
64+
========= =====================
65+
1 Vref 3V3
66+
5 TDI DI
67+
7 TMS MS
68+
9 TCK CK
69+
13 TDO DO
70+
15 RESET RST
71+
25 GND GND
72+
========= =====================
73+
74+
You can run JLinkExe on Linux this way::
75+
76+
$ sudo JLinkExe -if jtag
77+
J-Link> connect
78+
Device position in JTAG chain (IRPre,DRPre) <Default>: -1,-1 => Auto-detect
79+
JTAGConf>
80+
Specify target interface speed [kHz]. <Default>: 4000 kHz
81+
Speed>
82+
The selected device "GD32VW533HMQ6" is unknown to this software version.
83+
Device "GD32VW553HMQ6" selected.
84+
J-Link> loadbin nuttx.hex, 0
85+
86+
Flash layout
87+
============
88+
89+
The full map is in the :doc:`chip documentation <../../index>`. What matters
90+
when flashing this board:
91+
92+
======================== ============== ====================================
93+
Range Size Purpose
94+
======================== ============== ====================================
95+
0x08000000 -- 0x083db000 3948 KiB Available to the firmware. This is
96+
what the linker script gives out;
97+
overflowing it is a link error
98+
0x083db000 -- 0x083fb000 128 KiB progmem / LittleFS
99+
0x083fb000 -- 0x08400000 20 KiB **Wi-Fi NVDS** -- do not erase
100+
======================== ============== ====================================
101+
102+
For reference, the configurations use a small part of that budget: ``nsh``
103+
135 KiB (3%), ``wifi`` 610 KiB (15%) and ``sta_softap`` 613 KiB (16%).
104+
The ``ble`` config (BLE on top of ``wifi``) brings the image to about 971 KiB (25%).
105+
106+
.. warning::
107+
The **last** pages of the flash are not free: the Wi-Fi NVDS holds the RF
108+
calibration data and the MAC address, and erasing it breaks the radio. The
109+
progmem region ends exactly where the NVDS begins.
110+
111+
The region handed to progmem is set with
112+
``CONFIG_GD32VW55X_PROGMEM_START_ADDR`` and ``CONFIG_GD32VW55X_PROGMEM_SIZE``;
113+
nothing outside it is ever erased or written.
114+
115+
Configurations
116+
==============
117+
118+
Each configuration is built with::
119+
120+
$ ./tools/configure.sh gd32vw553k-start:<config>
121+
$ make
122+
123+
nsh
124+
---
125+
126+
Basic NuttShell configuration over the UART2 console. No radio.
127+
128+
wifi
129+
----
130+
131+
NSH plus the Wi-Fi station support. The interface is registered as ``wlan0``
132+
with the MAC address read from the chip eFuse, and is driven with the standard
133+
network tools::
134+
135+
nsh> wapi scan wlan0
136+
nsh> wapi psk wlan0 <passphrase> 3
137+
nsh> wapi essid wlan0 <ssid> 1
138+
nsh> ifup wlan0
139+
nsh> renew wlan0
140+
nsh> ifconfig
141+
nsh> ping 8.8.8.8
142+
143+
.. note::
144+
Use ``ifup wlan0``, not ``ifconfig wlan0 up``: ``ifconfig`` interprets its
145+
second argument as an IP address.
146+
147+
.. note::
148+
The station is WPA2-only. A WPA3-transition network (WPA2/WPA3 mixed
149+
mode) associates through WPA2-PSK; a WPA3(SAE)-only network is refused
150+
up front with ``ENOTSUP`` and a console message naming the unsupported
151+
AKM, instead of letting the prebuilt supplicant attempt the SAE
152+
handshake (which faults).
153+
154+
The RTC and the SNTP client are enabled, so the clock can be set from the
155+
network::
156+
157+
nsh> ntpcstart
158+
nsh> date
159+
160+
sta_softap
161+
----------
162+
163+
NSH plus the Wi-Fi softAP: the board becomes an access point and a DHCP server.
164+
The single-VIF firmware does station *or* AP at a time (not both at once), so
165+
this is a softAP, not the simultaneous STA+AP of some other parts.
166+
167+
Bring it up with the standard tools::
168+
169+
nsh> wapi mode wlan0 3 # 3 = master (softAP)
170+
nsh> wapi psk wlan0 12345678 3 # WPA2-PSK
171+
nsh> wapi essid wlan0 nuttxwifi 1 # start the AP
172+
nsh> dhcpd_start wlan0 # DHCP server, in the background
173+
174+
A client then sees ``nuttxwifi``, associates with WPA2, and gets an address
175+
from the 10.0.0.0/24 pool (the AP is 10.0.0.1).
176+
177+
.. note::
178+
Use WPA2, not WPA3. The SAE (WPA3) handshake on the AP side is deep on the
179+
stack; with the default task stacks it overflows inside the elliptic-curve
180+
crypto and faults. This configuration raises ``CONFIG_INIT_STACKSIZE`` to
181+
8192 and ``CONFIG_DEFAULT_TASK_STACKSIZE`` to 4096 for the same reason -- the
182+
radio tasks need the headroom.
183+
184+
.. note::
185+
``dhcpd_start`` spawns the server as a background task and returns. The
186+
plain ``dhcpd`` command, confusingly, runs the server *blocking* in the
187+
foreground.
188+
189+
ble
190+
---
191+
192+
``wapi`` plus BLE (``CONFIG_GD32VW55X_BLE``) and the demo GATT service
193+
(``CONFIG_GD32VW55X_BLE_GATT_DEMO``). The board advertises a connectable set
194+
named ``NuttX`` and registers a minimal "transparent UART" service (16-bit
195+
UUIDs ``0xffe0`` / RX ``0xffe1`` / TX ``0xffe2``). Advertising restarts on
196+
every disconnection, so the device stays discoverable across connections. A
197+
central connects, discovers the service, and a write to the RX characteristic
198+
is logged on the board console::
199+
200+
nsh> BLE RX (11): Hello world
201+
202+
.. note::
203+
The central -> board write is exercised with a write command
204+
(write-without-response), which is reliable. The prebuilt vendor
205+
controller does not complete a write-request (write-with-response) or the
206+
CCCD subscribe issued by a Linux BlueZ host, so the TX **notification** echo
207+
(board -> central) is best exercised from a phone app such as nRF Connect.
208+
This is why BLE keeps ``CONFIG_EXPERIMENTAL``.
209+
210+
ostest
211+
------
212+
213+
``nsh`` plus the NuttX OS test suite (``CONFIG_TESTING_OSTEST``). Run it from
214+
the shell to exercise the scheduler, synchronisation primitives and the FPU
215+
context switch::
216+
217+
nsh> ostest
218+
...
219+
ostest_main: Exiting with status 0
220+
221+
The ``rr_test`` (round-robin with a 30000-prime workload) makes the full run
222+
take a couple of minutes on this core; every sub-test reports ``nerrors=0``.
223+
224+
Status
225+
======
226+
227+
All seven configurations were validated on hardware:
228+
229+
- ``nsh``: boots, console, heap and task list are healthy.
230+
- ``wifi``: full station path over a live AP -- ``wapi scan`` lists the nearby
231+
networks, WPA2 associates through the four-way handshake, DHCP obtains an
232+
address, and ``ping`` reaches the internet.
233+
- ``sta_softap``: the board's own AP -- a client sees the SSID, associates with
234+
WPA2, gets an address from the board's DHCP server, and pings the board.
235+
- ``ble``: advertises ``NuttX``, a central connects, the demo GATT service
236+
enumerates, and a write to the RX characteristic is received on the board
237+
console (central -> board).
238+
- ``ostest``: the OS test suite runs to completion (every sub-test reports
239+
``nerrors=0`` and it ends with ``ostest_main: Exiting with status 0``).
240+
241+
BLE (``CONFIG_GD32VW55X_BLE``) is marked EXPERIMENTAL and off by default. The
242+
prebuilt ``libble`` is an all-in-one controller plus RivieraWaves host with no
243+
HCI transport, so the port drives the vendor host directly (it does not
244+
register a NuttX ``bt_driver_s``). The ``ble`` configuration enables it along
245+
with a demo GATT service; see that section above for what is validated and the
246+
notification caveat. A reusable test tool for this is kept with the
247+
out-of-tree port notes.
248+
249+
.. note::
250+
``CONFIG_ARCH_LEDS`` must stay off on this board. With the OS driving the
251+
LEDs, the serial console dies in the Wi-Fi configurations (the console UART
252+
shares the work queue path); the LEDs belong to the application
253+
(``CONFIG_USERLED``), and every defconfig here disables ``ARCH_LEDS``
254+
explicitly.

0 commit comments

Comments
 (0)