Serial port doesn't receive data

  • Hi,


    I want to test the Serial ports of "Starterkit PicoCOMA9X Linux". The Problem is that I can send data by using "echo Hello > /dev/ttymxc2" which is mentioned in the "F&S i.MX6-SoloX Linux First Steps", but I can't receive any data from port when I use "cat /dev/ttymxc2". Or even with using "termios". Is there something missing?


    Any help and Suggestion would be appreciated.

  • Hi,


    i have a small c programm which access via ioctl the uart interface and send a string. In the attachment you find the c file and a precompiled test program. Does this program solve your problem?


    Your F&S Support Team

    Files

    • uart_test.zip

      (5.07 kB, downloaded 611 times, last: )

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • Hi,
    Actually, it doesn't help me.
    The Problem is that, I can send data from board to my Computer using Serial port but I can't receive data. I want to receive data from Computer in simplest way. I've tried common way which is "cat /dev/ttymxc2", but there is no data written in the file.
    Your test program just send data but not receive any data.


    Any help and Suggestion would be appreciated.

  • Do you use the serial adapter and null-modem cable that was provided in the starter kit? Did you configure the serial connection in the terminal program on the PC side correctly? 115200 baud, 8 data bits, 1 stop bit, no flow control. For example using flow control on the PC side when RTS/CTS is not active on the PicoCOM side may cause such behavior. Then the PC may think that the board is not ready to receive data due to the uninitialized and therefore incorrect state of the RTS line of the board (=CTS on the PC side).


    If you use a different connection and/or configuration, please tell us.


    Your F&S Support Team

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • Hi,


    I use the Serial Adapter and null-modem cable that was provided in the starter kit and use USB to RS232 converter. I can confirm that the the Signal Comes out of Computer and I can see it on oscilloscope.
    I use the following command to configure COM2 of the board in terminal:


    Code
    1. stty -F /dev/ttymxc2 115200 cs8 -cstopb -parenb -crtscts


    For sending data from board to the Computer, I use the following command and I can recieve it on Computer with realterm application:


    Code
    1. echo "HELLO" > /dev/ttymxc2



    For sending data from Computer to the board, realterm app is used and it is set to 115200 baud, 8 data bits, 1 stop bit, no flow Control. To see the received data I use the forllowing command in terminal of board:


    Code
    1. cat < /dev/ttymxc2

    .


    I've tried to make a loop Connection for COM2 by using Standard loop connector, but it is also not working. i.e. I can't receive any Thing. I try that for both COMs but no result.
    Is there something missing in my steps?

  • Just to be sure: Terminal input (like ttymxc in this case) is line buffered. so you will not see the input data until you press Return on the PC side. If you do not want this, you have to change the tty settings on the board side to raw mode using stty.


    And also note that each character is echoed, which may have funny effects if you connect two ttys together: one character is sent, the other side echoes the character, the local side echoes the character again, and so on, resulting in an endless sequence of characters to be transferred in both directions. If you do not want this, you have to disable this echo with stty.


    Your F&S Support Team

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • I could receive data from COM1 after using "\r" and Login into OS. But the Problem with COM2 exists. I use the following command for configuring it:


    Code
    1. stty -F /dev/ttymxc2 115200 cs8 -cstopb -parenb -crtscts


    CTS/RTS is turned off, but whenever I use the following commad to see the received data, CTS will be activated:


    Code
    1. cat < /dev/ttymxc2


    Also, I use "\r" (Return) for sending data over Serial from Computer to the board, but I can't receive data.


    Any help would be appreciated.

  • OK, let's check something else. If you remove the PicoCOMA9X module from the baseboard, then you'll see two soldering jumper places on the baseboard itself, i.e. two semi-circle shaped pads close to each other so that they can be connected by putting some solder on them. Here the jumper next to the two capacities should be open and the jumper in direction to the PicoCOM connector should be closed (connected). There are also pads for a small 8-pin IC next to this second jumper, this IC should not be mounted.


    If there is something different, then please tell me.


    Do you have a second hardware to compare the behavior?


    Your F&S Support Team

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • Then I'm out of ideas. Maybe there is a hardware malfunction. Please use RMA and send us the board (incl. PicoCOMA9X) and we will check this.


    Your F&S Support Team

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • Ok.
    Before I send the Hardware, could you please check the normal Looping for COM2. I mean, sending data by following command and receive it:


    Sending:


    Code
    1. echo "HELLO" > /dev/ttymxc3


    Receiving:


    Code
    1. cat < /dev/ttymxc3


    If you loop comport by using Hardware (not Software loop), you should see HELLO, when it received.
    It works fine with COM1 but it is not working with COM2.


    If it works for you please send me your configuration of your Serial port by using:


    Code
    1. stty -F /dev/ttymxc3 -a


    I want to be sure that I didn't make mistake by Setting Parameters.


    Thank you.

  • Just a question, how do you enter commands if ttymxc3 is not working in both directions?


    What I did:


    Connect (loop-back) pins 3 and 5 of connector J6. Then


    Code
    1. stty -F /dev/ttymxc2 -echo -echoe
    2. cat < /dev/ttymxc2 &
    3. echo Hello > /dev/ttymxc2


    The "Hello" appears. Then I did the same for ttymxc3. However as this is the input line for commands, I used telnet to connect to the board instead.


    Code
    1. ifconfig eth0 10.0.0.252 up
    2. telnetd


    Then I started telnet on the PC:


    Code
    1. telnet 10.0.0.252


    After logging in, I unplugged the PC from connector J7 and looped back pins 3 and 5 instead. On the telnet connection I typed:


    Code
    1. stty -F /dev/ttymxc3 -echo -echoe
    2. cat < /dev/ttymxc3 &
    3. echo Hello > /dev/ttymxc3


    Again "Hello" appeared on the telnet screen.


    Your F&S Support Team

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

    Edited 2 times, last by fs-support_HK ().