This is an automated email from the ASF dual-hosted git repository.
acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new e523fad73eb risc-v/gd32vw55x: fix what the docs say about the NVDS
e523fad73eb is described below
commit e523fad73ebb23cb0ec68b31a3d5b3a97c77280b
Author: Jorge Guzman <[email protected]>
AuthorDate: Sun Oct 18 11:31:13 2026 -0300
risc-v/gd32vw55x: fix what the docs say about the NVDS
The NVDS at the top of the flash holds the BLE bonding data, not the RF
calibration or the MAC address: the radio reads those from the EFUSE.
Fix the docs, Kconfig help and comments, and drop the unused
GD32VW55X_WIFI_NVDS_PATH option.
Signed-off-by: Jorge Guzman <[email protected]>
Assisted-by: Claude Code:claude-opus-5-5
---
.../risc-v/gd32vw55x/boards/gd32vw553-hmq/index.rst | 11 ++++++-----
.../gd32vw55x/boards/gd32vw553k-start/index.rst | 21 ++++++++++-----------
Documentation/platforms/risc-v/gd32vw55x/index.rst | 20 ++++++++++++--------
arch/risc-v/src/gd32vw55x/Kconfig | 15 +++------------
arch/risc-v/src/gd32vw55x/gd32vw55x_progmem.c | 4 ++--
arch/risc-v/src/gd32vw55x/gd32vw55x_progmem.h | 4 ++--
.../gd32vw55x/gd32vw553-hmq/scripts/ld.script | 6 +++---
.../gd32vw55x/gd32vw553-hmq/src/gd32_bringup.c | 2 +-
.../gd32vw55x/gd32vw553k-start/scripts/ld.script | 6 +++---
.../gd32vw55x/gd32vw553k-start/src/gd32_bringup.c | 2 +-
10 files changed, 43 insertions(+), 48 deletions(-)
diff --git
a/Documentation/platforms/risc-v/gd32vw55x/boards/gd32vw553-hmq/index.rst
b/Documentation/platforms/risc-v/gd32vw55x/boards/gd32vw553-hmq/index.rst
index 1cc98c41309..f098d8ec527 100644
--- a/Documentation/platforms/risc-v/gd32vw55x/boards/gd32vw553-hmq/index.rst
+++ b/Documentation/platforms/risc-v/gd32vw55x/boards/gd32vw553-hmq/index.rst
@@ -98,17 +98,18 @@ Range Size Purpose
what the linker script gives out;
overflowing it is a link error
0x083db000 -- 0x083fb000 128 KiB progmem / LittleFS
-0x083fb000 -- 0x08400000 20 KiB **Wi-Fi NVDS** -- do not erase
+0x083fb000 -- 0x08400000 20 KiB NVDS (BLE bonding data)
======================== ============== ====================================
For reference, the configurations use a small part of that budget: ``nsh``
135 KiB (3%), ``wifi`` 610 KiB (15%) and ``sta_softap`` 613 KiB (16%).
The ``ble`` config (BLE on top of ``wifi``) brings the image to about 971 KiB
(25%).
-.. warning::
- The **last** pages of the flash are not free: the Wi-Fi NVDS holds the RF
- calibration data and the MAC address, and erasing it breaks the radio. The
- progmem region ends exactly where the NVDS begins.
+.. note::
+ The last 20 KiB of the flash hold the NVDS of the vendor stack, where the
+ BLE stack keeps its bonding data. The progmem region ends where the NVDS
+ begins. Erasing the NVDS only loses the BLE bonds: the RF calibration and
+ the MAC address come from the chip EFUSE.
The region handed to progmem is set with
``CONFIG_GD32VW55X_PROGMEM_START_ADDR`` and ``CONFIG_GD32VW55X_PROGMEM_SIZE``;
diff --git
a/Documentation/platforms/risc-v/gd32vw55x/boards/gd32vw553k-start/index.rst
b/Documentation/platforms/risc-v/gd32vw55x/boards/gd32vw553k-start/index.rst
index 8abdaf9bc0e..102fe33829b 100644
--- a/Documentation/platforms/risc-v/gd32vw55x/boards/gd32vw553k-start/index.rst
+++ b/Documentation/platforms/risc-v/gd32vw55x/boards/gd32vw553k-start/index.rst
@@ -131,7 +131,7 @@ Range Size Purpose
what the linker script gives out;
overflowing it is a link error
0x083db000 -- 0x083fb000 128 KiB progmem / LittleFS
-0x083fb000 -- 0x08400000 20 KiB **Wi-Fi NVDS** -- do not erase
+0x083fb000 -- 0x08400000 20 KiB NVDS (BLE bonding data)
======================== ============== ====================================
For reference, the configurations use a small part of that budget: ``nsh``
@@ -139,10 +139,11 @@ For reference, the configurations use a small part of
that budget: ``nsh``
610 KiB (15%) and ``sta_softap`` 613 KiB (16%). The ``ble`` config (BLE on top
of ``wapi``) brings the image to about 971 KiB (25%).
-.. warning::
- The **last** pages of the flash are not free: the Wi-Fi NVDS holds the RF
- calibration data and the MAC address, and erasing it breaks the radio. The
- progmem region ends exactly where the NVDS begins.
+.. note::
+ The last 20 KiB of the flash hold the NVDS of the vendor stack, where the
+ BLE stack keeps its bonding data. The progmem region ends where the NVDS
+ begins. Erasing the NVDS only loses the BLE bonds: the RF calibration and
+ the MAC address come from the chip EFUSE.
The region handed to progmem is set with
``CONFIG_GD32VW55X_PROGMEM_START_ADDR`` and ``CONFIG_GD32VW55X_PROGMEM_SIZE``;
@@ -339,7 +340,7 @@ The reported ``value`` is the 12-bit conversion (0..4095)
spanning 0..3.3 V; a
littlefs
--------
-NSH with the last 128 KiB of usable flash (below the Wi-Fi NVDS) exposed as an
+NSH with the last 128 KiB of usable flash (below the NVDS) exposed as an
MTD device, ``/dev/gd32flash``, and mounted as LittleFS on ``/data``.
.. note::
@@ -404,11 +405,9 @@ the next boot format it again::
$ openocd -f openocd_gdlink.cfg \
-c "init; halt; flash erase_address 0x083db000 0x20000; reset;
exit"
-.. warning::
- Erase only the progmem region. The Wi-Fi NVDS lives immediately above it,
- at 0x083fb000; wiping it takes the RF calibration and the MAC address with
- it. After using the filesystem, ``wapi scan wlan0`` in the ``wapi``
- configuration is a quick way to confirm the radio is still healthy.
+.. note::
+ Erase only the progmem region. The NVDS lives immediately above it, at
+ 0x083fb000, and holds the BLE bonding data.
sta_softap
----------
diff --git a/Documentation/platforms/risc-v/gd32vw55x/index.rst
b/Documentation/platforms/risc-v/gd32vw55x/index.rst
index 912c99eda62..77210512548 100644
--- a/Documentation/platforms/risc-v/gd32vw55x/index.rst
+++ b/Documentation/platforms/risc-v/gd32vw55x/index.rst
@@ -89,11 +89,12 @@ Region Range Size Purpose
============ =========================== =========
=============================
Flash 0x08000000 -- 0x08400000 4 MiB In-package NOR, XIP. Holds
the firmware and, at the
very
- top, the Wi-Fi NVDS
+ top, the vendor stack NVDS
Mask ROM 0x0bf40000 -- 0x0bf80000 256 KiB Boot ROM (IBL) and the ROM
API used to program the
flash
EFUSE 0x0ffc0000 -- 0x0ffc0100 256 B Chip data; the radio reads
- the MAC address from here
+ the MAC address and the RF
+ calibration from here
SRAM 0x20000000 -- 0x20050000 320 KiB See the split below
BLE RAM 0x21000000 -- 0x21010000 64 KiB Exchange memory of the BLE
controller
@@ -111,7 +112,7 @@ Flash
The NuttX image is linked at the start of the flash: the vendor MBL bootloader
is bypassed, so none of its partitions (system status, image slots) apply.
-Only one region of the flash is fixed by the silicon and its radio firmware:
+Only one region of the flash is fixed, by the vendor Wi-Fi/BLE stack:
======================== ========= ==========================================
Range Size Purpose
@@ -120,13 +121,16 @@ Range Size Purpose
whatever else the board decides to carve
out of it (progmem, a filesystem, an OTA
slot...)
-0x083fb000 -- 0x08400000 20 KiB **Wi-Fi NVDS**: RF calibration data and the
- MAC address. Erasing it breaks the radio
+0x083fb000 -- 0x08400000 20 KiB **NVDS** of the vendor stack: the BLE
+ bonding data. Erasing it only loses the
+ bonds
======================== ========= ==========================================
-.. warning::
- Never erase past 0x083fb000. ``wapi scan wlan0`` is the quickest way to
- confirm the radio is still healthy after touching the flash.
+.. note::
+ The RF calibration and the MAC address are not in the flash: the radio
+ reads them from the EFUSE, so erasing the whole flash does not break it.
+ Keep the firmware and progmem below 0x083fb000 anyway, or the BLE stack
+ and the application will overwrite each other.
How the 4076 KiB below the NVDS are split is a **board decision**, made in the
board's linker script and in ``CONFIG_GD32VW55X_PROGMEM_START_ADDR`` /
diff --git a/arch/risc-v/src/gd32vw55x/Kconfig
b/arch/risc-v/src/gd32vw55x/Kconfig
index 8d282a080d0..fa7b1db7fcb 100644
--- a/arch/risc-v/src/gd32vw55x/Kconfig
+++ b/arch/risc-v/src/gd32vw55x/Kconfig
@@ -186,7 +186,8 @@ config GD32VW55X_PROGMEM
interface.
Take care: the internal flash also holds the firmware itself and
- the Wi-Fi NVDS. Only the region configured below is touched.
+ the NVDS of the vendor stack. Only the region configured below
+ is touched.
config GD32VW55X_RNG
bool "True random number generator (TRNG)"
@@ -328,8 +329,7 @@ config GD32VW55X_PROGMEM_START_ADDR
written. Mind the two neighbours on a 4 MiB part:
0x08000000 the firmware itself
- 0x083fb000 the Wi-Fi NVDS (16 KiB): RF calibration and the
- MAC address. Erasing it breaks the radio.
+ 0x083fb000 the NVDS of the vendor stack (BLE bonding data).
The split of the flash below the NVDS is a board decision. The
default here is the one the GD32VW553K-START board uses: 128 KiB
@@ -499,15 +499,6 @@ config GD32VW55X_WIFI_MGMT_PRIORITY
above this; keep both below the BLE stack task when
coexistence is enabled.
-config GD32VW55X_WIFI_NVDS_PATH
- string "NVDS storage path"
- default "/data/wifi_nvds.bin"
- ---help---
- File backing the Non-Volatile Data Storage used by the RF
- calibration and MAC firmware (nvds_data_get/put/del). The
- vendor layout reserves 20 KB of flash; on NuttX it maps to a
- file on a mounted filesystem (e.g. littlefs over FMC progmem).
-
config GD32VW55X_WIFI_TX_HEADROOM
int
default 348
diff --git a/arch/risc-v/src/gd32vw55x/gd32vw55x_progmem.c
b/arch/risc-v/src/gd32vw55x/gd32vw55x_progmem.c
index 559b4f3193b..8a541461749 100644
--- a/arch/risc-v/src/gd32vw55x/gd32vw55x_progmem.c
+++ b/arch/risc-v/src/gd32vw55x/gd32vw55x_progmem.c
@@ -65,13 +65,13 @@
* NOR flash that is executed in place. It holds:
*
* - The running firmware image (NuttX is linked at 0x08000000),
- * - The vendor NVDS area used by the Wi-Fi/BLE stacks, and
- * - The RF/Wi-Fi trim (calibration) values programmed in the factory.
+ * - The vendor NVDS area, where the BLE stack keeps its bonding data.
*
* Only the region delimited by CONFIG_GD32VW55X_PROGMEM_START_ADDR and
* CONFIG_GD32VW55X_PROGMEM_SIZE is exposed here, and the board is
* responsible for making sure that this region does not overlap any of the
* above. Erasing or programming the wrong region is destructive.
+ * The RF calibration and the MAC address live in the EFUSE, not here.
*
* NOTE also that the CPU fetches instructions from the very same flash
* array. The FMC stalls the AHB bus while an erase or a program operation
diff --git a/arch/risc-v/src/gd32vw55x/gd32vw55x_progmem.h
b/arch/risc-v/src/gd32vw55x/gd32vw55x_progmem.h
index 7511a156024..9158a03cdf5 100644
--- a/arch/risc-v/src/gd32vw55x/gd32vw55x_progmem.h
+++ b/arch/risc-v/src/gd32vw55x/gd32vw55x_progmem.h
@@ -47,10 +47,10 @@
*
* WARNING: The internal flash of the GD32VW55x holds the running firmware
* itself (NuttX is linked at 0x08000000) as well as vendor data used by the
- * Wi-Fi/BLE stacks (the NVDS area and the RF/Wi-Fi trim values). The board
+ * Wi-Fi/BLE stacks (the NVDS area, with the BLE bonding data). The board
* must therefore carve out a region that is known to be unused. There is
* no default; erasing or programming the wrong region will brick the image
- * or destroy the calibration data.
+ * or lose the BLE bonds.
*/
#ifndef CONFIG_GD32VW55X_PROGMEM_START_ADDR
diff --git a/boards/risc-v/gd32vw55x/gd32vw553-hmq/scripts/ld.script
b/boards/risc-v/gd32vw55x/gd32vw553-hmq/scripts/ld.script
index 0147fe6a63b..7d10221ad44 100644
--- a/boards/risc-v/gd32vw55x/gd32vw553-hmq/scripts/ld.script
+++ b/boards/risc-v/gd32vw55x/gd32vw553-hmq/scripts/ld.script
@@ -30,12 +30,12 @@
* DECISION OF THIS BOARD, not a property of the chip -- another
* board may size it differently, or not carve it out at all.
* It must match CONFIG_GD32VW55X_PROGMEM_START_ADDR/_SIZE.
- * 0x083fb000 Wi-Fi NVDS (20K): RF calibration data and the MAC address.
- * This one IS fixed by the chip's radio firmware.
+ * 0x083fb000 NVDS (20K): the BLE bonding data of the vendor stack.
+ * This one IS fixed by the vendor Wi-Fi/BLE stack.
*
* That leaves 3948K (0x3db000) for the firmware. Overflowing it is a link
* error, which is the point: a firmware that grew over these regions would
- * take the filesystem, or the radio calibration, with it at the next flash.
+ * take the filesystem, or the BLE bonds, with it at the next flash.
*
* SRAM: the first 0x200 bytes belong to the boot ROM runtime data (the
* ROM mbedtls/IBL state) and must stay untouched - the vendor SDK links
diff --git a/boards/risc-v/gd32vw55x/gd32vw553-hmq/src/gd32_bringup.c
b/boards/risc-v/gd32vw55x/gd32vw553-hmq/src/gd32_bringup.c
index f2235dfd331..af94b0a93e6 100644
--- a/boards/risc-v/gd32vw55x/gd32vw553-hmq/src/gd32_bringup.c
+++ b/boards/risc-v/gd32vw55x/gd32vw553-hmq/src/gd32_bringup.c
@@ -259,7 +259,7 @@ int gd32_bringup(void)
#ifdef CONFIG_MTD_PROGMEM
/* The progmem region of the internal flash as an MTD device. It sits
- * below the Wi-Fi NVDS -- see CONFIG_GD32VW55X_PROGMEM_START_ADDR.
+ * below the NVDS -- see CONFIG_GD32VW55X_PROGMEM_START_ADDR.
*/
mtd = progmem_initialize();
diff --git a/boards/risc-v/gd32vw55x/gd32vw553k-start/scripts/ld.script
b/boards/risc-v/gd32vw55x/gd32vw553k-start/scripts/ld.script
index c9ba571da15..960234c87fb 100644
--- a/boards/risc-v/gd32vw55x/gd32vw553k-start/scripts/ld.script
+++ b/boards/risc-v/gd32vw55x/gd32vw553k-start/scripts/ld.script
@@ -30,12 +30,12 @@
* DECISION OF THIS BOARD, not a property of the chip -- another
* board may size it differently, or not carve it out at all.
* It must match CONFIG_GD32VW55X_PROGMEM_START_ADDR/_SIZE.
- * 0x083fb000 Wi-Fi NVDS (20K): RF calibration data and the MAC address.
- * This one IS fixed by the chip's radio firmware.
+ * 0x083fb000 NVDS (20K): the BLE bonding data of the vendor stack.
+ * This one IS fixed by the vendor Wi-Fi/BLE stack.
*
* That leaves 3948K (0x3db000) for the firmware. Overflowing it is a link
* error, which is the point: a firmware that grew over these regions would
- * take the filesystem, or the radio calibration, with it at the next flash.
+ * take the filesystem, or the BLE bonds, with it at the next flash.
*
* SRAM: the first 0x200 bytes belong to the boot ROM runtime data (the
* ROM mbedtls/IBL state) and must stay untouched - the vendor SDK links
diff --git a/boards/risc-v/gd32vw55x/gd32vw553k-start/src/gd32_bringup.c
b/boards/risc-v/gd32vw55x/gd32vw553k-start/src/gd32_bringup.c
index e644af7e2a9..b4fdc2e830c 100644
--- a/boards/risc-v/gd32vw55x/gd32vw553k-start/src/gd32_bringup.c
+++ b/boards/risc-v/gd32vw55x/gd32vw553k-start/src/gd32_bringup.c
@@ -259,7 +259,7 @@ int gd32_bringup(void)
#ifdef CONFIG_MTD_PROGMEM
/* The progmem region of the internal flash as an MTD device. It sits
- * below the Wi-Fi NVDS -- see CONFIG_GD32VW55X_PROGMEM_START_ADDR.
+ * below the NVDS -- see CONFIG_GD32VW55X_PROGMEM_START_ADDR.
*/
mtd = progmem_initialize();