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.

CC3200: Stream 64 bytes ADC values to web browser, the MCU reboot itself

Part Number: CC3200

Hi team,

One customer is using CC3200 in smartplug, they want to stream the ADC values to the web browser though the get token, but they found that if they put more than 64 bytes in the return ptr the MCU will reboot itself. They want to know can this limitation be waived? Or are there any suggestion and comments for the issue?

Thanks a lot.

  • Hi David,

    Changing a pointer should not cause the MCU to reboot.

    1. Where in the code is this occurring?

    2. What location are you writing to?

    3. What error messages are you seeing?

    Best regards,
    Sarah

  • Hi Sarah,

    I was testing the http server with some dummy data. using the code below. I have also change the size of _slHttpServerString_t.len from _u8 to _u32, but still not work. Am I missing something?

    void SimpleLinkHttpServerCallback(SlHttpServerEvent_t *pSlHttpServerEvent,
                                      SlHttpServerResponse_t *pSlHttpServerResponse)
    {
        switch (pSlHttpServerEvent->Event)
        {
            case SL_NETAPP_HTTPGETTOKENVALUE_EVENT:
            {
                unsigned char *ptr;
    
                ptr = pSlHttpServerResponse->ResponseData.token_value.data;
                pSlHttpServerResponse->ResponseData.token_value.len = 0;
    
    
                unsigned short sTempLen = 0;
                unsigned short sTempChar = 0;
    
    
                if(chv1 = memcmp(pSlHttpServerEvent->EventData.httpTokenName.data,GET_token_A, strlen((const char *)GET_token_A)) == 0)
                {
    
                    unsigned short i ;
                    char dest[6] = "";
                    for(i=0;i<10;i++){   //i < 10 works, but when i ~50, it return Unknown Token.
    
    
                        dest[0] = '1';
                        dest[1] = '2';
                        dest[2] = '3';
                        dest[3] = '4';
    
                        sTempChar = 4;
                        memcpy(ptr+sTempLen,dest,sTempChar);
                        sTempLen += sTempChar;
                        ptr[sTempLen++] = ',';
    
                        debug_fprint("%d %d %s %d %d %d \r\n",ch, i, dest, sTempChar, ptr, sTempLen);
    
                    }
    
                    pSlHttpServerResponse->ResponseData.token_value.len += sTempLen;
    
                }
            }
        }
    }