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.

RTOS/CC2650: UART_READ doesn't get the whole string

Part Number: CC2650

Tool/software: TI-RTOS

Hi,

I have an application where I'm connecting a SIM5320 GSM modem using UART to the processor. When the GSM module gets ON I get some initialization message from the module that is OK. After that I send a AT command and then listening to the port to get answer from module. For the commands that the response is short string everything is OK. As and example I send AT+CREG? and I get:

+CREG: 0,0
OK

that is exactly what I supposed to get. But the issue is for cases that the response should be longer. for example when I send AT+CGPSINFOCFG I'm supposed to get:

+CGPSINFO: (0-255),(0-31)
OK 

but I just get the partially the first line: 

+CGPSINFO: (0

I'm pretty sure that the module working well since when I connect it directly to the computer using serial everything is OK.

I tried to remove the System_flush() (after getting each char from serial) from my code to see if it gets the whole response but still I don't get the whole string.

I checked different commands with long response and I noticed I'm getting 31 char and the rest is missed. 

I put my code here:

char msg_write[]="AT+CGPSINFOCFG=?\r"; // To hold the message
        UART_write(uart, msg_write, sizeof(msg_write)-1);
        uint32_t t0=Seconds_get();
//        while (idx<140) {
        while (flag2) {
       		UART_read(uart, &input, 1);
       		msg_read[idx++]=input;
       		System_printf("%c",input);
       		System_flush();
			if ( strstr(msg_read,"OK") != NULL ) {
				flag2=false;
				System_flush();	
			}
			msg_read[0] = '\0'; // clears message
			idx=0;
       	}
        msg_read[idx]='\0';
        //System_flush();
        System_printf("%s",msg_read);
        System_flush();

  • Hello Asad,

    I suspect the UART is not configured correctly and/or you are not handling longer reads. As you might have suspected, 31 bytes is the depth of the FIFO. Hopefully this is enough of a clue to look further with the debugger.

    Best wishes
  • I checked other baud rates, it seems that I'm getting the overflow in FIFO in 115200. I tried 9600 baud rate and I'm getting the the full string.
    I think there is something wrong with the serial since the CC2650 should support at least 115200 as baud rate.

    Do you have any idea about it?
    How I can increase the FIFO. I'm using blocking mode in UART config. Do you think callback mode will solve the issue?

    Asad.