HOW TO - Connect the serial console
#1
Lightbulb 
This explains how to connect a serial console to the ROCKPro64. In this example I'm using the console sold by the Pine64 folks, but probably works for other serial consoles as well.

Parts/software needed
1) ROCKPro64 (I'm using the Rockpro64_V2.1 2018-06-06, 2GB version)
2) Serial console (I'm using a CH340G chipset based console, the one from Pine64)
3) Three F/F jumper wires (4 are included in the serial console from Pine64 and are 15 cm long)
4) Screen, Minicom or Picocom installed on a Linux distro

Steps

Connect the serial console to the PI-2-bus on the ROCKPro64
  1. Set the yellow jumper on the serial console to 3V3 (see the picture below)
  2. Connect a F/F jumper cable to the ground (GND) on the serial console and the other end to pin#6 of the PI-2-bus (black cable in the picture)
  3. Connect a F/F jumper cable to RTX on the serial console and the other end to pin#8 of the PI-2-bus (brown cable in the picture)
  4. Connect a F/F jumper cable to TXD on the serial console and DO NOT connect it to the ROCKPro64 (I'll explain below)
[Image: EfJ0JhP.jpg]

The reason for not connecting that last jumper cable to the ROCKPro64 is that in my case the ROCKPro64 doesn't boot when it is connected. When the cable is disconnected it boots fine. It is not really a problem because this connection is for sending. Receiving works just fine (and that is usually the reason why people use the serial console in the first place). Nevertheless, once the system is booting (or finished booting) you can connect the jumper cable and send commands to the ROCKPro64.


Connect the serial console to another computer and establish a connection
[1] Plug in the console into an USB port. I'm using a MacbookPro running Arch Linux:
Code:
[[email protected]_arch ~]# uname -a
Linux mbp_arch 4.17.13-arch1-1-ARCH #1 SMP PREEMPT Mon Aug 6 23:06:31 UTC 2018 x86_64 GNU/Linux

[2] Figure out how to access the serial console:
Code:
[[email protected]_arch ~]# dmesg | tail
[   70.843501] usb 3-1: new full-speed USB device number 2 using ohci-pci
[   71.071013] usb 3-1: New USB device found, idVendor=1a86, idProduct=7523, bcdDevice= 2.62
[   71.071023] usb 3-1: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[   71.071028] usb 3-1: Product: USB2.0-Serial
[   71.103892] usbcore: registered new interface driver usbserial_generic
[   71.103903] usbserial: USB Serial support registered for generic
[   71.105335] usbcore: registered new interface driver ch341
[   71.105348] usbserial: USB Serial support registered for ch341-uart
[   71.105374] ch341 3-1:1.0: ch341-uart converter detected
[   71.119050] usb 3-1: ch341-uart converter now attached to ttyUSB0

[3] The way to access the console is through ttyUSB0 (in my case, it could be different for you)
[4] Open a terminal and start screen, minicom or picocom with the following parameters:
Code:
[[email protected]_arch ~]# screen /dev/ttyUSB0 1500000
Code:
[[email protected]_arch ~]# picocom /dev/ttyUSB0 -b 1500000
Code:
[[email protected]_arch ~]# minicom -D /dev/ttyUSB0 -b 1500000


This will start the application with a baud rate of 1.5M on ttyUSB0 (which we have just established is the serial console)

[5] Connect the power cable to the ROCKPro64 and enjoy the boot messages that will show. At this point you can connect the last jumper cable to pin#10 on the PI-2-bus which will allow you to send as well (and be able to login).
[6] To quit screen press 'ctrl-a' first followed by 'k'. Answer 'y' to the question to kill the current connection. To quit minicom press 'ctrl-a' followed by 'x' and select 'yes'. For picocom press 'ctrl-a' first and then 'ctrl-q'.


Hope this guide is clear. Suggestions are welcome Smile
  Reply
#2
It is very handy to have a USB extender you can easily get console without putting your board in a funny spot.

People like me that like everything in specific place will appreciate an USB extender cable (A-Male to A-Female).

Amazon has them along with anyone else. Amazon link below.
USB Extender : Male-A to Female-A
  Reply
#3
I get the Linux console messages but not messages from the boot loader. Do they use a different baud rate?
  Reply
#4
(11-08-2018, 07:01 PM)Wom the Bat Wrote: I get the Linux console messages but not messages from the boot loader.  Do they use a different baud rate?

I have the same problem. I can see the linux console, but everything about the boot sequence is just a sequence of not readable characters like if the initial speed is different but I tried all the possible combinations and I haven't obtained any good result.

By the way, with my serial2usb adapter it boots well with the tx pin connected.
  Reply
#5
Looks like the issue may be with macOS.

I tried in Mojave with minicom and screen, and I got the Linux login prompt after a hitting enter a few times. Strangely, every time I hit enter, odd serial characters came up until about the 5th or 6th time, then I got the normal login prompt. On the HDMI-connected monitor, I saw a SysRq prompt come up. It seems like hitting enter must have hit the magic key combo for the linux sysrq prompt.

So, I loaded up Kali in a VM and passed the USB device (FT232 with RXD/TXD/GND connected) and ran minicom (turned off HW flow and turned on SW flow) and was able to see everything including the SPI boot messages.

Let me know how it goes for you.

-Yama
  Reply
#6
I fought with this console for about 30 minutes ... Decided to change the serial console rate to 115200 ... Console now work PERFECTLY!

Use 'who' to determine the tty that the console is connected to ... Mine is ttyS2.

Change ttyS2 to 115200 using 'stty -F /dev/ttyS2 115200'. Then change your serial terminal software (screen, minicom, picocom, etc) to 115200. PERFECT!
  Reply
#7
Has anyone gotten this to work with PuTTY on Windows? It seems like it should be simple, but all I get is garbage, no matter with baud rate I try. (I've tried 9600, 115200, and 1500000.)

Are these 3V levels? If not, I suppose that could be the problem. I'm using the USB-TTLserial device I had laying around, with is Prolific.
  Reply
#8
(05-16-2019, 08:22 PM)markb1 Wrote: Has anyone gotten this to work with PuTTY on Windows? It seems like it should be simple, but all I get is garbage, no matter with baud rate I try. (I've tried 9600, 115200, and 1500000.)

Are these 3V levels? If not, I suppose that could be the problem. I'm using the USB-TTLserial device I had laying around, with is Prolific.

Do you have it set to 8n1 and flow control off? Yes only use 3.3v
  Reply
#9
(05-16-2019, 08:55 PM)evilbunny Wrote:
(05-16-2019, 08:22 PM)markb1 Wrote: Has anyone gotten this to work with PuTTY on Windows? It seems like it should be simple, but all I get is garbage, no matter with baud rate I try. (I've tried 9600, 115200, and 1500000.)

Are these 3V levels? If not, I suppose that could be the problem. I'm using the USB-TTLserial device I had laying around, with is Prolific.

Do you have it set to 8n1 and flow control off? Yes only use 3.3v

Yes to all of those.

Looking at /boot/boot.cmd, it appears the baudrate is set to 1500000. Perhaps this adapter just doesn't support that. But editing boot.cmd, and changing it to 115200, I still get garbage. So I have no idea what's going on.
  Reply
#10
Progress! When changing boot.cmd, I forgot to use mkimage to rebuild boot.scr. (Ok, fine, I didn't know I had to, and I missed the instruction at the bottom of the file!)

I still get garbage at first (presumably from the bootloader), but then I get a login prompt, and all is good. So this seems to mean that my USB-Serial adapter does not support 1500000 baud, but the bootloader is still running at that rate. Is there a way to change the bootloader's console baud rate, without access to the console during boot?
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)