- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The issue is resolved by using the HOST_WAKE pin. The device is woken up from sleep by the interrupts received through HOST_WAKE.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have tried with the following country codes:
- WHD_COUNTRY_UNITED_STATES
- WHD_COUNTRY_UNITED_KINGDOM
- WHD_COUNTRY_AUSTRALIA
- WHD_COUNTRY_SWEDEN
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The issue is resolved by using the HOST_WAKE pin. The device is woken up from sleep by the interrupts received through HOST_WAKE.