Support device tree overlays

Thank you for update package regarding device tree overlays, the link is below.

I reviewed this according to the instruction on
https://wiki.radxa.com/Zero/Debian.
Then I tried the kernel upgrade after update and upgrade, the instruction is,

Make sure that kernel is newer than 5.10.69-2-amlogic. If not, then try
$ sudo apt install -y linux-headers-5.10.69-3-amlogic-gacf75c74f9
$ sudo apt install -y linux-image-5.10.69-3-amlogic-gacf75c74f9

The result was,
E: Unable to locate package linux-headers-5.10.69-3-amlogic-gacf75c74f9
E: Couldn’t find any package by glob ‘linux-headers-5.10.69-3-amlogic-gacf75c74f9’
E: Couldn’t find any package by regex ‘linux-headers-5.10.69-3-amlogic-gacf75c74f9’

Consequently, I could not upgrade the kernel.

However, I tried to check 2ch PWM outputs following further instruction for uEnv.txt.
The pwmchip4 and 6 were added to /sys/class/pwm/pwmchip0 and pwmchip2.
I could see pwm0, pwm1 signals from pin 40, 18 separately after setting up period, duty_cycle and enable. Thanks.
But, two pwm signals were not generated at the same time.
It wonder I should wait for a kind of library like mraa or wiringpi.

Any advices would be greatly appreciated.


We have added the kernel 5.10.y to Radxa APT stable repositories. Please try to install kernel packages again.

After adding these two dtbo, you would find that two new pwmchip directories are created in /sys/class/pwm

meson-g12a-pwm-c-on-gpiox-8
meson-g12a-pwmao-a-on-gpioao-11

Rock3A included?

Currently no I think. But we will add this for the next release of ROCK 3A in two weeks.

Thanks, Stephen.
I could upgrade the kernel.

Regarding PWM, the situation is quite same as before.
The PWM signals are not generated at the same time.
When pwm0 is set at first, pin40 outputs the signal, but the next pwm1 setting does not work.
When pwm1 is set at first, pin18 outputs the signal, but the next pwm0 setting does not work.
That’s very strange to me.

Do I need any additional setting?
Thanks, again.

I could get two PWMs (pin40,18), one i2c (pin3:SDA, pin5:SCL) and two gpio ports (pin27,pin37).
The PWM outputs were measured as below.

I’d made an mistake that I used pwm0 and pwm1 at the previous test, this time I used only pwm0. It worked.

Regarding GPIO, I could not control pin35(GPIOAO_8) following the description of
https://wiki.radxa.com/Zero/hardware/gpio
.
However, it’s ok because the pin27 and pin37 work well as gpio output.
So, I think I can replace my Raspi zero w with the Radxa zero and get more power.

I hope I can use a gpio library for Python like mraa as soon as possible.

Thank you very much for your effort.

When to add dwc2 dtoverlays?

@Stephen Looks like errors here https://wiki.radxa.com/Zero/Debian

I2C
To enable I2C_EE_M1 on GPIOH_6 and GPIOH_7 (/dev/i2c-1), add item “meson-g12a-i2c-ee-m1-gpioh-6-gpioh-7” to the “overlays=” line.

overlays=meson-g12a-i2c-ee-m1-gpioh-6-gpioh-7
To enable I2C_EE_M1 on GPIOX_10 and GPIOX_11 (/dev/i2c-1), add item “meson-g12a-i2c-ee-m1-gpiox-10-gpiox-11” to the “overlays=” line.

overlays=meson-g12a-i2c-ee-m1-gpiox-10-gpiox-11
To enable I2C_EE_M3 (/dev/i2c-3), add item “meson-g12a-i2c-ee-m3-gpioa-14-gpioa-15” to the “overlays=” line.

overlays=meson-g12a-i2c-ee-m3-gpioa-14-gpioa-15
To enable I2C_AO_M0 (/dev/i2c-4), add item “meson-g12a-i2c-ao-m0-gpioao-2-gpioao-3” to the “overlays=” line.

overlays=meson-g12a-i2c-ao-m0-gpioao-2-gpioao-3

must be without postfix “-gpioao-X-gpioao-X”?

What do you mean?

there isn’t files with names meson-g12a-i2c-ee-m1-gpioh-6-gpioh-7,meson-g12a-i2c-ee-m1-gpiox-10-gpiox-11,meson-g12a-i2c-ee-m3-gpioa-14-gpioa-15,meson-g12a-i2c-ao-m0-gpioao-2-gpioao-3

/boot/dtbs/5.10.69-2-amlogic-g981b0a3cef/amlogic/overlay# ls
README.meson-overlays  meson-g12a-i2c-ao-m0.dtbo  meson-g12a-i2c-ee-m3.dtbo         meson-g12a-pwmao-a-on-gpioao-11.dtbo
meson-fixup.scr        meson-g12a-i2c-ee-m1.dtbo  meson-g12a-pwm-c-on-gpiox-8.dtbo  meson-g12a-uart-ee-c.dtbo

Hi. Please upgrade kernel to version 5.10.69-4-amlogic.

 $ sudo apt update
 $ sudo apt install -y linux-headers-5.10.69-4-amlogic-g37ae4051315a
 $ sudo apt install -y linux-image-5.10.69-4-amlogic-g37ae4051315a
2 Likes

@Stephen
after update I have bootloop

Retrieving file: /dtbs/5.10.69-4-amlogic-g37ae4051315a/amlogic/amlogic/meson-g12a-radxa-zero.dtb
Failed to load '/dtbs/5.10.69-4-amlogic-g37ae4051315a/amlogic/amlogic/meson-g12a-radxa-zero.dtb'
Retrieving file: /dtbs/5.10.69-2-amlogic-g981b0a3cef/amlogic/amlogic/meson-g12a-radxa-zero.dtb
Failed to load '/dtbs/5.10.69-2-amlogic-g981b0a3cef/amlogic/amlogic/meson-g12a-radxa-zero.dtb'

because file /boot/uEnv.txt was incorrectly modifiedimage

Maybe you should use the newest image following, and then update the kernel.


zero_debian_buster_xfce4_arm64_20211010_0810-mbr.img.gz
zero_ubuntu_focal_server_arm64_20211010_0756-mbr.img.gz

Applying kernel provided DT overlay meson-wm8960-soundcard.dtbo
failed on fdt_overlay_apply(): FDT_ERR_NOTFOUND
343 bytes read in 3 ms (111.3 KiB/s)
Applying kernel provided DT overlay meson-i2cB.dtbo
failed on fdt_overlay_apply(): FDT_ERR_BADMAGIC
base fdt does did not have a /symbols node
make sure you’ve compiled with -@
462 bytes read in 4 ms (112.3 KiB/s)
Applying kernel provided DT overlay meson-g12a-i2c-ee-m3-gpioa-14-gpioa-15.dtbo
failed on fdt_overlay_apply(): FDT_ERR_BADMAGIC
base fdt does did not have a /symbols node
make sure you’ve compiled with -@
Error applying DT overlays, restoring original DT
71830 bytes read in 6 ms (11.4 MiB/s)

It is not working

| _ \ __ _ | | ____ _ |_ /___ _ __ ___
| |) / |/ _ \ / / ` | / // _ \ '__/ _
| _ < (
| | (
| |> < (
| | / /| / | | () |
|
| __,|_,//__,| /____
|_| ___/

Welcome to Armbian 21.08.0-trunk Focal with Linux 5.10.58-meson64

No end-user support: built from trunk

System load: 8% Up time: 32 min
Memory usage: 8% of 3.73G IP: 172.17.0.1 192.168.0.20
CPU temp: 40°C Usage of /: 24% of 29G

[ 80 security updates available, 180 updates total: apt upgrade ]
Last check: 2022-01-06 12:47

[ General system configuration (beta): armbian-config ]

Last login: Thu Jan 6 12:47:47 2022 from 192.168.0.41
mic@radxa-zero:~$ uname -r
5.10.58-meson64

I test one more thing
I set in armbianEnv.txt " overlays= i2cA i2cB "

and I did rebooting…

Applying kernel provided DT overlay meson-i2cA.dtbo
failed on fdt_overlay_apply(): FDT_ERR_NOTFOUND
343 bytes read in 3 ms (111.3 KiB/s)
Applying kernel provided DT overlay meson-i2cB.dtbo
failed on fdt_overlay_apply(): FDT_ERR_BADMAGIC
base fdt does did not have a /symbols node

I think that i2cA i2cB are default offered dtbo… but it is not work.
What can I do ? for using I2S I2C and GPIOs ? Please help me