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.

enable uart2 , has reading problem

Hi,

     I am new to here, so If I post question in wrong place, please let me know and sorry about that.

    I have a Ti processor AM335x on a dev board. right not there are two uart connect to processor. uart0 and uart2


    by default, only uart0 was enable, and it was for console. after I enable uart2, I wired my GPS to it so that it should output something if I cat /dev/ttyO2.  but there are only some garbage code shows up. 

    then I wired GPS to uart0, use same command cat /dev/ttyO0  everything works fine. GPS output shows up normally.


    then I edit my uEnv.txt to switch my console to uart2, it works. and then I wired GPS to uart2, I can cat /dev/ttyO2 to get everything. But when I wired GPS to uart0. garbage code shows up.


   I did use stty to do tty setup, make them all same, still, I can only read from the uart which I connect my console.


   I run command dmesg | grep tty  , this is the output

[0.000000] Kernel command line: console=ttyO2,115200n8 root=/dev/mmcblk0 rw ext4 rootwait verbose debug

[0.234749] 44e09000.serial: ttyO0 at MMIO 0x44e09000 (irq = 154m, base_baud = 3000000) is a OMAP UART0

[0.235338] 48024000.serial: ttyO2 at MMIO 0x48024000 (irq = 155m, base_baud = 3000000) is a OMAP UART2

[0.824084] console [ttyO2] enabled

first and fourth would change base on which uart I put my console on.

Are there any config I missed? why I can only read precise data from the uart I put my console on. and others doesn't work.

any idea would help. Thanks.

  • it turns out that serial port speed is not correct.

       not because I didn't set up right. is because somehow...as soon as I connect my GPS module to my uart2, it auto change the port speed to 9600 and I cannot change it back unless I disconnect the GPS.

       I have to set the serial port pseed to 115200 and start reading THEN connect my GPS. so that the reading speed is right and output result is right.

    I don't know why this happen....but that's what happened to me.