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.

СС1310 UART strange behavior

Greetings. I am currently facing issue, which is pretty weird. I am playing with 6lowPAN wireless sensor network? based on cc1310s and ContikiOS. For debugging purpose I managed to setup Code Composer Studio as development environment for Contiki OS. Some time ago I was trying to raise RF baudrate and and UART speed, thus some hardware constants were changed. After that I rolled back to the Contiki default release with RF data rate 50kbps and UART baudrate 115200 bps. And now I am facing following issue: if my node is connected to debug session in CCS, everything goes ok and I can receive huge 22 kilobyte JSON through TCP and output it to the UART:

But if I stop debugging session that document will be received with distortions, as shown in the picture below.

 I am almost sure, that the problem is not connected with XDS110 serial port, because such a mess will happen even if I remove jumpers from RX and TX and connect to my nodes with external USB-to-UART converter. What is more weird, there is no matter how do I built firmware - with or without debug symbols, as well as with or without optimization. The funniest thing is I cant properly trace the problem, because when debug session is running, no bugs appear.

  • Investigated problem deeper. Modified http-example code like that:

    static void
    callback(struct http_socket *s, void *ptr,
             http_socket_event_t e,
             const uint8_t *data, uint16_t datalen)
    {
      if(e == HTTP_SOCKET_ERR) {
        printf("HTTP socket error\n");
      } else if(e == HTTP_SOCKET_TIMEDOUT) {
        printf("HTTP socket error: timed out\n");
      } else if(e == HTTP_SOCKET_ABORTED) {
        printf("HTTP socket error: aborted\n");
      } else if(e == HTTP_SOCKET_HOSTNAME_NOT_FOUND) {
        printf("HTTP socket error: hostname not found\n");
      } else if(e == HTTP_SOCKET_CLOSED) {
        printf("HTTP socket closed, %d bytes received\n", bytes_received);
      } else if(e == HTTP_SOCKET_DATA) {
    	printf("\r\n %d \r\n", datalen);
        for (int i = 0; i < datalen; i++) {
    		cc26xx_uart_write_byte('a');
    		//cc26xx_uart_write_byte(data[i]);
    	}
    	bytes_received += datalen;
      }
    }

    My logic analyzer output now: 

    The reason of corrupted symbols is interruption during transmittion. Tested my FW on 2 launchpads, still have no idea what to do. Can Anybody help me?

  • Still investigating that problem and still no result. Noticed, that values of timings, shown on the following picture, is constant independent of TCP MSS or the way that symbols transmitted. 

    Changing that my http-socket callback code this way:

    static void
    callback(struct http_socket *s, void *ptr,
             http_socket_event_t e,
             const uint8_t *data, uint16_t datalen)
    {
      if(e == HTTP_SOCKET_ERR) {
        printf("HTTP socket error\n");
      } else if(e == HTTP_SOCKET_TIMEDOUT) {
        printf("HTTP socket error: timed out\n");
      } else if(e == HTTP_SOCKET_ABORTED) {
        printf("HTTP socket error: aborted\n");
      } else if(e == HTTP_SOCKET_HOSTNAME_NOT_FOUND) {
        printf("HTTP socket error: hostname not found\n");
      } else if(e == HTTP_SOCKET_CLOSED) {
        printf("HTTP socket closed, %d bytes received\n", bytes_received);
      } else if(e == HTTP_SOCKET_DATA) {
            //CHANGE
    	for (int i = 0; i < 10; i++){
    		cc26xx_uart_write_byte('a');
    	}
            for (int i = 0; i < datalen; i++) {
    		cc26xx_uart_write_byte(data[i]);
    	}
    	bytes_received += datalen;
      }

    or even that way

    static void
    callback(struct http_socket *s, void *ptr,
             http_socket_event_t e,
             const uint8_t *data, uint16_t datalen)
    {
      if(e == HTTP_SOCKET_ERR) {
        printf("HTTP socket error\n");
      } else if(e == HTTP_SOCKET_TIMEDOUT) {
        printf("HTTP socket error: timed out\n");
      } else if(e == HTTP_SOCKET_ABORTED) {
        printf("HTTP socket error: aborted\n");
      } else if(e == HTTP_SOCKET_HOSTNAME_NOT_FOUND) {
        printf("HTTP socket error: hostname not found\n");
      } else if(e == HTTP_SOCKET_CLOSED) {
        printf("HTTP socket closed, %d bytes received\n", bytes_received);
      } else if(e == HTTP_SOCKET_DATA) {
            //CHANGE
    	for (int i = 0; i < 10; i++){
    		cc26xx_uart_write_byte('a');
    	}
            for (int i = 0; i < datalen; i++) {
    		cc26xx_uart_write_byte(data[i]);
    	}
            //CHANGE
    	for (int i = 0; i < 10; i++){
    		cc26xx_uart_write_byte('a');
    	}
    	bytes_received += datalen;
      }

    doesnt impact on values of those timings.