[原创] 【启明云端WT99P4C5-S1】wifi iperf性能测试

xhackerustc   2026-3-22 13:43 楼主

本篇文章关注启明云端WT99P4C5-S1开发板的wifi iperf性能测试。虽然ESP32P4未集成wifi功能,但是WT99P4C5-S1开发板通过集成ESP32-C5-WROOM-1模块来提供wifi/bt功能。肉眼看出WT99P4C5-S1开发板 集成的是ESP32-C5-WROOM-1-N8R4,按官方文档的解读这是有8MB flash和4MB的psram,启明在WT99P4C5-S1开发板上真的是下了血本哈哈。等有空的时候来玩玩ESP32-C5的那个psram怎样,现在先搞wifi吧。

 

对于这种用ESP32芯片提供wifi/bt功能的,有一套成熟的解决方案:esp-hosted,对于MCU做host倾向于使 用esp-hosted-mcu; 如果主机也是esp系列比如esp32p4,那么host端使用esp-wifi-remote即可。

 

下载esp-hosted-mcu

git clone --depth=1 https://github.com/espressif/esp-hosted-mcu.git

这里有个技巧,如果github clone比较慢,可以先用gitee首次clone然后再改.git/config把url换成github的,会大大加速代码下载速度。同时--depth=1参数也会大大加速,笔者觉得个人大概率不需要est-hosted-mcu的commit历史,其实即使有这些commit历史,真碰到问题除了向原厂报告外个体开发者也 做不了太多事,wifi/bt涉及东西太多了。

 

配置esp-hosted-mcu slave

cd esp-hosted-mcu/slave
idf.py set-target esp32c5
idf.py menuconfig


注意1:默认nor flash配置是DIO, 4MB,但前面说过WT99P4C5-S1板载的是ESP32-C5-WROOM-1-N8R4, flash有8MB之巨,咱么就把它改掉吧,其实不改也能用,因为只当slave用,别说4MB flash,2MB flash 都够用。注:频率保持80MHZ不要改,因为ESP32-C5-WROOM-1手册提过flash是80MHZ。修改路径和截图 如图所示:

w1.jpg

 

w2.jpg

注意2:因WT99P4C5-S1开发板板载的是标准的ESP32-C5-WROOM-1模块,所以引脚配置应该是标准的,所以默认config应该就能用,但是最好检查下,配置路径在:

Example Configuration  --->
  Bus Config in between Host and Co-processor  --->
    SDIO Configuration  --->
      Hosted SDIO GPIOs  --->
如图确实和实际硬件一致:

w3.jpg

 

编译esp-hosted-mcu slave

idf.py build

esp/esp-hosted-mcu/slave/main/slave_control.c: In function 'req_ota_write_handler':
esp/esp-hosted-mcu/slave/main/slave_control.c:230:42: error: implicit declaration of function 'esp_ota_check_image_validity' [-Wimplicit-function-declaration]
  230 |                 esp_err_t validity_ret = esp_ota_check_image_validity(update_partition->type, img_hdr, app_desc);
      |                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

what编译报错了,这个esp_ota_check_image_validity函数在目前esp-idf中确实没有,从源码猜测和ota有关,所幸笔者并不需要OTA功能,所以改动下代码把ota关闭暂时绕过去

diff --git a/slave/main/slave_config.h b/slave/main/slave_config.h
index 5687775..6c2e540 100644
--- a/slave/main/slave_config.h
+++ b/slave/main/slave_config.h
@@ -11,7 +11,7 @@
 #if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(6, 1, 0)
 // do additional OTA image checking
 // - SPI FLASH mode of incoming OTA is compatible with current image
-#define H_OTA_CHECK_IMAGE_VALIDITY 1
+#define H_OTA_CHECK_IMAGE_VALIDITY 0
 #else
 #define H_OTA_CHECK_IMAGE_VALIDITY 0
 #endif


烧录esp-hosted-mcu slave:
找个usb转ttl, 把txd/rxd/gnd与WT99P4C5-S1开发板上ESP32-C5-WROOM-1模块旁边的J5对应引脚连接起来,再找根杜邦先连接J5的boot引脚和板子的gnd,即可利用usb转ttl烧录esp-hosted-mcu slave固件 到ESP32-C5-WROOM-1模块。笔者烧录成功如图所示:

w5.jpg

 

最后烧录完毕:

w6.jpg

 

 

可以看看esp-hosted-mcu slave在esp32c5上的log输出长啥样:

w8.jpg

最后就停在下面这个地方等待host端操作,由此也可见esp-hosted-mcu slave fw固件版本:2.12.3

w9.jpg

 

esp32p4 iperf编译

cd esp/esp-idf/examples/wifi/iperf
idf.py set-target esp32p4
cp sdkconfig.defaults.esp32p4 sdkconfig
idf.py menuconfig

注意menuconfig中一些配置:
Component config  --->
  Wi-Fi Remote  --->
    choose slave target (esp32c6)  --->
因我们用的是esp32c5,所以这里需要改成esp32c5,如图所示

w10.jpg

最后以下面命令编译

idf.py build

 

esp32p4 iperf烧录

esptool --chip esp32p4 -b 460800 --before default-reset --after hard-reset write-flash --flash-mode dio --flash-size 16MB --flash-freq 80m 0x10000 build/iperf.bin

esp32p4 wifi iperf启动log

w11.jpg

由此可见是sdio方式,co-processor slave是esp32c5

 

主界面:

w12.jpg

co-processor slave已经成功启动,等待命令。

 

接着运行如下命令连接wifi路由器:

sta_connect <ap_ssid> <ap_password>

成功连上后会获取ip地址如图所示:

w15.jpg

 

wifi iperf性能测试
笔者仍然利用的手里的arm sbc开发板作为对端,运行命令可参考笔者的以太网iperf性能测试贴,不再赘述。

测试wifi环境:5g wifi路由,测试房间与wifi路由器所在位置隔了一个房间,信号不算好。

 

wifi iperf tx性能测试

w16.jpg

由此可见,wifi iperf tx性能达到33Mbits/s左右

 

wifi iperf rx性能测试

w18.jpg

由此可见,wifi iperf rx性能达到19Mbits/s左右

回复评论

暂无评论,赶紧抢沙发吧
电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 京公网安备 11010802033920号
    写回复