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.

CC3120: Application locked in sl_SendTo() function

Part Number: CC3120

Hello,
I am currently working on a project using the CC3120 with a third-party processor in a non-RTOS environment, using a GCC toolchain.
In this specific case, the CC3120 (CC3120BOOST) is in AP mode and serves as an UDP server.

The application has to send large data segments and breaks them down in different packets.

But it seems like after sending 3 times the data (3*29kByte), the host driver locks up in the sl_SendTo() function.
The IQR line is constantly high in this state.

I dont really know what went wrong....

Here are my firmware versions:
- PHY: 2.2.0.4
- NWP: 3.3.0.0
- ROM: 0.10.0.0
- Firmware: 2.0.0.0

Here is a minimal working example:

/*
* Build the header and send it to the peer
*/
const Int32 Max_Packet_Size = 1472;
// dummydata is a very large file, > 29 kBytes
const UInt32 picSize = sizeof(dummyData);
// Not a perfect fit? Just drop another packet at the end with the rest
const UInt32 packetCount = (picSize / Max_Packet_Size) + (picSize % Max_Packet_Size > 0);
const WiFiHeaderPayload appattributePayload =
{ .FollowingDataCount = packetCount, .Sensor1 = 0, .Sensor2 = 0 };


/*
    * Call sl_RecvFrom to fetch the clients's IP.
    */
char RxBuffer[10];
debug_print("Waiting for client to init connection...\n");

status = sl_RecvFrom(UDPSocket, RxBuffer, 10, 0, &(gWifi.clientSockAddr), &AddrLen);
if (status <= 0)
{
    debug_print("An error occurred on the first sl_RecvFrom\n");
    sl_Close(UDPSocket);
    return false;
}

debug_print("Client connected on socket: %d\nReceived: %s\n", UDPSocket, RxBuffer);

do
{
    /*
        * Send the packet header, informing about the size and other system states
        */
    status = sl_SendTo(UDPSocket, &appattributePayload, sizeof(WiFiHeaderPayload), 0,
            &(gWifi.clientSockAddr), AddrLen);if (status <= 0)
    {
        debug_print("An error occurred on the first sl_RecvFrom\n");
        sl_Close(UDPSocket);
        return false;
    }

    /*
        * Send the data
        */
    UInt32 i = 0;
    while (i < packetCount)
    {
        const UInt32 currentImgIndex = Max_Packet_Size * i;
        UInt32 packetSize = Max_Packet_Size;
        if (i == packetCount - 1)
        {
            packetSize = picSize % Max_Packet_Size;
        }
        status = sl_SendTo(UDPSocket, &(dummyData[currentImgIndex]), packetSize, 0,
                            &(gWifi.clientSockAddr), AddrLen);
        if (status <= 0)
        {
            debug_print("An error occurred.\n");
            sl_Close(UDPSocket);
            return false;
        }
        ++i;
    }
    debug_print("Sent %d packets with success\n", packetCount + 1);

    Millis_Sleep(1);

    // Only exit if we asked for it explicitly
} while(true);

Thank you in advance.