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("
Hello World
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-TRM.pdf
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_UG_v1_9.pdf
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-Serial-Cable-F/
[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)