This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

recv blocking issue

Hi,

I got recv blocking issue on cc3000.

Basically, the recv function is workable, but sometimes it will be blocked infinitely.

In my case, after several of recv/send bytes, it's blocked in 

---------------------------------------------

hci_event_handler(void *pRetParams, unsigned char *from, unsigned char *fromlen)
{

...

while (1)
{
if (tSLInformation.usEventOrDataReceived != 0)     <--- block here
{
...

-------------------------------------------

The reason should be "tSLInformation.usEventOrDataReceived == 0", but I have checked the server side has sent the packet.

And it's very easy to reproduce.

Why it's blocked infinitely?

thanks

Gavin

  • Hi Gavin,

    Can you please tell me the version of the Service Pack and the SDK that you are using? Can you please print the events that are received by the host in evnt_handler.c? That is inside the function hci_event_handler.

    Besides that, please note that recv and recvfrom functions involve receiving 2 back to back events from the CC3000. One event indicating the the command complete and the other for the actual data. Please refer to the below link which discusses a potential cause for this issue :
    http://e2e.ti.com/support/wireless_connectivity/f/851/p/350566/1228700.aspx#1228700

    Thanks & Regards,
    Raghavendra

  • Hi Raghavendra

    I use SDK 1.11 and SP 1.11.7.13.19. I try to print out the event log as your suggestion.

    I check the release note and get the below:

    Version 1.11:

    Network "recvfrom" caused unpredicted system behavior when no data was received. This issue was introduced in V.1.10.2
    Network Added command complete for "bsd_sendto" and "bsd_send" in order to solve race conditions where send/to followed by recv/from is invoked - This fix REQUIRES both patches and host driver updated to V1.11

    I guess there are the solutions in my current SP,right?

    How do I make sure I have these solution?

    thanks

    Gavin

  • Hi Raghavendra

    I check the last opcode that host got, it's always stuck on HCI_EVNT_DATA_UNSOL_FREE_BUFF.

    Does it mean there is no enough buffer for cc3000? Did you meet these memory management issue before?

    thanks

    Gavin