Closed mdeneen closed 1 month ago
Just for fun, I set the bus-width to 1 in my device tree and experienced the same result.
@kapilkedawat ++
Some more notes / questions:
The bootstrap pins MTMS and MTDI are floating on our board. Are these signals used only for SDIO boot or are they also used to tune SDIO communication?
the question is are you through with the porting process? Your earlier kernel crash was in cmd_set_ip_address.
For your question,
The bootstrap pins MTMS and MTDI are floating on our board. Are these signals used only for SDIO boot or are they also used to tune SDIO communication?
For esp32-c6 , it is not needed. there is no conflict between the SDIO interface and the bootstrap process, unlike esp32.
We recommend using pcb for sdio. As it greatly avoids signal integrity issues.
As long as the wire used as tiny(<5cm), equal length for all signals, and expected pull-ups are in place, we are good.
The issue focus is still unclear although. Can you explain current issue you face and logs both sides?
Hi Yogesh,
Yes, I have gone through the porting process and I was sometimes able to use it to connect to an AP and ping the AP itself -- the cmd_set_ip_address does not always crash.
Our esp32-c6 is on the PCB with the required pull-ups:
You can see that the esp32-c6 is very close to the IMX93 -- maybe even less than 1cm away. You can see one pull-up, for CMD, on the top of the board. The other four are on the bottom:
Both SPI and SDIO are connected, as we are hoping to use SDIO but can also use SPI if needed. I'll gather logs from both ends today, but, in the mean time, this is what happens on the host side when any meaningful amount of data is sent over the SDIO interface:
root@imx93:~# iperf -c 192.168.2.10 -p 8000
Client connecting to 192.168.2.10, TCP port 8000 TCP window size: 85.0 KByte (default)
[ 3] local 192.168.2.31 port 35710 connected with 192.168.2.10 port 8000
<3>[60133.607379] mmc2: sdhci: Resp[0]: 0x00001000 | Resp[1]: 0x00000000 <3>[60133.607382] mmc2: sdhci: Resp[2]: 0x00000000 | Resp[3]: 0x00000000 <3>[60133.607385] mmc2: sdhci: Host ctl2: 0x00000000 <3>[60133.607389] mmc2: sdhci: ADMA Err: 0x00000003 | ADMA Ptr: 0x847c6204 <3>[60133.607392] mmc2: sdhci-esdhc-imx: ========= ESDHC IMX DEBUG STATUS DUMP ========= <3>[60133.607395] mmc2: sdhci-esdhc-imx: cmd debug status: 0x3100 <3>[60133.607399] mmc2: sdhci-esdhc-imx: data debug status: 0x32a0 <3>[60133.607402] mmc2: sdhci-esdhc-imx: trans debug status: 0x33a2 <3>[60133.607405] mmc2: sdhci-esdhc-imx: dma debug status: 0x3400 <3>[60133.607409] mmc2: sdhci-esdhc-imx: adma debug status: 0x35b4 <3>[60133.607412] mmc2: sdhci-esdhc-imx: fifo debug status: 0x3680 <3>[60133.607415] mmc2: sdhci-esdhc-imx: async fifo debug status: 0x3750 <3>[60133.607418] mmc2: sdhci: ============================================ [ ID] Interval Transfer Bandwidth [ 3] 0.0-10.3 sec 107 KBytes 85.3 Kbits/sec root@imx93:~# wlan0: CTRL-EVENT-DISCONNECTED bssid=24:5a:4c:13:af:69 reason=3 locally_generated=1 <3>[60138.727338] esp32_sdio: wait_and_decode_cmd_resp: Command[0x6] timed out <3>[60138.727363] esp32_sdio: cmd_disconnect_request: wait_and_decode_cmd_resp(priv, cmd_node) failure, ret: -22 root@imx93:~# <3>[60143.851336] esp32_sdio: wait_and_decode_cmd_resp: Command[0xF] timed out <3>[60143.851361] esp32_sdio: cmd_get_tx_power: wait_and_decode_cmd_resp(priv, cmd_node) failure, ret: -22 <3>[60143.851563] esp32_sdio: prepare_command_request: command queue init is not done yet <3>[60143.851579] esp32_sdio: cmd_get_tx_power: Failed to get command node
I also want to mention that I was looking at MTMS / MTDI to see if I was, perhaps, not treating them as they should be treated.
Yogesh,
I have identified the problem and we can close out this issue. The esp32-c6 is powered by a 500mA linear regulator and it is not strong enough to handle 20 dBm TX. I have reduced the ESP_PHY_MAX_TX_POWER in the sdkconfig and everything is working now. The behavior was unpredictable when the voltage dropped, and it didn't drop far enough for the brown out detection to kick in.
For now we will reduce the max TX power, but in the future the linear regulator will be beefed up.
Oh this looks concerning.
It will try to involve the phy team for this. Btw, in sure you would have taken care, but is the input power sufficient?
I got the update from physical team on this.
If they use C6 module, we recommend the power supply current of module is not less than 500 mA. Following table is the Wi-Fi power consumption of C6-WROOM-1 module.
Also,
If the antenna matching circuit is mismatch, it will impact the RF PHY power. When user use ESP chip on board design, they should do antenna matching test or send the board to our RF test lab to verify it.
I am not entirely sure, but I sense the linear regular and antenna design might also be play some role here? I am not deep down into electronics. But let me know if something is to be done with above response from either side.
We are using a module:
The antenna connector you see in the photo is for a GPS; it is not related to the esp32-c6 module.
Are you suggesting that there is additional impedance matching to be done in this case?
At the moment we are looking at replacing the 500Ma linear supply with either 800mA or 1A, but I'm quite interested in knowing if we should be doing additional RF design or if perhaps we should be disabling 802.11b and g.
Checklist
How often does this bug occurs?
often
Expected behavior
I expected the OS to detect a card and interface with the esp-hosted sdio driver, providing a wlan0 interface.
Actual behavior (suspected bug)
When inserting the driver, the kernel sometimes oopses. The board is based on an imx93 reference design, with an esp32c6 mounted on the PCB (read: trace lengths are equal in length and very short).
I also modified cmd_set_ip_address to print out some debug between each line of code. It oopses right away, so either
priv
orpriv->adapter
point to garbage. It seems like the function shouldn't even be called for thelo
interface, and that may be part of the problem.Error logs or terminal output
Steps to reproduce the behavior
modprobe esp32_sdio resetpin=608 ip link set up wlan0 wpa_supplicant -c /etc/wpa_supplicant.conf -i wlan0& udhcpc -i wlan0
Project release version
20d939491fb20841ae0b56221f249be02ad0ac69
System architecture
other (details in Additional context)
Operating system
Linux
Operating system version
Yocto 6.6 (scarthgap), kernel 6.6.23
Shell
Bash
Additional context
[ 91.934627] esp32_sdio: probe of mmc2:0001:2 failed with error -22
looks suspicious to me, as does attempting to do things in the esp_sdio driver when the loopback interface receives a link event.I seem to have the ability to influence the behavior by messing around with clockspeed parameter.
One thing to note is that my reset pin controls the power supply to the esp32c6 chip. I've modified the reset logic to turn off the supply, turn it back on, and leave it on instead of toggling it and returning it to an input.