JORGETECH Posted March 18, 2020 Posted March 18, 2020 I want to do some debugging in the Orange Pi Lite 2 and it requires the ability to output the kernel log to the serial console. I am using an Arduino as a TTL-to-USB serial converter (shorting the Reset and GND pins) with the TX pin from the OPi Lite 2 UART header connected to RX on the Arduino (Digital pin 0), the RX pin from OPi connected to Arduino's TX (Digital pin 1), and Ground to Ground. I tried to enable the serial console by enabling all the UART overlays in armbian-config (ruart, uart1, uart2, uart3), setting the "console" environment variable to "ttyS0,115200", setting the "loglevel" variable to "7" and disabling the login on ttyS0 by executing the command "sudo systemctl disable serial-getty@ttyS0"; but it still doesn't work, the TX and RX LEDs on the Arduino never light up and no serial output is given on the other device. Am I doing something wrong or omitting something? Here is my "armbianEnv.txt" file: verbosity=1 console=ttyS0,115200 loglevel=7 overlay_prefix=sun50i-h6 rootdev=UUID=58a69432-a39f-4567-83e2-4696510afc4b rootfstype=ext4 overlays=ruart uart1 uart2 uart3 usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u
martinayotte Posted March 18, 2020 Posted March 18, 2020 17 minutes ago, JORGETECH said: I am using an Arduino as a TTL-to-USB serial converter Beware that TX output of OPiLite2 is 3.3V while your Arduino RX expect 5V, so it is maybe the reason why you don't see any output ... Better purchase a 3.3V compatible USB-TTL dongle. 1
JORGETECH Posted March 18, 2020 Author Posted March 18, 2020 36 minutes ago, martinayotte said: Beware that TX output of OPiLite2 is 3.3V while your Arduino RX expect 5V, so it is maybe the reason why you don't see any output ... Better purchase a 3.3V compatible USB-TTL dongle. I just tried with a MAX3232 TTL-to-RS232 adapter, connecting the VCC pin from the adapter to 3.3V with no luck. I'm thinking of buying one of those cheap TTL-to-USB adapters (CP2102) if it turns out to be the only way to connect serial to this devices.
martinayotte Posted March 18, 2020 Posted March 18, 2020 5 minutes ago, JORGETECH said: I just tried with a MAX3232 TTL-to-RS232 adapter Don't do that, it can burn your H5 UART, RS232 are using inverted level of +/- 9V to 12V !!! 6 minutes ago, JORGETECH said: I'm thinking of buying one of those cheap TTL-to-USB adapters (CP2102) if it turns out to be the only way to connect serial to this devices. Right ! Not only CP2102, but there are others, such CH340. Seeing your footer, in the meantime, you can use your OPiZero since it has UART1 on header. 1
JORGETECH Posted March 18, 2020 Author Posted March 18, 2020 10 minutes ago, martinayotte said: Don't do that, it can burn your H5 UART, RS232 are using inverted level of +/- 9V to 12V !!! Good advice! I don't think anything was burnt since the UART pins still output 3.3V to the multimeter. 11 minutes ago, martinayotte said: Right ! Not only CP2102, but there are others, such CH340. Seeing your footer, in the meantime, you can use your OPiZero since it has UART1 on header. I do have an OPi Zero to test, but I want to debug something running on the OPi Lite 2 (which has the same UART header). The MAX3232 seems to only work with the Raspberry PI (I bought it for that), I'm going to buy a better adapter and report back my findings.
JORGETECH Posted March 20, 2020 Author Posted March 20, 2020 Ok, so I received one of those CP2102 USB to serial adapters and it works well. Now my only problem is that the kernel log is replaced by the systemd log and it stops at the login prompt. How do I make the serial port to just output the kernel log? Thanks in advance
JORGETECH Posted March 21, 2020 Author Posted March 21, 2020 I successfully disabled the login prompt by masking the getty services, kernel debug messages are printed to the console now. Thanks for all the help!
Recommended Posts