-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Host cannot communicate with ESP32-WROOM-32D via spi #533
Comments
I (27) boot: ESP-IDF v4.4.1-584-g91dc99a3ce-dirty 2nd stage bootloader /esp-hosted-master/esp_hosted_ng/host/spi/esp_spi.c |
Which esp chipset do you use? Are you flashing the esp NG firmware correctly? Reference chip id from esp-idf: |
ESP32(-WROOM-32D)- can go only 10m max SPI freq. Do not use more than 10, it wouldn't communicate. |
1.It’s not possible to change it to 5M. insmod esp32_spi.ko[ 6500.464192] esp32_spi: spi_dev_init: Using SPI MODE 2 [ 6504.576985] esp32_spi: process_rx_buf: offset_rcv[0] != exp[12], drop2.The binary firmware and host source code here are used. 3.To refresh the firmware, we use flash_download_tool_3.9.7.exe burned by this program.No firmware ID selected |
|
Use the latest https://github.com/espressif/esp-hosted.git to compile and burn the firmware and keep restarting |
Can you use esp flashing procedure using https://github.com/espressif/esp-hosted/tree/master/esp_hosted_ng/esp/esp_driver |
Now we can communicate, but we can't scan the AP and connect, and it's always stuck.
I (619) main_task: Calling app_main() I (1171) FW_SPI: Using SPI interface I (2360) wifi:mode : sta (40:f5:20:99:11:44) I (2488) FW_MAIN: Get Tx power command I (159278) FW_MAIN: Scan request |
~# ifconfig lo Link encap:Local Loopback wlan0 Link encap:Ethernet HWaddr 40:F5:20:99:11:44 ~# iw dev wlan0 scan | grep SSID |
Using mode 2, the 3M frequency will also appear. I (29) boot: ESP-IDF e7771c75-dirty 2nd stage bootloader I (1183) FW_SPI: Using SPI interface I (2346) wifi:mode : sta (40:f5:20:99:11:44) |
can you please check your transport correctness first in both rx and tx directions? |
This is using spi instead of uart |
|
root@myd-yt113-i:~# hciconfig root@myd-yt113-i: |
clearly says the spi transport is not correctly transferring the messages and set properly. (link in prior comments) Unless correctly ported, you would fall in unexpected errors @luckzhang888 |
I followed the transplant guide. If the configuration is not correct, there will be no success. Now the handshake is successful and the wifi and Bluetooth functions cannot be realized. |
Check the spi timing issues that you faced. porting guide suggest to use some ways to correct the spi timing issues. The guide suggest to use spi mode 1 etc, to avoid spi timing issues. the transport test is mandatory before using it for wifi or bluetooth. if spi has issues, how can any applications running over it work properly? |
there are 3 GPIOs, data ready, handshake and slave reset. once this is done, lower spi freq and try transport test. if rx and tx has different speeds or checksum errors, your test is failed. focus on spi timing tuning mentioned in porting guide then. |
Hey @luckzhang888 can you please try this patch for hci error?
|
I should see which document should check the SPI communication question |
The problem after patch is still the same ~# insmod esp32_spi.ko
I (28) boot: compile time Nov 5 2024 15:23:44 I (1171) FW_SPI: Using SPI interface I (2353) wifi:mode : sta (98:cd:ac:4c:43:70) I (2542) FW_MAIN: Get Tx power command |
~# [ 3191.520325] esp32_spi: process_rx_buf: SPI RX buf: IF type = 3 |
Hey @luckzhang888 Also please share complete log files for
|
can you take a look |
Hey @luckzhang888 |
Hey @luckzhang888 |
@luckzhang888 , How you can fix that? |
@Shreyas0-7 |
Hey @luckzhang888 ESP bt_rx request received ESP bt_tx reponse But we can no SPI RX hence we get As per the above mentioned request and replies, it seems like packets are dropped in SPI level. Could you please check porting guide and make sure your transport is okay, this is prerequisite before trying out WiFi or BT connections. |
I transplanted it according to this |
Hey @luckzhang888 |
@Shreyas0-7 |
Hey @luckzhang888 |
Checklist
How often does this bug occurs?
always
Expected behavior
hope spi can work properly
Actual behavior (suspected bug)
Burning ESP-Hosted-NG Release 1.0.2 firmware to ESP32-WROOM32D, a spi communication error occurs when the host loads the driver.
Error logs or terminal output
Steps to reproduce the behavior
NG host driver with ESP32
Project release version
ESP-Hosted-NG Release 1.0.2
System architecture
ARM 32-bit (Raspberry Pi 32-bit)
Operating system
Linux
Operating system version
ubuntu20.04
Shell
Bash
Additional context
No response
The text was updated successfully, but these errors were encountered: