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.

send/receive packet

Other Parts Discussed in Thread: CC3100, UNIFLASH

Hi,

I have one send/receive packet issue.

I have ported cc3100 on TivaC 123 with free rtos.

I can send three packets to server continuously and get the correct data.

But I get the failed case like the below :

tcp socket open;

send packet 1;

recv packet 1;

send packet 2;  -> it's failed to send packet from this point.

recv packet 2;

It gets the error return at this code in drvier.c

/* we have indication that the last send has failed - socket is no longer valid for operations */
if(g_pCB->SocketTXFailure & (1<<(Sd & BSD_SOCKET_ID_MASK)))
{
      OSI_RET_OK_CHECK( sl_LockObjUnlock(&g_pCB->FlowContCB.TxLockObj) );
      return SL_SOC_ERROR;
}

Anyone knows why it's failed?

thanks
Gavin

  • Hi,

    If I understand,   cc3100 on TivaC is client,  which connected  successfully to the  server,  send packet, receive  packet , and failed with the seconds send.

    Can you sniff  the all session ?  ( from the first SYN )

    Does server is your implementation ? if yes, can you make sure server receive  the first packet correctly , and make sure server does not call close immediately?

    Regards

    Nir  

  • Hi Nir

    Yes, I made one test server on my local laptop and I'm sure that I can get the first data correctly and the server isn't closed until my test done.

    I find the cause of error return, that should be over the failed criteria of g_pCB->SocketTXFailure. I guess the algorithm should be if the SocketTXFailure over the criteria, the socket will be treated as the invalid and it can't work anymore.

    In my observation, g_pCB->SocketTXFailure is 0 at the bootup and it will be increased in some operations. In my test case, g_pCB->SocketTXFailure is 0x0A before the first send packet, and g_pCB->SocketTXFailure becomes 0x0B after the first receive packet, so the second send packet hits the criteria and gets the error return.

    May I know the design propose of g_pCB->SocketTXFailure and is it the necessary?

    thanks
    Gavin

  • Hi,

    Does your application use more than single socket ? what is the socket id you recieved ?

    If you remove the checking  g_pCB->SocketTXFailure at  _SlDrvDataWriteOp, does server recieve the second packet ?

    Can you sniff packets ?  

     Regards

    Nir

     

     

  • Hi Nir

    No, I only use one socket in my test case, and the socket ID is 0.

    If I remove the checking  g_pCB->SocketTXFailure at  _SlDrvDataWriteOp, and then the server can receive the second packet and the following packets.

    So I'd like to know if the checking  g_pCB->SocketTXFailure is the necessary item in cc3100 implementation?

    thanks

    Gavin

  • Hi Gavin,

    Does socket return 0 (ID)  ? (should be something else )

    The  g_pCB->SocketTXFailure is important, you should use  g_pCB->SocketTXFailure mechanism

    Pls increas stacks size ,  cc3100 driver stacks, application stack and try again , is it help ?

    Nir 

     

  • Hi Nir

    I'm sorry, the socket return is 0x10, not 0.

    Do you know how to increase cc3100 driver stack?

    I'm curious about one point, if I only increase the stack but not reset g_pCB->SocketTXFailure, g_pCB->SocketTXFailure still will hit the criteria in someday, right?

    thanks
    Gavin

  • Hi,

    locate all places, you use FREE RTOS create thread (xTaskCreate), increase usStackDepth

    Regards

    Nir 

  • Hi Nir

    I have increased the doubled usStackDepth in VStartSimpleLinkSpawnTask, but it can't help this issue.

    when g_pCB->SocketTXFailure is over 0x0a, the error return will occur there.

    I also verify the g_pCB->SocketTXFailure in the sample project of SDK 0.5, after several operations, g_pCB->SocketTXFailure will be 5 or 6. I guess the perfect case should be 0, right?

    Could you please have more comment about g_pCB->SocketTXFailure? Why it is important in cc3100 implementation? 

    thanks
    Gavin 

     

  • Hi,

    I will call you offline.

    Meanwhile, can you let me know the version you use, call the following code after sl_start  

    SlVersionFull ver;

    unsigned long

    statusWlan;

    unsigned char

    pConfigOpt, pConfigLen;

    pConfigOpt = SL_DEVICE_GENERAL_VERSION;

     

    sl_DevGet(SL_DEVICE_GENERAL_CONFIGURATION,&pConfigOpt,&pConfigLen,(

    unsigned char

    *)(&ver));

    printf(

    "CHIP %d\nMAC 31.%d.%d.%d.%d\nPHY %d.%d.%d.%d\nNWP %d.%d.%d.%d\nROM %d\nHOST %d.%d.%d.%d\n"

    ,

    ver.ChipFwAndPhyVersion.ChipId,

    ver.ChipFwAndPhyVersion.FwVersion[0],ver.ChipFwAndPhyVersion.FwVersion[1],

    ver.ChipFwAndPhyVersion.FwVersion[2],ver.ChipFwAndPhyVersion.FwVersion[3],

    ver.ChipFwAndPhyVersion.PhyVersion[0],ver.ChipFwAndPhyVersion.PhyVersion[1],

    ver.ChipFwAndPhyVersion.PhyVersion[2],ver.ChipFwAndPhyVersion.PhyVersion[3],

    ver.NwpVersion[0],ver.NwpVersion[1],ver.NwpVersion[2],ver.NwpVersion[3],

    ver.RomVersion,

    SL_MAJOR_VERSION_NUM,SL_MINOR_VERSION_NUM,SL_VERSION_NUM,SL_SUB_VERSION_NUM);

    Thanks

    Nir

     

  • Hi Nir

    Please refer to the attached screenshot

    HOST: 0.0.5.1

  • Hi,

    I am interesting with NwpVersion , it`s not reasonable values, you may need to refresh it,  or can you check it with SimpleLinkStudio environment ?

    Regards

    Nir

     

  • Hi Nir

    I don't know why I can't init cc3100 in SimpleLinkStudio environment, I don't debug it.

    Where can I get the latest binary to reflash? with uniflash?

    BTW, I use cc3100 bp 2.0B.

    thanks
    Gavin

  • Hi,

    Pls send me, the version you can see on the top of the chip.

    Regards

    Nir

     

  • Hi Nir

    XCC3100GZ

    thanks

    Gavin

  • Gavin,

    The board version you have was intended for early access development.  We highly recommend you get an updated board to use with the latest SDK and tools.

    It is possible to use Uniflash and upgrade the board you have and test out again, however, Uniflash currently does not support service pack upgrade.

    I will make an announcement this Friday or beginning of next week for a new Uniflash version that supports service pack upgrade.

    Shlomi

  • Hi Shlomi

    About this issue, I'm still interesting in g_pCB->SocketTXFailure. 

    Could you please provide more debug information about this counter?

    Or everything will be fine in the latest board?

    thanks

    Gavin

  • Hi Gavin,

    Please note I'm going to announce this week a new Uniflash version that is going to support ServicePack programming (along with some other improvements). I suggest then that you upgrade your board and it should work fine.

    Regarding g_pCB->SocketTXFailure, it is not a counter but a bit mask per socket. It belongs to the flow control mechanism on the TX side. If you have any error on the socket (for example sl_socket fails or you get a disconnect from other side), you should have the corresponding bit set to 1.

    Regards,

    Shlomi