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.

tm4c123gh6pm - can't read more than 8 characters from memory

Other Parts Discussed in Thread: TM4C123GH6PM

I am working with the TM4C123GH6PM and trying to store and recall incoming characters sent over UART. My UART is working perfectly and as I debug I can see each character being stored into memory. However, as I attempt to recall my stored data from the cstring it only gives me the first 8 characters and shows the rest as garbage even though I can see them in memory using the "veiw memory" feature in CCSv6. I am getting this same problem when I make my cstring dynamic or non-dynamic. How do I access all of what is being sent in and stored?

Here are the relevant parts of my code. Note that this is all within my UART3 Handler and I am sending the following string out of UART3.

char str3[] = "dtest11-2222222-";

Hear is what I observe in CCSv6 in debug mode as I step through the loop that stores the characters to strDATA:

My logic analyzer shows the following results. Notice that I am sending the message through UART3 and Receiving it via UART1.

  • I think you will find that "sizeof(strDATA)" is 8.  That is your problem.  You need another way to determine how many characters to pull from RAM.

  • Marshall Folkman said:
    My logic analyzer shows the following results. Notice that I am sending the message through UART3 and Receiving it via UART1.

    The logic analyzer trace shows the UART3 output starting after UART1 has received the first 8 characters "dtest111-".

    The loop which reads received characters into the strDATA array stops when UARTCharsAvail returns false.

    Therefore, think that there is a timing condition such that the loop which reads received characters stops after the first eight characters have been received, causing the loop which transmits 32 characters to transmit the 8 received characters, followed by 24 undefined bytes in the strData array. If you single step in the debugger the timing is changed, which could allow the receive loop to read all 16 characters into the strData array.