CY43012 cyhal_sdio_bulk_transfer failed

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
PIHL
Level 3
Level 3
25 sign-ins 10 replies posted 10 sign-ins

Hello,
I am working on a project with custom board featuring CY43012 radio chip. I try to start a WIFI access point using my device.

I ported WHD library, and have SDIO part working. The firmware is being uploaded to CY43012, firmware starts, then I have succesfull communication with device (write/read to function 2).

Unfortunately my program aways fails at the same moment during execution.
The parts not working are sending data with SDIO on:
/* Register for interested events */
/* Set the SSID */
/* Set the passphrase */

In that parts of code I get an error:
whd_bus_sdio_cmd53:874 cyhal_sdio_bulk_transfer SDIO_BYTE_MODE failed
cyhal_sdio_bulk_transfer SDIO_BYTE_MODE failed
Error during SDIO receive, whd_bus_sdio_read_frame failed at 615
ioctl_sleep timeout
Command failed in whd_wifi_init_ap at 382
Command failed

After running whd_cdc_send_ioctl() function.

I connected a scope to my board and figured out that before firmware upload the data lines are on high state when not used. After uploading firmware It switches to low state. After writing data to device with BLOCK MODE the inactive state of data lines are going back to high. After that the next command execution fails.

Do you have any ideas what might be an issue?

Thanks,
Piotr

0 Likes
1 Solution
PIHL
Level 3
Level 3
25 sign-ins 10 replies posted 10 sign-ins

I found an issue with my implementation of cyhal_sdio_bulk_transfer function. By code error I was rounding down the block count number when the result was not a natural number.

View solution in original post

0 Likes
4 Replies
Aditi_B
Moderator
Moderator
Moderator
500 replies posted 5 questions asked 250 replies posted

Hi,

From your response, I understand that the bringup is successful, but the code is failing at the time of execution, right? can you attach some logs to get a better picture?

Thanks

Aditi

0 Likes
PIHL
Level 3
Level 3
25 sign-ins 10 replies posted 10 sign-ins

Hi,

the bringup works fine, but I can not start the Access Point. Writing SSID in whd_wifi_init_ap() function fails.

the console log of execution:

WLAN MAC Address : 48:EB:62:E3:EA:20
WLAN Firmware : wl0: Sep 9 2020 01:22:10 version 13.10.271.253 (c4c4c7c CY) FWID 01-79301bec
WLAN CLM : API: 18.2 Data: 9.10.0 Compiler: 1.36.1 ClmImport: 1.34.1 Creation: 2020-09-09 01:19:03
WHD VERSION : v1.93.0 : v1.93.0 : GCC 9.3 : 2020-12-21 13:24:03 +0530
failed transfer, retry attemptwhd_bus_sdio_cmd53:874 cyhal_sdio_bulk_transfer SDIO_BYTE_MODE failed
cyhal_sdio_bulk_transfer SDIO_BYTE_MODE failed
Error during SDIO receive, whd_bus_sdio_read_frame failed at 615
ioctl_sleep timeout
SDIO bus failed to come up , whd_kso_enable failed at 1208
SDIO bus failed to come up , whd_ensure_wlan_bus_is_up failed at 944
SDIO bus failed to come up , whd_kso_enable failed at 1208
SDIO bus failed to come up , whd_ensure_wlan_bus_is_up failed at 944
Could not bring bus back upioctl_sleep timeout
Command failed in whd_wifi_init_ap at 398
Command failed

 

Additionally I added a simple test before and after this error: 

testResult = whd_bus_sdio_read_register_value(whd_driver, BUS_FUNCTION, 0x02, 0x02, &value);

In both cases, before and after cyhal_sdio_bulk_transfer failiure testResult is 0, but the value is received from device only before the error.

0 Likes
PIHL
Level 3
Level 3
25 sign-ins 10 replies posted 10 sign-ins

Hello,

I also changed the WHD library to the newest version. It didn't change a lot. I still get an error while setting up an access point or while I try to scan local networks. Console log:

WLAN MAC Address : 48:EB:62:E3:EA:20
WLAN Firmware : wl0: Apr 26 2021 04:04:15 version 13.10.271.265 (aa096f9 CY) FWID 01-29e05f8
WLAN CLM : API: 18.2 Data: 9.10.0 Compiler: 1.36.1 ClmImport: 1.34.1 Creation: 2020-09-09 01:19:03
WHD VERSION : v1.94.0 : v1.94.0 : GCC 9.3 : 2021-04-27 16:54:34 +0800

Info: Scanning without any filter

----------------------------------------------------------------------------------------------------
# SSID RSSI Channel MAC Address Security
----------------------------------------------------------------------------------------------------
failed transfer, retry attemptwhd_bus_sdio_cmd53:869 cyhal_sdio_bulk_transfer SDIO_BYTE_MODE failed
Function whd_bus_sdio_abort_read failed at line 1041 checkres = 33555501
Error during SDIO receive, whd_bus_sdio_read_frame failed at 612
Function whd_wifi_scan failed at line 2317 checkres = 101580800

 

Additionally I tested writing register to BUS_FUNCTION. Before this error the operation is possible, but not after the error. 

whd_bus_sdio_write_register_value(whd_driver, BUS_FUNCTION, 0x02, (uint8_t)1, 0);
whd_bus_sdio_read_register_value(whd_driver, BUS_FUNCTION, 0x02, (uint8_t)1, &value);

0 Likes
PIHL
Level 3
Level 3
25 sign-ins 10 replies posted 10 sign-ins

I found an issue with my implementation of cyhal_sdio_bulk_transfer function. By code error I was rounding down the block count number when the result was not a natural number.

0 Likes