Sorry, you need to enable JavaScript to visit this website.

Enabling UART 0

Zedboard forums is currently read-only while it under goes maintenance.

Unsolved
8 posts / 0 new
daromart
Junior(0)
Enabling UART 0

Dear all,

I'm trying to use the UART 0 peripheral on the Zedboard (I want to have two UARTs).

I have a very simple baremetal "hello world" that works when I use UART 1 (0xe0001000) but it doesn't when I use the UART 0 (0xe0000000).

So far, I managed to collect information about the pin mapping (see details later).

The main program of my hello world consists of the following steps:

#define SLCR_UNLOCK 0xF8000008
#define SLCR_LOCK 0xF8000004
#define APER_CLK_CTRL 0xF800012C
#define UART_CLK_CTRL 0xF8000154
#define MIO_PIN_10 0xF8000728
#define MIO_PIN_11 0xF800072C

#define REG(x) (*((volatile unsigned int *)(x)))

void main(void)
{
REG(SLCR_UNLOCK) = 0xDF0D; // enable write
REG(APER_CLK_CTRL) = REG(APER_CLK_CTRL) | 0x00100000;
REG(UART_CLK_CTRL) = REG(UART_CLK_CTRL) | 0x1;
REG(MIO_PIN_10) = 0x16E1; // [TRI_ENABLE=1 PULLUP=1, IO_Type=011(LVCMOS33=3.3V), L3_SEL=111(UART 0 RxD, Input)
REG(MIO_PIN_11) = 0x16E0; // [TRI_ENABLE=0 PULLUP=1, IO_Type=011(LVCMOS33=3.3V), L3_SEL=111(UART 0 TxD, Output)
REG(SLCR_LOCK) = 0x767B; // disable write

uart_init();
uart_puts("\nHello World\n\r");

while(1);
}

Unfortunately, I'm not getting any output message.

I also tried using XPS to generate the same system (UART 0 mapped to MIO 10..11) and created a BSP. On the BSP the initialization value had PULLUP=0. I tried with that value but it also failed. (Note: I don't want to use MIO14..15 because my USB-serial cable is designed for 3.3V operation).

Can somebody indicate me what else should I do to make UART 0 working?

Thanks in advance,
Daniel

>>--------- Collected Pin-MMIO information -------<<

UART <=> MIO
============

http://www.xilinx.com/support/documentation/user_guides/ug585-Zynq-7000-...

UART0 => rx=MIO-10 tx=MIO-11 or rx=MIO-14 tx=MIO-15

PMOD pin <=> ZYNQ pin
=====================

http://www.zedboard.org/sites/default/files/documentations/ZedBoard_HW_U...

Pmod | Signal Name | Zynq pin |
JE1 JE1 A6
MIO JE2 G7
Pmod JE3 B4
JE4 C5
JE7 G6
JE8 C4
JE9 B6
JE10 E6

ZYNQ Pin <=> MIO pin
====================

http://www.xilinx.com/support/packagefiles/z7packages/xc7z020clg484pkg.txt

Pin Pin Name Memory Byte Group Bank VCCAUX Group Super Logic Region I/O Type No-Connect
A6 PS_MIO13_500 NA 500 NA NA MIO NA
C5 PS_MIO12_500 NA 500 NA NA MIO NA
B4 PS_MIO11_500 NA 500 NA NA MIO NA
G7 PS_MIO10_500 NA 500 NA NA MIO NA
C4 PS_MIO9_500 NA 500 NA NA MIO NA
E5 PS_MIO8_500 NA 500 NA NA MIO NA
D5 PS_MIO7_500 NA 500 NA NA MIO NA
A4 PS_MIO6_500 NA 500 NA NA MIO NA
A3 PS_MIO5_500 NA 500 NA NA MIO NA
E4 PS_MIO4_500 NA 500 NA NA MIO NA
F6 PS_MIO3_500 NA 500 NA NA MIO NA
A2 PS_MIO2_500 NA 500 NA NA MIO NA
A1 PS_MIO1_500 NA 500 NA NA MIO NA
G6 PS_MIO0_500 NA 500 NA NA MIO NA

My USB-Serial
=============

Olimex USB-Serial:
https://www.olimex.com/Products/Components/Cables/USB-Serial-Cable/USB-S...
[GND_usb] = Blue => GND
[TXD_usb] = Red => JE2
[RXD_usb] = Green => JE3

MIO configuration
=================

UART0
REG(MIO_PIN_10=0xF8000728) = 0x16E1 [TRI_ENABLE=1 PULLUP=1, IO_Type=011(LVCMOS33=3.3V), L3_SEL=111(UART 0 RxD, Input)
REG(MIO_PIN_11=0xF800072C) = 0x16E0 [TRI_ENABLE=0 PULLUP=1, IO_Type=011(LVCMOS33=3.3V), L3_SEL=111(UART 0 TxD, Output)

daromart
Junior(0)
Oh it finally works!! T_T

Oh it finally works!! T_T
It seems the software and hardware was ok, but I need to reset the USB connection each time I power-off/on the board. If somebody needs it, I can make a small tutorial.

jveleg
Junior(0)
Greetings,

Greetings,
I am interested in using two UARTs UART0 and UART1. Can you make this small tutorial you mentioned? Can I access UART0 through a Pmod header (JE1, JD1, JC1, JB1 or JA1)?

daromart
Junior(0)
Just for the sake of

Just for the sake of completeness, I just noticed that Zynq's TRM contains a explanation of how to route the UART0 to pins 46..47 at section 19.5.

amirzed
Junior(0)
Connection with UART 0

Hi,

I am trying to connect UART0 to PL through EMIO. Right now I have created a AXI UART Lite and trying to connect its port to the UART0. What I want to do is simply write some data to UART0 and check if the AXI UART Lite actually received it.

After doing this, I can not even run the simple "Hello World" example. It seems it stuck in a loop or sth.

I just want to know how I can send some data to UART1 and UART0.

Do you have any suggestion how I can do this?

daromart
Junior(0)
Hi,

Hi,

I'm not sure what you mean. What I can explain is how I managed to use the UART1.

The hardware connections between the board and the USB cable are like i show above:

[GND_usb] = Blue => GND
[TXD_usb] = Red => JE2
[RXD_usb] = Green => JE3

(You can see a picture of the connections in the file
safeg-1.0/doc/en/target/zynq/IMAG1048.jpg at
http://www.toppers.jp/download.cgi/safeg-1.0.tar.gz)

About the software please check the file:
fmp/target/zynq_gcc/target_serial.c
from
http://www.toppers.jp/download.cgi/fmp_zynq_gcc-20131203.tar.gz

Regards
Daniel

amirzed
Junior(0)
Let me explain more

Sorry for my bad english and Thanks for answering me.

I want to implement and OR1200 processor in addition to the existing ARM core. What I want to do is to somehow see the messages come from the OR1200 and also be able to send message to this core through UART.

I think what you have done is using the PL(or PS) pins to connect the board to another UART device, right?

Nabeel
Junior(0)
Nabeel

Hello,
I followed all those steps to include in the Vivado design about Pmod connections of JE1. I purchase that cable and connected to PMod in Zedboard 7020. But after generating bitstream file, and running FSBL application or a simple Hello world application, i cannot see any thing in the terminal. What can be the problem ? i didnot do any change in SDK.

Thanks