萤火工场GD32VW553-IOT-V2基于mqtt的home assiatant智能小灯

分享作者:DingWH03
评测品牌:萤火工场
评测型号:GD32VW553-IOT-V2
发布时间:2026-07-06 11:16:31
1
概要
围绕GD32VW553-IOT-V2开发板,在Linux环境下完成了SDK编译和基于MQTT的Home Assistant智能小灯开发
开源口碑分享内容

gd32vw553 初体验

一、环境搭建

本人习惯在 Debian Linux 环境下进行开发,因此并未尝试 Windows 平台的集成开发环境。值得肯定的是,GD32VW553 的官方资料非常全面,同时上游芯来科技也提供了适用于 Linux 的最新版编译工具链。接下来的内容将记录从搭建环境开始,逐步完成官方 SDK 的编译、烧录与运行。

要完成官方 SDK 的编译与运行,需要下载以下内容:


组件说明下载链接
预编译工具链nuclei_riscv_newlibc_prebuilt_linux64_2025.10.tar.bz2下载页面(选择 Linux 64 位版本)
官方 SDK 代码GD32VW55x_RELEASE_V1.0.3g.zip下载页面
OpenOCD 调试烧录工具nuclei-openocd-2025.10-linux-x64.tgz(也可使用 Debian 软件源中的版本)下载页面(选择 OpenOCD Linux 版本)
Linux命令行烧录工具GD32_ISP_CLI_Linux_V5.1.0.39154.tar.gz下载页面

1. 配置预编译工具链

首先解压nuclei_riscv_newlibc_prebuilt_linux64_2025.10.tar.bz2并放置到喜欢的位置,我在~目录下建立了一个Apps文件夹,大多数自己配置环境变量的程序都在这里。

其次找到刚才解压工具链的bin目录,我这里是/home/dwh/Apps/nuclei_riscv_newlibc_prebuilt_linux64_2025.10/gcc/bin/,修改~/.zshrc配置文件将工具链的bin目录添加到系统环境变量PATHexport PATH=$PATH:$HOME/Apps/nuclei_riscv_newlibc_prebuilt_linux64_2025.10/gcc/bin(如果是bash则需要修改~/.bashrc)。配置完成后重新打开终端,输入riscv64-unknown-elf-gcc -v来查看工具链是否可以使用。

新版工具链默认适用于riscv64架构,而gd32vw553是32位的架构,所以其sdk里面默认访问的工具链是riscv-nuclei-elf-,但是好在riscv64工具链可以向下兼容,因此只需要将所有的riscv64-unknown-elf-建立一个riscv-nuclei-elf-符号链接即可,使用下面的脚本可以批量创建符号链接:

for tool in riscv64-unknown-elf-*; do         new_name=$(echo $tool | sed 's/riscv64-unknown-elf/riscv-nuclei-elf/')    ln -sf $tool $new_namedone

之后便可以检查一下是否可以在系统环境中直接调用工具链riscv-nuclei-elf-gcc -v

2. 安装openocd

必须使用芯来科技提供的openocd工具,不然会出现错误。安装过程同上,主要还是解压完成后配置一个PATH环境变量即可。

dwh@dwh-82sk ~ » openocd -v            Open On-Chip Debugger 0.12.0+dev-04210-g53b4f5983 (2025-11-02-12:00)Licensed under GNU GPL v2For bug reports, read        http://openocd.org/doc/doxygen/bugs.html

3. 安装ISP工具

同上,解压并配置到系统环境PATH中。

4. 编译官方sdk

sdk根目录下存在一个脚本cmake_build.sh,此时执行脚本:

chmod +x cmake_build.sh # 先赋予可执行权限./cmake_build.sh

会出现错误:

dwh@dwh-82sk GD32/GD32VW55x_RELEASE_V1.0.3g_1 » ./cmake_build.sh zsh: ./cmake_build.sh: bad interpreter: /bin/bash^M: 没有那个文件或目录

这是因为在linux下使用LF(\n)作为换行符,而windows使用CRL( \r\n)作为换行符,在linux的sh脚本中使用\r\n自然无法识别,直接将所有的.sh文件中的\r\n替换为\n即可:

find . -name "*.sh" -exec dos2unix {} \; # 需要先安装dos2unix程序

转换完成即可继续执行./cmake_build.sh 此时会遇到下一个错误,虽然有大量的错误日志但是核心问题如下:

riscv-nuclei-elf-gcc: error: '-march=rv32imafcbp': extension 'p' is unsupported standard single letter extensionmake[2]: *** [MSDK/mbedtls/CMakeFiles/mbedtls.dir/build.make:261:MSDK/mbedtls/CMakeFiles/mbedtls.dir/mbedtls/library/camellia.o] 错误 1riscv-nuclei-elf-gcc: error: '-march=rv32imafcbp': extension 'p' is unsupported standard single letter extension

即新版的编译器不再支持p扩展,是因为旧版 GCC 工具链中用于标识 DSP 扩展的字母 p(即 P 扩展,Packed SIMD/DSP 指令集)在新版本中已不再被视为标准单字母扩展,需要被拆分为官方标准扩展 + 自定义扩展的组合,解决方法也很简单,将所有的rv32imafcbp批量替换为rv32imafc_zba_zbb_zbc_zbs_xxldspn1x即可,我直接使用vscode的搜索和替换功能完成的替换, 共完成41个文件中的148次替换。

再次进行编译,又会出现下面所示的链接错误:

/home/dwh/Apps/nuclei_riscv_newlibc_prebuilt_linux64_2025.10/gcc/bin/../lib/gcc/riscv64-unknown-elf/14.2.1/../../../../riscv64-unknown-elf/bin/ld: section .stack VMA [20004300,200052ff] overlaps section .bss VMA [20000368,20004377]/home/dwh/Apps/nuclei_riscv_newlibc_prebuilt_linux64_2025.10/gcc/bin/../lib/gcc/riscv64-unknown-elf/14.2.1/../../../../riscv64-unknown-elf/bin/ld: warning: /home/dwh/code/GD32/GD32VW55x_RELEASE_V1.0.3g_1/MBL/project/cmake/bin/MBL.elf has a LOAD segment with RWX permissionsMemory region         Used Size  Region Size  %age Used          flash0:          4 KB         4 KB    100.00%           flash:       18132 B        32 KB     55.33%             ram:         20 KB        20 KB    100.00%collect2: error: ld returned 1 exit status

这是由于GCC 14.2.1 生成的代码/数据比旧版更大,RAM 不够,于是我修改MBL/mainboot/mbl_region.h文件57行为

#define MBL_DATA_SIZE                       (0x2000 + MBL_MSP_STACK_SIZE + MBL_BUF_SIZE)

此时编译会发现还是存在错误,并且多了一个/bin/sh: 1: ../../mbl_afterbuild.sh: Permission denied的错误,于是授予这个文件可执行权限chmod +x MBL/project/mbl_afterbuild.sh,再次执行编译,完整日志如下:

dwh@dwh-82sk GD32/GD32VW55x_RELEASE_V1.0.3g_1 » ./cmake_build.sh Toolchain found in PATH: /home/dwh/Apps/nuclei_riscv_newlibc_prebuilt_linux64_2025.10/gcc/bin/riscv-nuclei-elf-gccOpenOCD found in PATH: /usr/bin/openocdCMake Deprecation Warning at MSDK/lwip/lwip-2.2.0/CMakeLists.txt:1 (cmake_minimum_required):  Compatibility with CMake < 3.10 will be removed from a future version of  CMake.  Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax  to tell CMake that the project requires at least <min> but has been updated  to work with policies introduced by <max> or earlier.-- CMAKE_OBJDUMP path: /home/dwh/Apps/nuclei_riscv_newlibc_prebuilt_linux64_2025.10/gcc/bin/riscv-nuclei-elf-objdump-- CMAKE_OBJCOPY path: /home/dwh/Apps/nuclei_riscv_newlibc_prebuilt_linux64_2025.10/gcc/bin/riscv-nuclei-elf-objcopy-- Configuring done (0.0s)-- Generating done (0.0s)-- Build files have been written to: /home/dwh/code/GD32/GD32VW55x_RELEASE_V1.0.3g_1/cmake_build[  2%] Linking C static library ../../../bin/lib/libfreertos.a[  2%] Built target MBL_scatter[  2%] Building C object MSDK/util/CMakeFiles/util.dir/src/cJSON.o[  2%] Linking C static library ../../../bin/lib/libriscv.a[  2%] Built target MSDK_scatter[  2%] Linking C static library ../../bin/lib/libble_app_profile.a[  3%] Linking C static library ../../../bin/lib/libbsp.a[  4%] Linking C static library ../../../bin/lib/libgd32vw55x_peripheral.a[  4%] Linking C static library ../../../bin/lib/liblwIP.a[  4%] Linking C executable /home/dwh/code/GD32/GD32VW55x_RELEASE_V1.0.3g_1/MBL/project/cmake/bin/MBL.elf/home/dwh/code/GD32/GD32VW55x_RELEASE_V1.0.3g_1/MSDK/util/src/cJSON.c:167:25: error: unknown type name 'uint32_t'  167 | extern void *sys_malloc(uint32_t size);      |                         ^~~~~~~~/home/dwh/code/GD32/GD32VW55x_RELEASE_V1.0.3g_1/MSDK/util/src/cJSON.c:62:1: note: 'uint32_t' is defined in header '<stdint.h>'; this is probably fixable by adding '#include <stdint.h>'   61 | #include "cJSON.h"  +++ |+#include <stdint.h>   62 | /home/dwh/code/GD32/GD32VW55x_RELEASE_V1.0.3g_1/MSDK/util/src/cJSON.c: In function 'internal_malloc':/home/dwh/code/GD32/GD32VW55x_RELEASE_V1.0.3g_1/MSDK/util/src/cJSON.c:172:12: error: implicit declaration of function 'sys_malloc'; did you mean 'sys_realloc'? [-Wimplicit-function-declaration]  172 |     return sys_malloc(size);      |            ^~~~~~~~~~      |            sys_realloc/home/dwh/code/GD32/GD32VW55x_RELEASE_V1.0.3g_1/MSDK/util/src/cJSON.c:172:12: error: returning 'int' from a function with return type 'void *' makes pointer from integer without a cast [-Wint-conversion]  172 |     return sys_malloc(size);      |            ^~~~~~~~~~~~~~~~[ 12%] Built target riscv[ 12%] Built target bsp[ 15%] Built target freertosmake[2]: *** [MSDK/util/CMakeFiles/util.dir/build.make:93:MSDK/util/CMakeFiles/util.dir/src/cJSON.o] 错误 1make[1]: *** [CMakeFiles/Makefile2:887:MSDK/util/CMakeFiles/util.dir/all] 错误 2make[1]: *** 正在等待未完成的任务....[ 22%] Linking C static library ../../bin/lib/libmbedtls.a[ 30%] Built target ble_app_profile[ 38%] Built target gd32vw55x_peripheral[ 51%] Built target lwIP[ 86%] Built target mbedtls/home/dwh/Apps/nuclei_riscv_newlibc_prebuilt_linux64_2025.10/gcc/bin/../lib/gcc/riscv64-unknown-elf/14.2.1/../../../../riscv64-unknown-elf/bin/ld: warning: /home/dwh/code/GD32/GD32VW55x_RELEASE_V1.0.3g_1/MBL/project/cmake/bin/MBL.elf has a LOAD segment with RWX permissionsMemory region         Used Size  Region Size  %age Used          flash0:          4 KB         4 KB    100.00%           flash:       18132 B        32 KB     55.33%             ram:         24 KB        24 KB    100.00%Building MBLNot add image header and tailer, goto download!Download image use the follow command: /usr/bin/openocd -f /home/dwh/code/GD32/GD32VW55x_RELEASE_V1.0.3g_1/MBL/project/cmake/bin/../openocd_gdlink.cfg -c "program /home/dwh/code/GD32/GD32VW55x_RELEASE_V1.0.3g_1/scripts/images/MBL.bin 0x08000000 verify exit;"[ 90%] Built target MBLmake: *** [Makefile:91:all] 错误 2

经过仔细观察发现,这次的报错集中错误于缺少<stdint.h>的头文件,于是在错误文件MSDK/util/src/cJSON.c上方加入#include <stdint.h>之后继续编译:

[ 97%] Built target util[ 97%] Generating _build_date.h/bin/sh: 1: /home/dwh/code/GD32/GD32VW55x_RELEASE_V1.0.3g_1/MSDK/projects//image_prebuild.sh: Permission deniedmake[2]: *** [MSDK/CMakeFiles/MSDK.dir/build.make:74:MSDK/_build_date.h] 错误 126

又是没有可执行权限的错误,并且双斜线有点奇怪,但是应该不影响,直接chmod +x MSDK/projects//image_prebuild.sh赋予权限之后重新编译:

[100%] Linking C executable /home/dwh/code/GD32/GD32VW55x_RELEASE_V1.0.3g_1/MSDK/projects/cmake/output/bin/MSDK.elf/home/dwh/Apps/nuclei_riscv_newlibc_prebuilt_linux64_2025.10/gcc/bin/../lib/gcc/riscv64-unknown-elf/14.2.1/../../../../riscv64-unknown-elf/bin/ld: cannot find -lnmsis_dsp_rv32imafc_zba_zbb_zbc_zbs_xxldspn1x: 没有那个文件或目录collect2: error: ld returned 1 exit status

这一次又出现了链接错误,是因为找不到文件MSDK/plf/riscv/NMSIS/Library/DSP/GCC/libnmsis_dsp_rv32imafc_zba_zbb_zbc_zbs_xxldspn1x.a,跟之前提到的p扩展重命名有关,是因为MSDK/CMakeLists.txt文件中的110行处附近的nmsis_dsp_rv32imafc_zba_zbb_zbc_zbs_xxldspn1x被错误替换了,这个库是预编译的静态库,改回nmsis_dsp_rv32imafcbp即可。

target_link_libraries(${TARGET_EXE}    PRIVATE        MSDK_CORE_API        -Wl,--start-group        wifi        rf        rftest        wpas        ${ble_lib}        nmsis_dsp_rv32imafcbp        m        iperf3        ${MSDK_MODULE_PATHS}        -Wl,--whole-archive riscv -Wl,--no-whole-archive    -Wl,--end-group    )

继续编译,这次没出现链接错误,但是出现了权限错误,依旧缺少可执行权限:

[ 99%] Linking C executable /home/dwh/code/GD32/GD32VW55x_RELEASE_V1.0.3g_1/MSDK/projects/cmake/output/bin/MSDK.elf/home/dwh/Apps/nuclei_riscv_newlibc_prebuilt_linux64_2025.10/gcc/bin/../lib/gcc/riscv64-unknown-elf/14.2.1/../../../../riscv64-unknown-elf/bin/ld: warning: /home/dwh/code/GD32/GD32VW55x_RELEASE_V1.0.3g_1/MSDK/projects/cmake/output/bin/MSDK.elf has a LOAD segment with RWX permissionsMemory region         Used Size  Region Size  %age Used           flash:     1001152 B      4056 KB     24.10%             ram:      294400 B     294400 B    100.00%             mib:           0 B         2 KB      0.00%Building MSDK/bin/sh: 1: /home/dwh/code/GD32/GD32VW55x_RELEASE_V1.0.3g_1/MSDK/projects//image_afterbuild.sh: Permission deniedmake[2]: *** [MSDK/CMakeFiles/MSDK.dir/build.make:234:/home/dwh/code/GD32/GD32VW55x_RELEASE_V1.0.3g_1/MSDK/projects/cmake/output/bin/MSDK.elf] 错误 126

继续授予权限chmod +x MSDK/projects//image_afterbuild.sh,重新编译。

[ 99%] Linking C executable /home/dwh/code/GD32/GD32VW55x_RELEASE_V1.0.3g_1/MSDK/projects/cmake/output/bin/MSDK.elf/home/dwh/Apps/nuclei_riscv_newlibc_prebuilt_linux64_2025.10/gcc/bin/../lib/gcc/riscv64-unknown-elf/14.2.1/../../../../riscv64-unknown-elf/bin/ld: warning: /home/dwh/code/GD32/GD32VW55x_RELEASE_V1.0.3g_1/MSDK/projects/cmake/output/bin/MSDK.elf has a LOAD segment with RWX permissionsMemory region         Used Size  Region Size  %age Used           flash:     1001152 B      4056 KB     24.10%             ram:      294400 B     294400 B    100.00%             mib:           0 B         2 KB      0.00%Building MSDKMSDK.elfmbl_offset=0x0 image0_offset=0xA000 image1_offset=0x1EA000rftest_on=0mbl_len = 22228rftest_end = 0XA000Not add image header and tailer!Download OTA image use the follow command: /usr/bin/openocd -f /home/dwh/code/GD32/GD32VW55x_RELEASE_V1.0.3g_1/MSDK/projects/cmake/output/bin/../openocd_gdlink.cfg -c "program /home/dwh/code/GD32/GD32VW55x_RELEASE_V1.0.3g_1/scripts/images/image-ota.bin 0x0800A000 verify exit;"Or download ALL image:/usr/bin/openocd -f /home/dwh/code/GD32/GD32VW55x_RELEASE_V1.0.3g_1/MSDK/projects/cmake/output/bin/../openocd_gdlink.cfg -c "program /home/dwh/code/GD32/GD32VW55x_RELEASE_V1.0.3g_1/scripts/images/image-all.bin 0x08000000 verify exit;"[100%] Built target MSDK

编译成功,按照日志提示,编译出两个固件image-ota.binimage-all.bin,直接/usr/bin/openocd -f /home/dwh/code/GD32/GD32VW55x_RELEASE_V1.0.3g_1/MSDK/projects/cmake/output/bin/../openocd_gdlink.cfg -c "program /home/dwh/code/GD32/GD32VW55x_RELEASE_V1.0.3g_1/scripts/images/image-all.bin 0x08000000 verify exit;"烧录完整固件即可:

但是错误又出现了:

dwh@dwh-82sk GD32/GD32VW55x_RELEASE_V1.0.3g_1 » /usr/bin/openocd -f /home/dwh/code/GD32/GD32VW55x_RELEASE_V1.0.3g_1/MSDK/projects/cmake/output/bin/../openocd_gdlink.cfg -c "program /home/dwh/code/GD32/GD32VW55x_RELEASE_V1.0.3g_1/scripts/images/image-all.bin 0x08000000 verify exit;"Open On-Chip Debugger 0.12.0Licensed under GNU GPL v2For bug reports, read        http://openocd.org/doc/doxygen/bugs.htmlembedded:startup.tcl:28: Error: Can't find /home/dwh/code/GD32/GD32VW55x_RELEASE_V1.0.3g_1/MSDK/projects/cmake/output/bin/../openocd_gdlink.cfgTraceback (most recent call last):  File "embedded:startup.tcl", line 28, in script    find /home/dwh/code/GD32/GD32VW55x_RELEASE_V1.0.3g_1/MSDK/projects/cmake/output/bin/../openocd_gdlink.cfg

问题在于image_afterbuild.sh:174 使用相对路径引用配置文件:LINKCFG="${cur_dir}/../openocd_gdlink.cfg"cur_dir是脚本执行时的 $PWD,在 cmake 构建中是 MSDK/projects/cmake/output/bin/,所以../ 指向 MSDK/projects/cmake/output/,该目录下没有 openocd_gdlink.cfg。脚本是为 Eclipse 项目结构设计的——Eclipse 的工作目录是 MSDK/projects/eclipse/msdk/Debug/../ 自然指向 MSDK/projects/eclipse/msdk/,那里有配置文件。CMake 构建系统复用了同一个脚本,但工作目录不同,脚本里也没有复制操作,只是直接引用相对路径。

直接对脚本MSDK/projects/image_afterbuild.shMBL/project/mbl_afterbuild.sh进行修改,不使用相对工作路径的相对路径,而是基于${ROOT}使用绝对路径。

MSDK/projects/image_afterbuild.sh的174-175行替换为:

LINKCFG="${ROOT}/MSDK/projects/eclipse/msdk/openocd_gdlink.cfg"#LINKCFG="${ROOT}/MSDK/projects/eclipse/msdk/openocd_jlink.cfg"

MBL/project/mbl_afterbuild.sh的140-141行替换为:

LINKCFG="${ROOT}/MBL/project/eclipse/openocd_gdlink.cfg"#LINKCFG="${ROOT}/MBL/project/eclipse/openocd_jlink.cfg"

进行重新编译即可使用脚本输出的路径进行烧录。

dwh@dwh-82sk GD32/GD32VW55x_RELEASE_V1.0.3g_1 » /usr/bin/openocd -f /home/dwh/code/GD32/GD32VW55x_RELEASE_V1.0.3g_1/MSDK/projects/eclipse/msdk/openocd_gdlink.cfg -c "program /home/dwh/code/GD32/GD32VW55x_RELEASE_V1.0.3g_1/scripts/images/image-all.bin 0x08000000 verify exit;"Open On-Chip Debugger 0.12.0Licensed under GNU GPL v2For bug reports, read        http://openocd.org/doc/doxygen/bugs.htmlError: flash driver 'gd32vw55x' not found

不过还是出现了错误。还是需要配置官方的openocd。官方的openocd可执行文件不在/usr/bin目录下。直接使用openocd命令openocd -f /home/dwh/code/GD32/GD32VW55x_RELEASE_V1.0.3g_1/MSDK/projects/eclipse/msdk/openocd_gdlink.cfg -c "program /home/dwh/code/GD32/GD32VW55x_RELEASE_V1.0.3g_1/scripts/images/image-all.bin 0x08000000 verify exit;"即可。在使用daplink连接正常的情况下,可以进行烧录。我这里使用daplink swd接口接在PA13和PA14引脚,不知道为什么始终连接失败,先不使用了,最后选择使用GD32_ISP_CLI工具使用串口烧录,在烧录之前,需要将拨码左边的sw1拨到1,右边的保持0即可。

dwh@dwh-82sk GD32/GD32VW55x_RELEASE_V1.0.3g_1 » GD32_ISP_CLI -c --pn /dev/ttyUSB0 --br 115200 --pr EVEN \      139 ↵               -i GD32VW553 \               -d --fn /home/dwh/code/GD32/GD32VW55x_RELEASE_V1.0.3g_1/scripts/images/image-all.bin --a 0x08000000Establish connection to the COM port Opening port     [Successful]Opening port     [Successful]Device  GD32VW553HMQ7Init OptionBytes failed!%                             

使用如上的命令进行烧录,但是报错 Init OptionBytes failed!,后来经过测试,不应该直接把 GD32_ISP_CLI 配置到环境变量中使用,需要进入到工具路径使用 ./ 来运行。需要进入 GD32_ISP_CLI/bin 目录后运行:

./GD32_ISP_CLI -c --pn /dev/ttyUSB0 --br 115200 --db 8 --pr EVEN --sb 1 --to 5000 \  -i GD32VW553 \  -d --fn /home/dwh/code/GD32/GD32VW55x_RELEASE_V1.0.3g_1/scripts/images/image-all.bin \  --a 0x08000000 --v

但是还是出现了错误:

dwh@dwh-82sk GD32_ISP_CLI/bin » ./GD32_ISP_CLI -c --pn /dev/ttyUSB0 --br 115200 --db 8 --pr EVEN --sb 1 --to 5000 \  -i GD32VW553 \  -d --fn /home/dwh/code/GD32/GD32VW55x_RELEASE_V1.0.3g_1/scripts/images/image-all.bin \  --a 0x08000000 --vEstablish connection to the COM port Opening port     [Successful]Opening port     [Successful]Device  GD32VW553HMQ7Opening port     [Successful]Activating device           [Successful]DOWNLOADING ... The file may span regions, Please confirm the Address and File size!

后来发现是指定型号时 -i GD32VW553 不是完整型号,工具虽然可以识别到设备是 GD32VW553HMQ7,但是在下载时会判断文件可能跨越了多个 Flash 区域/分区,所以拒绝烧录。

改为完整型号后就可以顺利刷入:

./GD32_ISP_CLI -c --pn /dev/ttyUSB0 --br 115200 --db 8 --pr EVEN --sb 1 --to 5000 \  -i GD32VW553HMQ7 \  -d --fn /home/dwh/code/GD32/GD32VW55x_RELEASE_V1.0.3g_1/scripts/images/image-all.bin \  --a 0x08000000 --v

也可以使用下面的命令刷入 OTA 镜像,只有应用分区:

./GD32_ISP_CLI -c --pn /dev/ttyUSB0 --br 115200 --db 8 --pr EVEN --sb 1 --to 5000 \  -i GD32VW553HMQ7 \  -d --fn /home/dwh/code/GD32/GD32VW55x_RELEASE_V1.0.3g_1/scripts/images/image-ota.bin \  --a 0x0800A000 --v

命令参数说明:

-c使用串口连接芯片。

--pn /dev/ttyUSB0指定串口设备。

--br 115200指定波特率为 115200。

--db 8指定数据位为 8 位。

--pr EVEN指定偶校验。

--sb 1指定 1 个停止位。

txt--to 5000指定超时时间为 5000 ms。

-i GD32VW553HMQ7指定完整芯片型号,这里不能只写 GD32VW553

-d表示下载固件到 Flash。

--fn xxx.bin指定要烧录的 bin 文件。

--a 0x08000000指定写入地址。image-all.bin 写入地址是 0x08000000

--a 0x0800A000指定写入地址。image-ota.bin 写入地址是 0x0800A000

--v烧录完成后进行校验。

刷入需要几分钟的时间,略慢,image-all.bin 一共 255 个页面,一个页面 4KB。

烧录完成后,将拨码拨回00,拔电重启开发板,发现串口没输出,程序没跑起来。又经过漫长时间排查和对sdk的探索,我发现在config/platform_def.h文件中定义了CONFIG_BOARD,默认是PLATFORM_BOARD_32VW55X_START,我将其修改成了PLATFORM_BOARD_32VW55X_EVAL即:

#define CONFIG_BOARD                    PLATFORM_BOARD_32VW55X_EVAL

再进行编译、拨码切换10并烧录、切换00并重启动之后,串口上终于有了输出:

ALW: MBL: First print.ALW: MBL: Boot from Image 0.ALW: MBL: Validate Image 0 OK.ALW: MBL: Jump to Main Image (0x0800a000).=== RF initialization finished ===SDK Version: v1.0.3g-dd6d47cb4ee163dfBuild date: 2026/06/12-23:03:33Image Version: GIGA1.0.3.004=== WiFi calibration done ====== PHY initialization finished ===BLE local addr: AB:89:67:45:23:01, type 0x0=== BLE Adapter enable complete ===

至此,已经顺利的在linux平台上完成对gd32vw553 sdk的编译、烧录和运行。


全部评论
暂无评论
0/144