Enable UART_AO_B

Hi, so am looking to use stm32 blue pill with Zero and I need a uart, but I can’t figure how to enable a UART.

I did look into the https://wiki.radxa.com/Zero/Debian#common_hardware_interface. I did try the last example on the page and when I list the tty, I do see the /dev/ttyAML4 after system reboot.

Then I tried to enable UART-AO-B on the GPIOAO 8 & GPIOAO 9, so I modified the file /boot/eEnv.txt with “overlays=meson-g12a-uart-ao-b-gpioao-8-gpioao-9”, rebooted the system I ran the command “dmesg | grep tty”. I do not see any changes to list

gave it another try but the second time was with “overlays=meson-g12a-uart-ao-b-on-gpioao-8-gpioao-9”. I still do not see any change when I run "dmesg | grep tty"

am I missing something, have typo or are the UARTs are enabled by default? if yes how do I view it in the terminal

Thanks and regards
Hilal Al Harthi

If using an upstream Linux kernel the following in boot params should enable UART:

systemd.debug_shell=ttyAML0 console=ttyAML0,115200n8 console=tty0

Pinout is here https://github.com/radxa/documentation/blob/master/rs102/additional-docs/images/guide/zero-serial-console.jpg

If you’re using the downstream (vendor, Linux 4.9) kernel then I have no idea :slight_smile:

Hi, we have just added dtbo of UART_AO_B. For the usage, please see this guide, https://wiki.radxa.com/Zero/Ubuntu#common_hardware_interface, again.

2 Likes

Hi, how about UART_AO_A?
I want to use a hat using with standard UART of Raspberry Pi.

Thanks I got it working, am sure I did try it before, it could be I had a typo somewhere

1 Like

We are working on it.

1 Like

Hi hishi, not sure the thing you would do with the UART_AO_A as I do, but I made some progress, and probably that can help you.

I want to use the radxa zero with my Prusa i3MK3s, which seems to be a good fit as the GPIO pin head definition is the same as raspberry pi zero, see this post.

For this application, I just want only python to access the /dev/ttyAML0 after the software octoprint starts. The problem is that because the kernel is also using this resource, thus python will throw an error, also the UART won’t work with communicating with Prusa. What I did is that I follow the documentation, turn on the /dev/ttyAML1, and I modify the console configuration from /dev/ttyAML0 to /dev/ttyAML1 in /boot/uEnv.txt, thus no one is using /dev/ttyAML0 after the system starts running the operating system, so python can use it happily.

I haven’t connected it with my Prusa, probably I will try it tomorrow, but it seems to be fine to run python3 -m serial.tools.miniterm /dev/ttyAML0 115200 with my USB serial, which does not work before for python will throw an error saying that other program is also using this resource.

1 Like

Hi, to use UART_AO_A,

I think you need to use the latest Ubuntu/Debian image. Get them from https://github.com/radxa/radxa-zero-images-released/releases/tag/radxa-zero-v20211027.

And then follow https://wiki.radxa.com/Zero/Debian#UART to configure uart.

1 Like

Hi Stephen, can I just update the kernel and set overlays=meson-g12a-uart-ao-a-on-gpioao-0-gpioao-1 to use UART_AO_A from release radxa-zero-v20211010?

Also, I think the documentation needs to be updated too:

This one is outdated,
Make sure that kernel is at least version 5.10.69-4-amlogic. If not, then try

Also, from my understanding, the serial console seems not to be available for login by default? If yes, then

### Access from the Host PC/Laptop

#### Option 1: Serial console

should be updated.

We have released the latest kernel (5.10.69-5-amlogic-gfeede6ac474e) to Radxa APT. So yes, you can.

1 Like

The documentation is updated.

1 Like

I think serial console is available for login by default.

What problem do you meet with serial console? Please provide the steps to reproduce your issue for me.

Oh, I did not install the latest image, just I saw the line:

Serial console
To set UART_AO_A as serial console, add the following two lines to /boot/uEnv.txt

 console=ttyAML0,115200
 overlays=meson-g12a-uart-ao-a-on-gpioao-0-gpioao-1

, so I thought the console setting is removed, and no console is available. My bad if the serial console still works with the latest release by default, I did not give it a test but just guessed.

For the latest image, these two lines are added by default for serial console.

We can remove this two lines to use GPIOAO_0 and GPIOAP_1 as GPIO function.

Hi, I cannot get the UART_AO_B serial port appearing in /dev with the latest image radxa-zero-ubuntu-focal-server-arm64-20220801-0346-mbr.img. Actually, even the default console at UART_AO_A does not seem to work.

The dmesg shows the following (among other):

$ dmesg|grep tty
[    0.000000] Kernel command line: earlyprintk console=ttyAML0,115200 console=tty1 rw rootfstype=ext4 init=/sbin/init rootwait swiotlb=1 coherent_pool=1m  root=UUID=a1d6d1b5-7219-4126-8ecd-e5cf6265cfc6
[    0.000574] printk: console [tty1] enabled
[    1.542482] ffd24000.serial: ttyAML2 at MMIO 0xffd24000 (irq = 26, base_baud = 1500000) is a meson_uart
[    1.542691] serial serial0: tty port ttyAML2 registered

But there is no device called /dev/ttyAML*.

Here is the contents of /boot/uEnv.txt:

verbosity=7
console=ttyAML0,115200
overlay_prefix=meson
rootfstype=ext4
fdtfile=amlogic/meson-g12a-radxa-zero.dtb
overlays=meson-g12a-uart-ao-a-on-gpioao-0-gpioao-1 meson-g12a-uart-ao-b-on-gpioao-2-gpioao-3
rootuuid=a1d6d1b5-7219-4126-8ecd-e5cf6265cfc6
initrdsize=0x101b215
kernelversion=5.10.69-13-amlogic-g104342c59952
initrdimg=initrd.img-5.10.69-13-amlogic-g104342c59952
kernelimg=vmlinuz-5.10.69-13-amlogic-g104342c59952

New images published (20221001). Still the same problem. Misconfigured grub and no serial devices to be seen in /dev…

No support from Radxa - another day spent on the device: I noticed the uEnv.txt has no effect on booting whatsoever. Inspecting the booting process from the serial console more properly finally showed why: the file extlinux/extlinux.conf is found and loaded by the bootloader instead. Removing this file solves both problems: failed booting (due to the wrong path to the DTB) and no serial ports working (due to overlays not loaded at all).

After removing extlinux/extlinux.conf from the boot partition, the boot.scr is correctly loaded instead, and the uEnv.txt is finally applied.

Am I the only person using the Radxa Zero with the new and broken images? Is nobody even testing the images?

Happened to me too with the Ubuntu server image. I think I rather modified extlinux.conf to load the DT overlay :

LABEL Ubuntu server
    KERNEL ...
    FDT /boot/.../meson-g12a-radxa-zero.dtb
    # FDTOVERLAYS /boot/.../meson-g12a-i2c-ee-m3-gpioa-14-gpioa-15.dtbo
    APPEND initrd=...

Yeah, that is the other possibility. But all the current documentation only mentions the uEnv.txt and in the other thread you mention that extlinux.conf does not support overlay parameters (not that I would currently use them, but maybe I will want to later).
So, I consider it strange that this file (with a preference!) is present and (in addition) it includes a typo preventing the system to even boot at all.