Part Number: TMS320F28377S
Tool/software: Code Composer Studio
Hi,
I'm using TMS320F28377S launchpad. I'm working on receiving serial data through SCI protocol and I'm using this data for further processing.
Here is the function that receives the data
Uint16 readChar()
{
// Wait for inc character
while(SciaRegs.SCIFFRX.bit.RXFFST == 0) {} // wait for empty state
// Get character
char tempchar = SciaRegs.SCIRXBUF.all;
return tempchar;
}
This function works as expected while testing using CCS on windows even with continous stream of data.
My application needs it to work on Linux with a continuous stream of data.
Problem occurs when sometimes on linux CTRL + A ( ^A - ascii value 1) or CTRL + B ( ^B - ascii value 2) is sent. This is not part of the linux code but is added from elsewhere (This cannot be prevented from generating so has to be rectified in MCU while receiving itself ). When this occurs the MCU - F28377S gets stuck and does not proceed further even though the next sequence of data is proper. I found that the MCU gets stuck in an infinite loop inside the while loop in the above mentioned code. MCU f28377s is not able to read these characters nor is it able to come out of that loop when next sequence of data comes.
Is there any way I can read those characters or any way I can come out of the loop and read the next data.
I tried to the clear the RX buffer by toggling this....SciaRegs.SCIFFRX.bit.RXFIFORESET ....but it didn't work.
Thanks