espressif / esp-hosted

Hosted Solution (Linux/MCU) with ESP32 (Wi-Fi + BT + BLE)
Other
706 stars 169 forks source link

esp_sdio驱动加载失败, #291

Closed liuyuaaa closed 11 months ago

liuyuaaa commented 11 months ago

image image 使用树莓派3b与esp32相连接,./rpi_init.sh sdio执行后,未见到主设备号为221的字符设备生成 0e71fbe7c1e6df83ead534891fb01d0

mantriyogesh commented 11 months ago

Hello @liuyuaaa

Thank you for the logs and setup image. I think the wires are very long still.

Can you please get ESP logs, Host logs (dmesg, rpi_init.sh command run and output) in textual form? Can you please also try 1bit sdio mode : https://github.com/espressif/esp-hosted/issues/269#issuecomment-1780697351, which should face less signal integrity issues?

liuyuaaa commented 11 months ago

这是ESP32的logs, 还有Host的logs (dmesg, rpi_init.sh) dmesg.log ESP.log rpi_init.sh.log

liuyuaaa commented 11 months ago

我尝试了1bit sdio模式,在树莓派/boot/config.txt文件添加了dtoverlay=sdio,poll_once=off,bus_width=1,现象是一样的,还需要修改其他的吗

mantriyogesh commented 11 months ago

I assume this is 4 bit mode logs you had shared. Checked the logs. Logs as such are clean.

The jumper wire length is very big, need to make them smaller, else you would face such issues.

Screenshot 2023-11-30 at 10 37 39 AM

mantriyogesh commented 11 months ago

Also, worth to reduce clock frequency (along with smaller wires). Uncomment: https://github.com/espressif/esp-hosted/blob/ce3c50a33fa4bc562a1b6cbcee292c1ae0b0a404/esp_hosted_fg/host/linux/host_driver/esp32/sdio/esp_sdio.c#L714-L718

This is a common issue with jumper cables. If you can make PCB and use SDIO, will be better and SDIO signal integrity issues would not be faced. I hope the external pull-ups are already in place. Check the https://github.com/espressif/esp-hosted/blob/master/esp_hosted_fg/docs/Linux_based_host/porting_guide.md

Alternatively, if you just wish to evaluate, you can use SPI transport instead of SDIO, which is very simple to test, with jumper cables.

ESP and host code compatibility

liuyuaaa commented 11 months ago

我们尝试了以下几点: 1,我们又重新飞线,缩短至3cm,上拉电阻为20k 2,Linux host 版本切换到了0.0.5 3,sdio的时钟频率已降到了5MHz

rpi_init.sh执行后,结果没有变化。

liuyuaaa commented 11 months ago

我们测量发现data2管脚(esp32 gpio12)的电压为2.4v,其他data管脚为3.3v,这一点有没有影响。 image 是不是因为内部下拉影响了这个管脚

mantriyogesh commented 11 months ago

Worth checking: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/sd_pullup_requirements.html

search for 'Conflicts Between Bootstrap and SDIO on DAT2'

liuyuaaa commented 11 months ago

感谢,问题解决了。 我们测试了sdio的1 bit mode,ESP32是可以正常工作的。这样可以看出data2和data3出问题了,后来发现data2管脚接错了,重新焊接测试下就行了。

mantriyogesh commented 11 months ago

@liuyuaaa: Sure.. Thank you for the update! I hope you get 4 bit mode also running (possibly on PCB)

翻译 Translation for above post: Just for someone landing on this page, the 1 bit mode is working fine now, Problem was that, dat2 was incorrectly soldered.

mantriyogesh commented 11 months ago

@liuyuaaa Can we close this issue?