Missing Card Interrupts when KSO disabled

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

cross mob
nima
Level 1
Level 1
5 replies posted 5 sign-ins First solution authored

Hi,

We are testing WHD with Sterling-LWB5+ (CY4373E) and we have the following issue. In whd_wifi_on() country code setting fails and we get "Could not set Country code" error.

Tracing shows that whd_thread_func() puts the device to sleep (KSO disable) and takes the transceiver semaphore with timeout CY_RTOS_NEVER_TIMEOUT. After this point,  the card interrupts are missed and there is no activity on the wifi task.

To test that the issue is with card interrupts when KSO is off, we have tested the following case. We used whd_ensure_wlan_bus_is_up() in the main task loop and set CY_RTOS_NEVER_TIMEOUT to, for example, 10ms so that we are periodically waking up the device. Then, the card interrupts are received and the country code setting succeeds. Also, whd_wifi_on() completes successfully. We have tested with WHD v2.0.0 and v1.94.0.

What could be the root cause for this issue and how could we mitigate it?

Thanks,

Nima

0 Likes
1 Solution
nima
Level 1
Level 1
5 replies posted 5 sign-ins First solution authored

The issue is resolved by using the HOST_WAKE pin. The device is woken up from sleep by the interrupts received through HOST_WAKE.

View solution in original post

0 Likes
6 Replies
Rakesh_BG
Moderator
Moderator
Moderator
50 solutions authored 100 replies posted 100 sign-ins

Hi @nima ,

"Could not set Country code" implies that the country code that you are trying to set doesn't exist in the .clm_blob that you are using. Could you try with one of the country code which is present in clm_blob and check if the issue gets resolved?

Thanks

 

0 Likes
nima
Level 1
Level 1
5 replies posted 5 sign-ins First solution authored

I have tried with the following country codes:

  • WHD_COUNTRY_UNITED_STATES
  • WHD_COUNTRY_UNITED_KINGDOM
  • WHD_COUNTRY_AUSTRALIA
  • WHD_COUNTRY_SWEDEN
and I got the same error.
 
How could I confirm that the country code exists in the clm_blob?
 
While the error for all of the above country codes is the same, the trace looks different. In case of US, there is 5 seconds (WHD_IOCTL_TIMEOUT_MS) silence before the error message, but for Sweden the error is returned immediately. It seems that even for supported country codes, we get the same error when the card interrupts are missed.
0 Likes
Rakesh_BG
Moderator
Moderator
Moderator
50 solutions authored 100 replies posted 100 sign-ins

Hi @nima ,

Can you share the clm_blob file you are using.

Thanks

0 Likes
nima
Level 1
Level 1
5 replies posted 5 sign-ins First solution authored

Hi @Rakesh_BG ,

Another evidence that the issue is not about unsupported country codes is the following workaround. If we add a delay after sending packets in whd_thread_func, then the country code is successfully set. We can even do the scan afterwards.

I think the reason is that the delay changes the execution pattern, and the device is no longer put to sleep during country code setting. Please see attached some screenshots of the traces.card_interrupt.PNG

0 Likes
nima
Level 1
Level 1
5 replies posted 5 sign-ins First solution authored

The issue is resolved by using the HOST_WAKE pin. The device is woken up from sleep by the interrupts received through HOST_WAKE.

0 Likes