0
\$\begingroup\$

I recently started testing the UARTs on a RockpiE with the hardware v1.2 GPIO headers (https://wiki.radxa.com/RockpiE/hardware/gpio).

In the 'boot/uEnv.txt' file, I disabled the console on uart2 by removing the line 'rk3328-console-on-uart2', and enabled uart1 (https://wiki.radxa.com/Device-tree-overlays). I verified functionality by reading from a UART device connected to 3.3v, ground, and both UART2 and UART1 with minicom:

minicom -b 9600 -o -D /dev/ttyS1
minicom -b 9600 -o -D /dev/ttyS2

Happy with the way everything was working, I decided to start working on a serial message-finding algorithm. For me, the easiest way to try this seemed to be bridging the two UARTs so I could work from one device. I ran one jumper from UART2_TX to UART1_RX and another jumper from UART2_RX to UART1_TX. I tried to send data back and forth with minicom, but received no data.

Am I missing something in the UART protocol that is causing this not to work? I've verified both ports with an external device, and can't think of anything that would prohibit this from working.

\$\endgroup\$
6
  • \$\begingroup\$ Bridging the uarts as you say you did should be working. \$\endgroup\$
    – Eugene Sh.
    Mar 2, 2021 at 17:22
  • \$\begingroup\$ Twin one of the lines to feed a logic level UART receive input on your PC as well, or monitor it with a scope. Anyway, this seems to be a system/software/usage question, not an electronics question. \$\endgroup\$ Mar 2, 2021 at 17:23
  • \$\begingroup\$ I can add more information to this. I think it's more clear that I'm missing something that minicom does or doesn't do. I created a Python program to read and write to the bridged UARTs at the same 9600 baud-rate. This worked! I don't know why minicom didn't work. I don't have to know, but would be much more satisfied if I did. \$\endgroup\$ Mar 2, 2021 at 17:30
  • \$\begingroup\$ Are you opening two minicoms in two different terminals? \$\endgroup\$
    – Eugene Sh.
    Mar 2, 2021 at 17:38
  • \$\begingroup\$ Yes Eugene. They are in two different terminals connected over SSH. \$\endgroup\$ Mar 2, 2021 at 17:41

1 Answer 1

0
\$\begingroup\$

De-compile the .dtbo file regarding UART enabling with DTS compiler. Then download the CPU manual and look for GPIO section. From board scematics, write down those involved pins and look in de-compiled .dts file what setting they provided: pull-up, pull-down, none or if the output is open drain.

Well if TX pin is open drain and RX pin has no pull-up, then you get nothing.

my example:

enter image description here

find the ff190000 (uart1)

enter image description here

find what's behind the phandle 0x46

enter image description here

0x03 means GPIO3 bank, 0x0C is the pin number, 0x02 probably means special function (not a standard GPIO, rather UART pin) , 0xB3 is pullup setting :

enter image description here

So for the next pin: 0x03 = GPIO3, 0x0D = pin nr., 0x02, 0xb0

enter image description here

EDIT:

Now if you look at the RockPi 4 schematics you will notice that UART1 pins are already used for Ethernet controller, so it can be used. This is the reason why you see in the DTS file it's "disabled". You should get a conflict warning in dmesg if you try to enable it.

enter image description here

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.