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: USB UART with custom streaming protocol not working

Tool/software: Code Composer Studio

I am trying to use the USB UART with custom streaming protocol on Gui composer to communicate with my target device (Concerto M3). I have a working set of code that uses the USB UART with serial monitor, so in essence the target and Gui composer is working. But I cannot get the custom streaming to work. I have downloaded the Tutorial_SerialIO_Binary example from the gallery and changed the settings to my application. I have downloaded the ControlLEDsBinary_Generic.ino file and ported the code to my own target. When I run it there is no connection with the target device. I just says "waiting for data". See picture below. 

And when I run the application:

If I check on a serial terminal I can see that my target is indeed transmitting the data over the UART, but I cannot see any data coming from the host when I monitor my target's UART buffer.

However, I also tried another example called Serial_SendDataDemo from the gallery and this one worked straight away! I can see the data on my target device when I click the "Send Value" button.

I don't know what is different in the second application that makes it to work? But I really would like to transfer whatever it is to the other Tutorial_SerialIOBinary example, because that is ultimately what I want to achieve, a full  custom protocol communication. 

Why does the SendDataDemo example work but not the SerialIOBinary example? Even if my target application code for the SerialIOBInary example is not working, I am not even receiving any data and the connection in the bottom left just says waiting for data. But on the other example it says hardware connected and the data is coming through. Why?

Please help, thanks

Albert

  • Hello Albert,

    Did you add a new Codec JavaScript file to your application and implement the encode and decode function?

    In order to use custom codec, I am assuming that you are using the streaming model with custom protocol. For the GC app to get into a connected state, the target has to send (binary or text) packets to the host and the custom codec needs to decode the packets and return a valid json object.

    If you are using chrome, press F12 to debug your application. Put a breakpoint at the encode and decode functions in your custom codec and see if they are called. Additionally, you might need to add an options menu widget to the menubar to be able to select the COM port in your app.

    Regards,
    Patrick

  • Thanks Patrick

    Yes I have added the new Codec JavaScript file with encode and decode functions and the streaming model with custom protocol. 

    What I did now was to start with the Serial_SendDataDemo as a baseline and use the chrome debug tools like you suggested. I stripped everything down to only sending pure binary data to my target and respond back to the GUI. It seems to work now and I get a "Hardware Connected" message. Still not sure why I couldn't get the same working with the other Tutorial_SerialIO_Binary example, but I will build further step by step on this Serial_SendDataDemo example.  

    Regards

    Albert