DietPi + Odroid n2+ UART not working - how to enable?

Check out /boot/dtb/amlogic/overlay which contains some device tree overlays, including “uartA” and “uartC”. I’m not sure which one is enabled on the pins you want, respectively is attached to /dev/ttyAML1, but you can try them out.

Enable them by adding (starting with) uartA to the overlays= line in /boot/dietpiEnv.txt. No quoting or anything needed, just add an overlay right behind the = sign, or separated with a space if there is an overlay already. Generally use the filenames and remove .dtbo extension and prefix (meson- in this case).

thanks for answer.
is see this files :
image
so I can try “uartA” and “uartC”.
But are you sure it’s /dev/dietpiEnv.txt ?
I can’t find, but see it maybe in the boot ?
image
when I will open I can see :
image

so modify like this :
image

or meson with “-” ?
thanks

I tried “uartA” and also “uartC” but no luck. When it’s working I must see this ttyAML1 somewhere ?
Maybe prefix must be really “meson-” I used what was already there “meson”

A typo my end. The file you found is correct of course and edited correctly as well.

ok step by step this modification :
image

but still not working. In the dietpi-config I can see all ttyS1…ttyS7, also ttyAML0 but no AML1

so I added both uart :
image

but still not luck to get communication working
according to this :
https://wiki.odroid.com/odroid-n2/application_note/gpio/uart

I also tried communication to ttyS but also not working
but I know that it was ttyAML1 and it also there :
https://dietpi.com/forum/t/enabling-uart-on-odroid-n2/13754/5
with some code for uart enabling, but I don’t know how to use and if it’s possible to use.

So to be sure, I connected usb to rs 232 adapter and ebus is working, so it’s really dietpi update problem. After update uart on the board is disabled. So now I need to get working again. I will be grateful for any help.

I’m not sure that something changed on our bash script. Probably an apt package update that incluence in this case.

When I installed dietpi first time, I did nothing. Port ttyAML1 was all the time here. So in the dietpi-config I switched on and communication on the pin 8 and 10 was working.

It doesn’t matter now, now I need to know how to activate it again

So it looks like no dietpi support for odroid n2+ onboard uart.
:sleepy:

Why are you not using the default debug console on /dev/ttyAML0 which is present and also enabled for boot messages and with a login console by default? It’s this dedicated 4 pins connector on the PCB.

Btw, do not use the Odroid Wiki for such info, as it refers to the vendor kernel, not mainline kernel.

After enabling the device tree overlays, are there additional /dev/ttyAML* or /dev/ttyS* devices? Probably they are there and you just need to enable a login console for them.

AML0 I did not tested, because is hard for me connect to this pins and yes, there can be a some console communication which I don’t know how ebus adapter will interpret.
Which instruction to use to check actual running devices ? I will try before overlays modification and after to be able answer you correctly.

sorry don’t know what is it :roll_eyes:

uartA not added:

after uartA added :

looks it’s the same before/after

and once more edited file:

Indeed that is true. It is made for the Hardkernel UART adapter which fits this connector: https://www.hardkernel.com/shop/usb-uart-2-module-kit-copy/

Cam you check:

ls -al /dev/ttyAML* /dev/ttyS*

image

image

no change

and file:

rootdev=UUID=81343031-b96f-416b-969a-d8561349d3e4
rootfstype=ext4
# The init system logs to the console defined last.
consoleargs=console=tty1 console=ttyS0,115200 console=ttyS1,115200 console=ttyS2,115200 console=ttyS3,115200 console=ttyAML0,115200 console=ttyS7,115200 console=ttyS6,115200 console=ttyS4,115200 console=ttyS5,115200
verbosity=4
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u
extraargs=net.ifnames=0
docker_optimizations=off
overlay_path=amlogic
overlay_prefix=meson
overlays=uartA uartC
user_overlays= 

Okay, sadly seems those overlays are either broken or do not work in Odroid N2. Since it fits the case, I explained the situations with those overlays provided by Armbian in general here: Why is hardware peripherals setup / config (e.g. using device tree overlay) hidden from view - #7 by MichaIng

I’ll however test/verify this on my Odroid N2+ and see whether it can be trivially fixed, respectively whether there is a simple functional status toggle for UART1.

For my own reference, here is the Armbian patch to add those overlays: build/general-meson64-overlays.patch at e33842ef2c2fefecbcd7c14724c0cff5250cd34a · armbian/build · GitHub

diff --git a/arch/arm64/boot/dts/amlogic/overlay/meson-uartA.dts b/arch/arm64/boot/dts/amlogic/overlay/meson-uartA.dts
new file mode 100644
index 000000000000..3aecd60aaf64
--- /dev/null
+++ b/arch/arm64/boot/dts/amlogic/overlay/meson-uartA.dts
@@ -0,0 +1,11 @@
+/dts-v1/;
+
+/ {
+    compatible = "amlogic,meson-gxbb";
+    fragment@0 {
+	target-path = "/soc/bus@c1100000/serial@84c0";
+        __overlay__ {
+            status = "okay";
+        };
+    };
+};
diff --git a/arch/arm64/boot/dts/amlogic/overlay/meson-uartC.dts b/arch/arm64/boot/dts/amlogic/overlay/meson-uartC.dts
new file mode 100644
index 000000000000..2b40ee4c02d3
--- /dev/null
+++ b/arch/arm64/boot/dts/amlogic/overlay/meson-uartC.dts
@@ -0,0 +1,11 @@
+/dts-v1/;
+
+/ {
+    compatible = "amlogic,meson-gxbb";
+    fragment@0 {
+	target-path = "/soc/bus@c1100000/serial@8700";
+        __overlay__ {
+            status = "okay";
+        };
+    };
+};

So we need to check whether /proc/device-tree/soc/bus@c1100000/serial@84c0/status and /proc/device-tree/soc/bus@c1100000/serial@8700/status still exist or whether something changed about this with recent Linux.

Hi, thank you for your answer. Question from my side is, what to do to get working again (before update/upgrade) it was working. For me (as quite newby) it’s not clear.

Or, is there any way to install “old” dietpi version and disable dietpi upgrade which is disaster for me?

If you need some tests, please write me.

Thanks

edit: is a solution use a user overlay described here ?
https://dietpi.com/forum/t/enabling-uart-on-odroid-n2/13754/4

edit2:
tried this:


but really not sure if instruction is correct

Did you had a chance to test it ? Any idea how to solve ?
Thank you

The two devices indeed do not exist. Instead:

root@OdroidN2:~# cat /proc/device-tree/soc/bus@ff800000/serial@3000/status
okay
root@OdroidN2:~# cat /proc/device-tree/soc/bus@ff800000/serial@4000/status
disabled
root@OdroidN2:~# l /proc/device-tree/aliases/
total 0
-r--r--r-- 1 root root 23 Jan  1  1970 ethernet0
-r--r--r-- 1 root root 17 Jan  1  1970 mmc0
-r--r--r-- 1 root root 18 Jan  1  1970 mmc1
-r--r--r-- 1 root root 17 Jan  1  1970 mmc2
-r--r--r-- 1 root root  8 Jan  1  1970 name
-r--r--r-- 1 root root 35 Jan  1  1970 rtc0
-r--r--r-- 1 root root 25 Jan  1  1970 rtc1
-r--r--r-- 1 root root 30 Jan  1  1970 serial0
root@OdroidN2:~# cat /proc/device-tree/aliases/serial0
/soc/bus@ff800000/serial@3000

So the first is ttyAML0 and the second most likely ttyAML1. There are even more if needed:

root@OdroidN2:~# l /proc/device-tree/soc/bus@ffd00000/serial*
serial@22000/ serial@23000/ serial@24000/

all disabled. Let’s see:

root@OdroidN2:~# cat uart1.dts
/dts-v1/;
/plugin/;
/ {
        compatible = "amlogic,g12b";
        fragment@0 {
                target-path = "/soc/bus@ff800000/serial@4000";
                __overlay__ {
                        status = "okay";
                };
        };
};
root@OdroidN2:~# dtc -I dts -O dtb -o /boot/overlay-user/uart1.dtbo uart1.dts
root@OdroidN2:~# G_CONFIG_INJECT 'user_overlays=' 'user_overlays=uart1' /boot/dietpiEnv.txt
root@OdroidN2:~# reboot
...
root@OdroidN2:~# l /dev/ttyAML6
crw-rw---- 1 root dialout 243, 6 Apr  3 23:57 /dev/ttyAML6

Uh, ttyAML6, I wanted ttyAML1 :smile:. Tested all others:

  • /proc/device-tree/soc/bus@ffd00000/serial@22000 => ttyAML6 as well :thinking:.
  • Tested the other two, and in all cases /dev/AML6 is present. I checked the device tree nodes and the one defined was set to “okay” as expected. Also when removing the overlay, /dev/ttyAML6 is gone.

Something is a little broken with this device tree. However, probably you can test the above first overlay with /dev/ttyAML6 and see whether this works on the pin you previously used:

apt install device-tree-compiler
mkdir -p /boot/overlay-user
cd /boot/overlay-user
cat << '_EOF_' > uart1.dts
/dts-v1/;
/plugin/;
/ {
	compatible = "amlogic,g12b";
	fragment@0 {
		target-path = "/soc/bus@ff800000/serial@4000";
		__overlay__ {
			status = "okay";
		};
	};
};
_EOF_
dtc -I dts -O dtb -o uart1.dtbo uart1.dts
G_CONFIG_INJECT 'user_overlays=' 'user_overlays=uart1' /boot/dietpiEnv.txt
reboot