Skip to content
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

WILC3000 problems with PI CM3 #103

Open
bwasim opened this issue Aug 31, 2020 · 0 comments
Open

WILC3000 problems with PI CM3 #103

bwasim opened this issue Aug 31, 2020 · 0 comments

Comments

@bwasim
Copy link

bwasim commented Aug 31, 2020

While interfacing the WILC3000 chip with CM3 module, we saw SDIO bus failures

[   10.710063] wilc_sdio mmc2:0001:1: SDIO speed: 25000000
[   10.710174] wilc_sdio mmc2:0001:1: wilc_sdio_cmd52..failed, err(-110)
[   10.710182] wilc_sdio mmc2:0001:1: Fail cmd 52, enable csa...
[   10.710192] wilc_sdio mmc2:0001:1 wlan0: ERR [wilc_wlan_initialize:905] Initializing WILC_Wlan FAILED
[   10.710200] wilc_sdio mmc2:0001:1 wlan0: ERR [wilc_mac_open:1029] Failed to initialize wilc

Debugging the problem revealed the following possible issues in the driver,

  • The Wilc driver tries to access the SD registers (via call to wilc_sdio_init) after successfully calling the wilc_wlan_power_on_sequence function. However, it is possible that the WiFi chip isn't ready yet to respond to SD commands. Therefore, we should retry the first SD command multiple times before calling it quits. See https://github.com/cloudyourcar/attentive/blob/master/src/modem/sim800.c#L168 for reference where the Host MCU sends the "AT" command multiple times to the SIM80x modem to check if it has established a valid connection with the modem. If the modem doesn't respond after certain attempts, the driver assumes that the chip is either down or there is some issue in the UART driver and exits.
  • It was observed that the wilc_wlan_power function acquires the RE / EN gpios, sets them to output and then releases these GPIOs. However, releasing these GPIOs is not safe because it means that anyone else can then acquire these GPIOs and turn off the WiFi chip. Therefore, the state of GPIO cannot be guaranteed once the pins are released.
  • Though this does not have any valid explanation, but we had to comment out the code which sets the RE pins to low in the wilc_wlan_power function. If we add this code back, the WiFi chip fails to respond to SD commands in-spite of our fixes mentioned above.

Looking through the reported issues, it seems that we are not the first people who see these or similar issues and its best that these get resolved in the WILC mainline. Otherwise we have to maintain per-release patches which is a maintenance nightmare.

@bwasim bwasim changed the title WILC3000 problems when interfacing with PI CM3 WILC3000 problems with PI CM3 Aug 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant