Have you read the comment on the code?
/* This is the first time that the WLAN chip is required to respond
* in it's normal run mode.
* If you are porting a new system and it stalls here, it could
* be one of the following problems:
* - Bus interrupt not triggering properly - the WLAN chip is unable to signal the host that there is data available.
* - Timing problems - if the timeouts on semaphores are not working correctly, then the
* system might think that the IOCTL has timed out much faster than it should do.
I am sure bus interrupt and semaphore timeout working correctly.
command "apsta" and "country" both use wiced_send_iovar to send.
and interrupt will happen when sending "apsta", so it return WICED_SUCCESS
but "country" fail.
The set country IOVAR will take a relatively long period of time (50+ms) and so you should also investigate if your microprocessor is sleeping or going into a low power state. It may not reach such a state previously as most other IOVARs are responded to immediately.
microprocessor is not sleeping or low power state.
I found there is no interrupt after "country" command, but "apsta"
I have tried polling F2 wlan fifo, but only 4 byte zero until 400ms timeout.
Any method to make sure wifi chip work correctly?
After replacing wifi chip, the problem is solved.
Thanks for letting us know
I have this identical error among multiple boards. I'm curious, was the chip you replaced of different revision?
I am not sure they are the same thing, but provider say they are the same.
I will check that later.