Open mrzhuyuanheng opened 1 week ago
Esp32-c2 is low memory chipset.
If you need higher throughput might need to disable bluetooth. As much as iram to be optimised to let wifi and spi queues memory.
If you increase spi queues, it would crash when wifi back pressure is high (queue loading would exhaust memory).
If you notice the checksum errors, there is spi timing issues on your setup. You need to have 0 checksum errors.
If ESP to host throughput is not correct, please check data ready pin interrupt is fired correctly.
Handshake, data ready and reset pin are mandatory pins.
Also ensure that you are using 26MHz crystal. If you are using 40MHz crystal, software may not work correctly and also would not show any reason why it would not work.
Also disable mempool should be disabled by default to conserve some memory.
The spi frequency can go till 40MHz. But only if you have PCB. stepwise increase could be attempted.
As you get 70 KB/s, I assume your reset pin, handshake and data ready are already working. But why the ESP to host traffic is not working in that case?
If you use jumper wires, ensure to have minimal length and good contact points. At the max length 10cm. All equal.
70KBps i.e. half mbps is extremely low throughput. The throughput depends minimum of two:
Wifi max iperf UDP traffic should really reach around your transport max (little less, but just there).
Raw throughput in either direction should really be symmetrical speed in spi.
@mantriyogesh thanks for your reply!
Also ensure that you are using 26MHz crystal. If you are using 40MHz crystal, software may not work correctly and also would >not show any reason why it would not work.
i use esptool.py chip_id
to get crystal is 26MHZ
Detecting chip type... ESP32-C2
Chip is ESP32-C2 (revision v1.2)
Features: WiFi, BLE
Crystal is 26MHz
MAC: d0:ef:76:82:09:1c
Uploading stub...
Running stub...
Stub running...
Warning: ESP32-C2 has no Chip ID. Reading MAC instead.
MAC: d0:ef:76:82:09:1c
Hard resetting via RTS pin...
If you need higher throughput might need to disable bluetooth. As much as iram to be optimised to let wifi and spi queues memory.
my usage scenario requires both wifi and Bluetooth
Handshake, data ready and reset pin are mandatory pins.
i do use reset pin, handshake and data ready pin,
we welded the ESP8684-MINI-1 module to the PCB, also welded the ESP32C3-MINI-1 module to the other PCB, which means i test both module as spi slave. i use the same mcu host code, and esp8684 module esp32c3 module use the same esp-hosted commit code
ESP->host and host->ESP raw throughput test for ESP32C3-MINI-1 is ok.
but raw throughput test for ESP8684-MINI-1 is not ok, esp32c2 crashed when i test ESP->Host raw throughput. i can successfully run the test by modify esp32c2 esp-hosted file stats.c
as follow:
esp32c2 log
*** Raw Throughput testing: ESP --> Host started ***
I (1047) NETWORK_ADAPTER: Initial set up done
I (1054) slave_ctrl: event ESPInit
I (1061) main_task: Returned from app_main()
I (1107) slave_ctrl: Get station mac address
I (1108) slave_ctrl: mac [d0:ef:76:82:09:1c]
I (1111) slave_ctrl: Get station mac address
I (1113) slave_ctrl: mac [d0:ef:76:82:09:1c]
0-1 sec 0.00 kbits/sec
1-2 sec 0.00 kbits/sec
2-3 sec 0.00 kbits/sec
3-4 sec 0.00 kbits/sec
4-5 sec 11.50 kbits/sec
5-6 sec 11500.00 kbits/sec
6-7 sec 11500.00 kbits/sec
7-8 sec 11500.00 kbits/sec
8-9 sec 11500.00 kbits/sec
9-10 sec 11500.00 kbits/sec
10-11 sec 11500.00 kbits/sec
11-12 sec 11500.00 kbits/sec
12-13 sec 11500.00 kbits/sec
13-14 sec 11500.00 kbits/sec
14-15 sec 11500.00 kbits/sec
15-16 sec 11500.00 kbits/sec
16-17 sec 11500.00 kbits/sec
17-18 sec 11500.00 kbits/sec
18-19 sec 11500.00 kbits/sec
19-20 sec 11500.00 kbits/sec
20-21 sec 11500.00 kbits/sec
i also modify same file stats.c
on host mcu as follow, and can succefully run Host->esp test
esp32c2 log
1468-1469 sec 14246.41 kbits/sec
1469-1470 sec 14212.19 kbits/sec
1470-1471 sec 14200.78 kbits/sec
1471-1472 sec 14223.59 kbits/sec
1472-1473 sec 14200.78 kbits/sec
1473-1474 sec 14212.19 kbits/sec
1474-1475 sec 14212.19 kbits/sec
1475-1476 sec 14212.19 kbits/sec
1476-1477 sec 14212.19 kbits/sec
1477-1478 sec 14223.59 kbits/sec
1478-1479 sec 14189.38 kbits/sec
1479-1480 sec 14200.78 kbits/sec
1480-1481 sec 14189.38 kbits/sec
1481-1482 sec 14212.19 kbits/sec
I tested http download again which http server in a LAN environment, esp32c2 http download average speed can up to 470KB/s. but sometimes esp32c2 would crash suddenly very infrequently
iperf test for esp32c2 always crashed, it always assert failed: queue_next_transaction spi_slave_api.c:502 (spi_trans->rx_buffer) .
I wonder if there is a stable version for esp32c2 to use?
iperf test for esp32c2 always crashed, it always assert failed: queue_next_transaction spi_slave_api.c:502 (spi_trans->rx_buffer) .
I had observed this issue on esp32-c6. and mempool was requesting more in peak rates than expected. 50f9444c89decbc2ddb15fd8a7e1538ba6d8f881 is the fix for c6. I had not yet tested on C2 this.
But c2 was disabled for lowering code space requirement.
What I would really suggest, disable tx and rx priority queues (in sdkconfig.defaults.esp32c2
to default and remove files sdkconfig
and build/
), as well enable mempool for c2.
I can deep down here and try these on latest master and fix, but might take some time.
Checklist
Issue or Suggestion Description
Hello,
i use ESP-Hosted-FG for esp32c2, spi master is mcu it's ok when i use it connect to wifi AP, but http download speed is very slow, about 70KB/s. i use raw througth testing, but it always assert failed as follow:
1.i want to know how to slove this issue 2.i want to know how to increase wifi speed. i try to increase
CONFIG_ESP_SPI_RX_Q_SIZE
andCONFIG_ESP_SPI_TX_Q_SIZE
, but not work, and it always assert failed: queue_next_transaction spi_slave_api.c:502 (spi_trans->rx_buffer) or assert failed at queue_next_transaction spi_slave_api.c:722ESP-->Host raw throught testing
esp32c2 log
mcu log:
Host-->ESP raw throught testing
esp32c2 log
my environment:
Hardware:
Software:
sdkconfig