cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
aabitria
Visitor
Visitor
715 Views
Registered: ‎06-22-2021

Does Petalinux Zedboard have other UART ports?

Hello,

We have a embedded Linux Zedboard requirement in which it has to communicate with a host program via UART (over USB).  I am aware we have a UART-USB port (/dev/ttyACM0) already being used as a console for logs.  I'm not sure if I can use this port to our needs (while losing the logging capability for debugging).  Is there another UART port available in Zedboard as I can't see any other from the schematics?  Never mind for now if it's just UART without USB (which I think can be remedied by an external UART-to-USB converters).

In case there aren't any other ports, and if I have to use /dev/ttyACM0 for our requirement, what is the way to free this up in Linux and move the console to other ports?  Logging is important for me as this if for debugging.  I'm thinking of SSH.

Thanks,

Alvin

Tags (3)
0 Kudos
11 Replies
rodrirq
Adventurer
Adventurer
682 Views
Registered: ‎04-26-2021

As you say, why don't you connect with the Zedboard via SSH? It is as easy as giving the Zedboard a static IP.

If you don't know how to do it:

$ petalinux-config

Subsystem AUTO Hardware Settings --> Ethernet Settings --> [  ] Obtain IP address automatically (Unselect it).

Then choose the IP and modify your computer ethernet connection to be on the same network.

0 Kudos
aabitria
Visitor
Visitor
619 Views
Registered: ‎06-22-2021

Okay, I found that Zynq has another UART which is uart0.  If I can enable it in Linux I will use it instead of losing the existing console uart1. 

I tried to enable uart0 in Vivado (I'm using Vivado and Petalinux 2020.1 Linux versions) using Zedboard presets, no other additions like MIO GPIO, and maybe removed some unused pins in Zynq PS IP (in Vivado block diagram) just to make it pass validation.  It passed "validate design", generate output, create HDL wrapper, and generate bitstream.  After getting the xsa, I used it in petalinux-config --get-hw-description command then petalinux-build, then generate the BOOT.bin.  After putting the boot and EXT4 rootfs files to SD, I tested its boot.

During booting however, it always hangs up at around the kernel message saying "random: dd: uninitialized urandom read (512 bytes read)" after it mounted EXT4.  This is consistently happening once I add uart0.  How is this happening?  I am attaching my kernel boot logs, and some dts files.

0 Kudos
aabitria
Visitor
Visitor
617 Views
Registered: ‎06-22-2021

Thanks for the suggestion.  I'm currently exploring the possibility of enabling uart0 for Linux and debugging it.

0 Kudos
joancab
Teacher
Teacher
608 Views
Registered: ‎05-11-2015

The Zynq-7000 PS has two UART: Uart0 and Uart1.

I don't have the zedboard details on my head, but typically one of them is routed to a UART-USB chip and appears as a USB port.

The other may be routed to a PMOD connector or pin header.

Bear in mind when you configure the PS, you have some freedom to choose the Uart pins:

joancab_0-1624454395622.png

You can even connect an uart to EMIO pins and route them to normal PL I/O pins.

when you create your FSBL there is an option to which uart to use for the default console. That applies to both bare metal and Linux (there is an additional setting in the petalinux settings as well)

0 Kudos
aabitria
Visitor
Visitor
584 Views
Registered: ‎06-22-2021

Yes, this is what I did in Vivado - enable UART0 and assign it to MIO 14-15 (PmodE).  Nothing is connected to any PmodE pin that's why I chose it since it's available.  In Zedboard Linux, UART1 is already by default enabled, as this port acts as the console where you can see Linux logs and activity.  During its boot (using my Vivado project with uart0 enabled) the log shows both uart has been enabled, then after a while the console log will freeze.

0 Kudos
joancab
Teacher
Teacher
574 Views
Registered: ‎05-11-2015

With Linux, the FSBL boots first, then hands over to u-boot that will launch the kernel, so there are three sw elements to look at to configure the console uart. And I'm not sure whether the PMU may also have access to it, although you may not care about it. And the baud rate also needs to be the same.

I'm not clear, do you want to boot Linux with a pure Uart on the Pmod instead of the one over USB?

0 Kudos
aabitria
Visitor
Visitor
503 Views
Registered: ‎06-22-2021

The intention is to be able to use uart0 in Linux applications (once boot is over).  The default uart - the one over USB - will remain as a console, and I'm not really planning any changes to its status.

0 Kudos
joancab
Teacher
Teacher
470 Views
Registered: ‎05-11-2015

If you enable both Uarts in the PS in Vivado then Linux should find all of them, isn't that happening?

0 Kudos
aabitria
Visitor
Visitor
451 Views
Registered: ‎06-22-2021

Linux can see them, based from the logs below:

hw-breakpoint: maximum watchpoint size is 4 bytes.
zynq-ocm f800c000.ocmc: ZYNQ OCM pool: 256 KiB @ 0x(ptrval)
e0000000.serial: ttyPS1 at MMIO 0xe0000000 (irq = 24, base_baud = 3125000) is a xuartps
e0001000.serial: ttyPS0 at MMIO 0xe0001000 (irq = 25, base_baud = 3125000) is a xuartps
vgaarb: loaded
SCSI subsystem initialized.................

But the logs stop coming later on, as if the system boot has frozen.  The last message is about random dd initialization.  I attached the logs I have.

0 Kudos
aabitria
Visitor
Visitor
418 Views
Registered: ‎06-22-2021

Ok, so what I've found is that the zedboard Linux didn't hang up during the boot, it's the console uart that suddenly has a problem as it stopped sending logs (making it appear the system to be stuck).  I enabled static IP and ethernet connection during petalinux-config, and so I can ssh to it which proves the system is not locked up. There is still other issues like why does this happen to uart1 but maybe it warrants a different question thread.

0 Kudos
vanmierlo
Mentor
Mentor
246 Views
Registered: ‎06-10-2008

Most probably the console has not stopped, but is routed to the other UART.

See ttyPS0-baudrate-locked-when-uartlite-is-present which also handles this problem.

0 Kudos