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.

CCS/TMS320F28377S: TMS320F28377S

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

  • Hey Shiva,

    how are you handling commands received that are not what you expect? I do not see a reason why when you receive 0x01 or 0x02 you cannot continue to receive data.

    Can you send these control characters in Windows? does it cause the same problem?

    Can you check to make sure its not a Linux issue? possibly by using those characters you are disabling transmission in Linux? You can probe the SCI lines after this has occurred with a logic analyzer or Oscilloscope and make sure you see the correct signals.

    Let me know your findings!

    Thanks,

    Vince Rodriguez
  • Hi Vince,

    I'm using the ASCII values to filter out unwanted data received.
    The problem was that whenever the junk value was received, the micro controller was not able to read it in the first place so the micro controller program would never enter the part that would filter the received values.

    The problem was solved in the transmission end so the reception is happening without any errors.

    Thanks & Regards,
    Shiva Sanketh RM