esp-hosted icon indicating copy to clipboard operation
esp-hosted copied to clipboard

Porting to ATSAMA5D over SDIO: wait_and_decode_cmd_resp: Command[4] timed out

Open guidogiunchi opened this issue 1 year ago • 9 comments

Hi! I'm trying to port the ng version to the ATSAMA5D27, specifically to the acme roadrunner SoC over SDIO mmc0. I managed to get the hw part working fine using the commit 77aec01, both on esp and linux, using kernel 5.15.92.

The only modifications done to this point are adding kprint to track the module while it runs its functions, not more.

The esp32 is working, I see all the SDIO regs being written and read (0x3ff55060, 0x3ff55058...) and the interface is brought up using

sudo ifconfig espsta0 up

but on

sudo iw dev espsta0 scan

it times out, as if the host is not receiving SDIO interrupts or similar via wait_event_interruptible_timeout

The ESP32 gets the command and dutifully reports the scan start scan over uart.

The kernel log ends with

> [...]
> cmd_scan_request
> prepare_command_request
> get_free_cmd_node
> esp_alloc_skb, len: 2048
> esp_alloc_skb, skb_ptr: 34030614
> queue_cmd_node
> wait_and_decode_cmd_resp
> esp_cmd_work
> esp_get_adapter
> esp_get_adapter
> esp_send_packet
> esp_send_packet: success, skb len 64
> esp32_sdio:wait_and_decode_cmd_resp: Command[4] timed out
> recycle_cmd_node
> reset_cmd_node
> esp32_sdio:cmd_scan_request: esp32: wait_and_decode_cmd_resp(priv, cmd_node) failure, ret: -22

I checked that the interrupts are coming through, via cat /proc/interrupts running the scan function takes

           CPU0
 21:        308  atmel-aic5  31 Level     mmc0

to

           CPU0
 21:        310  atmel-aic5  31 Level     mmc0

So the interrupts are being received from the SDIO..

I am trying to understand what the problem might be, it is almost working, can you help me solve this issue please?

Thank you! Guido

guidogiunchi avatar Jul 19 '23 15:07 guidogiunchi