Trenz Electronic GmbH Support Forum

Open Source => Open source hardware => Topic started by: ccortiz on January 19, 2017, 11:20:03 AM

Title: A baremetal blinking led for ZynqBerry?
Post by: ccortiz on January 19, 2017, 11:20:03 AM
Hello,

I have some problems accesing GPIO on Zynqberry. I am trying to switch on/off GPIO4 (IO_L1N_T0_34).

On xparameters.h can not see a right definition for GPIOS throught AXI (for 40 pin expansion connector).
I guess I need something like "XPAR_AXI_GPIO_0_DEVICE_ID" definition, but I can not find it.

I tried to use te0726-test_board_noprebuilt-vivado_2016.2-build_07_20160927155803.zip running vivado_create_project_batchmode and design_run_project_batchmode scripts.

I tried with prebuilt version too, but no luck.


Could you provide a basic example for use a GPIO on ZynqBerry?

Thanks
Title: Re: A baremetal blinking led for ZynqBerry?
Post by: Oleksandr Kiyenko on January 23, 2017, 09:20:07 AM
Hello,

GPIO controller signals in this project is not directly connected to GPIO pins. To connect it you have to set mux in rpi_gpio core.
Please check rpi_gpi Documentation - Product guide

Best regards
Oleksandr Kiyenko
Title: Re: A baremetal blinking led for ZynqBerry?
Post by: ccortiz on January 23, 2017, 05:10:51 PM
After check "mux_connection_table.pdf" generated from rpi_gpio_v1_0(1.0) in Vivado, I have configured pin mux with this command:

PINMUX_mWriteReg(0x43C00000, 0x16, 0);

base Address: 0x43C00000
offset: 0x16
value: 0 (for GPIO4 as MIO4)

Searching the web, I found a good example to switch on/off some GPIOS in PL and PS:
https://www.xilinx.com/support/answers/51786.html

But trying to adapt the example to ZynqBerry I found that functions needed to change GPIOS in PL are not available in my project.

#include "xgpio.h"
XGpio_DiscreteWrite()

...

My SDS project is made using your testboard hdf, so I guess I am using a right BSP for ZynqBerry board.

If GPIO4 is mapped on IO_L1N_T0_34 (PL) and I do not have functions to work with GPIO's in PL, How should I do to change a simple GPIO in your board?

Really is so dificult to provide a working example?

Thanks
Title: Re: A baremetal blinking led for ZynqBerry?
Post by: Antti Lukats on January 23, 2017, 06:22:44 PM
Hi

the pin mux connects the EMIO pins to I/O you are trying to use include file for AXI GPIO, this of course can never work.

We have so far not have many requests for LED blinky design issues, most user want to use the FPGA PL for some more advanced features.

If you do not want to use the pinmux, you can remove it completly and wire the IO pin directly to AXI GPIO or EMIO.

Title: Re: A baremetal blinking led for ZynqBerry?
Post by: JH on January 24, 2017, 08:53:26 AM
Hi,

on attachment you found a picture (vivado_bd) of simple design with EMIO GPIO and AXI GPIO interface.
You can use one of them, like Antti has wrote. Set correct Loc constrains of the IOs with Vivado Floorplanner.
Generate Bitstream and export HDF file to SDK. On SDK, you can try the BSP examples, see second picture (sdk_bsp_example). You must also set the UART to ps7_uart_1 instead of default ps7_uart_0 to get console output.

br
John