MIKROBUS uart issue

Dear All,
Just i have started to work with beaglePlay board and i want to use MIKROBUS uart(uart5) .
i am facing issue with this and it is not working, So any one can help me to solve this
by sharing example code. or any other type

shailesh parashar

I have a similar issue, did you find a fix?

I build an image from yocto kirkstone. The kernel boot log shows:
2850000.serial: ttyS3 at MMIO 0x2850000 (irq = 30, base_baud = 3000000) is a 8250 main_uart5: serial@2850000 { …
serial serial0: tty port ttyS3 registered

But there is no /dev/ttyS3 node, and there is no /proc/irq/30 node.

What is missing?

I am trying to use the BeaglePlay’s UART5 the pins that come out of the mikrobus connector. I have had some success in disabling the MIKROBUS and GREYBUS drivers, via kernel config, but even after that I am not able to get access to the serial port at /dev/ttyS0. I am now trying to use a DTBO to disable the drviers control of the GPIO’s/UART pins.

I am using a Linux image built from Yocto with the ti-bsp layer added.

I see the following in my dmesg log it shows /dev/ttyS0 is created but when I get into Linux the dev node is gone and I can’t find a way to access that UART.

[    1.469334] printk: console [ttyS2] disabled                                                                                                                                                                                                                                                                                
[    1.469453] 2800000.serial: ttyS2 at MMIO 0x2800000 (irq = 291, base_baud = 3000000) is a 8250                                                                                                                                                                                                                              
[    3.327739] printk: console [ttyS2] enabled                                                                                                                                                                                                                                                                                 
[    3.333879] 2850000.serial: ttyS0 at MMIO 0x2850000 (irq = 292, base_baud = 3000000) is a 8250                                                                                                                                                                                                                              
[    3.342627] serial serial0: tty port ttyS0 registered                                                                                                                                                                                                                                                                       
[    3.348562] omap8250 2860000.serial: PM domain pd:158 will not be powered off                                                                                                                                                                                                                                               
[    3.356142] 2860000.serial: ttyS1 at MMIO 0x2860000 (irq = 293, base_baud = 3000000) is a 8250                                                                                                                                                                                                                              
[    3.364997] serial serial1: tty port ttyS1 registered                                                                                                                                                                                                                                                                       

Any suggestions on things to try or look for?

I shared the solution that worked for me here:

1 Like

I too have been stuck for the past few months attempting to access the UART pins via serial connection. I am running Debian Bullseye. My problem is that I cannot manage to identify a device node in /dev/ associated with main_uart5, which is the device tree node corresponding to the mikrobus UART pins.

My initial understanding was that I had to use an overlay to “release” the mikrobus device tree settings and restoring the “native” UART pin settings, referring to the latest source located at BeagleBoard-DeviceTrees

In /opt/source/dtb-5.10-ti/src/arm64/overlays I created a new .dts file drawing from the aforementioned source file. The contents are as follow:

/* k3-am625-beagleplay-release-mikrobus-set-uart-default.dts */
/dts-v1/;
/plugin/;

&{/chosen} {
overlays {
k3-am625-beagleplay-release-mikrobus-set-uart-default = TIMESTAMP;
};
};
&mikrobus0 {
status = “disabled”;
};
&main_uart5 {
status = “okay”;
pinctrl-names = “default”;
pinctrl-0 = <&mikrobus_uart_pins_default>;
};

I then compiled and installed the overlay using the method described in this forum post Finally I added a line to load the overlay in /boot/firmware/extlinux/extlinux.conf:

fdtoverlays /overlays/k3-am625-beagleplay-release-mikrobus-set-uart-default.dtbo

… and rebooted my Beagleplay. Finally, I noted that the overlay was successfully loaded by running ls /proc/device-tree/chosen/overlays/

@Lars71dk, I see from your solution (using Yocto) that you had success by modifying u-boot options, inserting tty1 and ttyS2 as console arguments. I am, as yet, uneasy about modifying my extlinux.conf without first understanding what is preventing uart5 from being linked. My dmesg output shows consoles enabled by default on tty0 and ttyS2. Alas, similar to @ezrobot above, my dmesg is also showing that ttyS3 and ttyS4 are created before apparently being reclaimed as serial0 and serial1:

[ 1.755656] 2850000.serial: ttyS3 at MMIO 0x2850000 (irq = 30, base_baud = 3000000) is a 8250
[ 1.755728] serial serial0: tty port ttyS3 registered
[ 1.756708] 2860000.serial: ttyS4 at MMIO 0x2860000 (irq = 31, base_baud = 3000000) is a 8250
[ 1.756828] serial serial1: tty port ttyS4 registered

I can only assume that one of those two ttys attaches to uart5 but I’m still uncertain :confused:

Any help or suggestions would be most appreciated!

UPDATE:

Following up with an update as I have made progress on this since yesterday. Drawing from @Lars71dk above-posted solution, I edited /opt/source/dtb-5.10-ti/src/arm64/k3-am625-beagleplay.dts by commenting-out the line force-empty-serdev-controller under &main_uart5, compiling and installing the new dtb. Now a device node is finally appearing at both /dev/ttyS3 and /dev/play/mikrobus/uart. Tested both of these device nodes by running a serial connection using mikrobus UART pins and it works!

1 Like

Yes,
I also observe that ttyS3 is missing from setserial command!

@HKPhysicist For me, the line that prevents /dev/ttyS3 from coming up is:

force-empty-serdev-controller

… in the device tree source in /opt/source/dtb-5.10-ti/src/arm64/k3-am625-beagleplay.dts. From my understanding, it is necessary to manually make the change to the source, vs. just using an overlay alone. Please be especially careful when modifying built-in device tree files so as to avoid compromising a working system. You can reference the original .dts file here.

Steps:

  • Open /opt/source/dtb-5.10-ti/src/arm64/k3-am625-beagleplay.dts in a text editor. Scroll down to the section titled, &main_uart5, near the end of file.
  • Comment-out the setting force-empty-serdev-controller. You can use standard c comment notation.
  • Save the file. To apply the modication, cd to the path containing the Makefile: /opt/source/dtb-5.10-ti/, recompile and install:

sudo make
sudo make install_arm64
sync

Keep in mind this change does not release the mikrobus pins, including uart5; to do so, simply add the following line in /boot/firmware/extlinux/extlinux.conf and reboot the computer:

fdtoverlays /overlays/k3-am625-beagleplay-release-mikrobus.dtbo

Check that the overlay is loaded using: ls /proc/device-tree/chosen/overlays

Hope this helps. Feel free to ask any questions.

1 Like