Getting a serial port UART for the Gameshell - console and u-boot access

While working on creating an image for batocera for the gameshell, I ended up with an image/SDcard that didn’t boot, so to try to debug and understand what was going on I though I could use a serial port / UART access to see an error message since at that point the screen turned on but was dark.

So I found the provided cable that plugs in to the GPIO/debug port :

I plug it in to the gameshell taken out of it’s case :

I then went through the forum and blog posts (would be nice to have some kind of central documentation, but hey, I’ll do with what exists) :

I end up with a setup that looks like this :

On my 3 SDcards (clockworkOS, clockworkpi-debian from @Joao_Manoel, batocera image) I didn’t get any output on the serial port.

I ended up find how to enable the serial port in u-boot on the clockwork-debian image by changing the boot.cmd (add console=ttyS0,115200 ) used to generate the boot.scr that I then copied at the root of the mounted SDCard. :tada:

setenv bootargs earlyprintk no_console_suspend fsck.repair=yes console=ttyS0,115200 root=/dev/mmcblk0p1 rootfstype=ext4 rootwait init=/lib/systemd/systemd noinitrd panic=10 cma=256M ${extra}
setenv bootdelay 3

The bootdelay addition adds the posibility to interupt u-boot and tweaks options or change commands from the serial port.

The patch for the boot.cmd that generates the boot.scr : [boot.cmd] add serial port for debugging and access to u-boot by arthurlutz · Pull Request #11 · wolfallein/clockworkpi-debian · GitHub

Any chance of getting this to work on the ClockworkOS official image ?! Lets document all this !? If anyone wants to help me debug the batocera image, what would be your tips ? cc @r043v for how you did this on the Arch image ?

Here is the text version of the u-boot prompt for people using search :


U-Boot SPL 2020.07-g610e1487-dirty (Jul 12 2020 - 20:19:45 +0200)
DRAM: 1024 MiB
Trying to boot from MMC1


U-Boot 2020.07-g610e1487-dirty (Jul 12 2020 - 20:19:45 +0200) Allwinner Technology

CPU:   Allwinner A33 (SUN8I 1667)
Model: Clockwork CPI3
DRAM:  1 GiB
MMC:   mmc@1c0f000: 0, mmc@1c10000: 1
Loading Environment from FAT... Card did not respond to voltage select!
Setting up a 320x240 lcd console (overscan 0x0)
In:    serial
Out:   vga
Err:   vga
Net:   No ethernet found.
starting USB...
No working controllers found
Hit any key to stop autoboot:  0 
=>   

i used the work of stewart fu for get serial output but in fact it was not a real need and so i not really used it else on an initial test

for the initial basic and low setup i used the “emulator”, i used it also a lot to touch conf files while i worked on the kernel and wifi driver

in a first i can recommend you to keep official kernel and use it until you’ll have proper os other parts ok

i was changed uboot conf file to use arch regular way of boot, and ask kernel to show log on screen directly, yes it need have screen driver working

initial goal is to have network working to dig into unit with ssh