• 0
andre19

Programming Zynq in SDK (SD card or Quad SPI Flash)

Question

Hi everybody!

Hi @jpeyron !

1. I have board Ettus E310 https://kb.ettus.com/E310/E312 With Zynq core on it. 

and JTAG https://www.xilinx.com/products/boards-and-kits/smartlynq-data-cable.html?_ga=2.211956244.1491345133.1565455411-227237821.1553275560

In Vivado i have created simple project for GPIO (J12 -pin8 for board https://files.ettus.com/schematics/e310/e310.pdf C18 for FPGA), i have changed in XDC file to GPIO output IM_1 + IM_31.jpg.daf5ac7a87e32fbb16510658c81ec481.jpg2.thumb.jpg.02d7a8b8dbe33a853a03bdca85293e95.jpg3.jpg.8798856910a491068aa6ab84521b01d1.jpg

2. Then lauch SDK and write my simple code (GPIO turn ON/OFF). Just i have read this example : https://forums.xilinx.com/t5/Embedded-Processor-System-Design/axi-gpio-output-rate/m-p/877948#M41051

#include <stdio.h>

#include "platform.h"

#include "xil_printf.h"

#include "Xscugic.h"

#include "Xil_exception.h"

#include "xttcps.h"

#include "xgpio.h"

#include "time.h"

#include "sleep.h"

#include"xparameters.h"

XScuGic Intc;

XTtcPs_Config *Config;

XTtcPs Timer;

TmrCntrSetup *TimerSetup;

static void SetupInterruptSystem(XScuGic *GicInstancePtr, XTtcPs *TtcPsInt);

static void TickHandler(void *CallBackRef);

int main()

{

       XGpio Gpio0, output;

       unsigned int sl_time=1000;

       init_platform();

    // My GPIO C18 Pin8 J12

    XGpio_Initialize(&output, XPAR_AXI_GPIO_0_DEVICE_ID);

    XGpio_SetDataDirection(&output, 1, 0x00000000);

     while(1)

{

        usleep(sl_time);

        XGpio_DiscreteWrite(&output, 1, 1);

        usleep(sl_time);

        XGpio_DiscreteWrite(&output, 1, 0);

        print("Hello World\n\r");

        xil_printf("\n data writing to GPIO");

     }

}

3. I want to power ON at the board,  and get run my application. "your application will run". Just i read this:

https://reference.digilentinc.com/learn/programmable-logic/tutorials/zedboard-programming-guide/start

a) I created FSBL bootloader project (boot_my) + b) created my Hello_world project added GPIO ON/OFF code to it (Zynq_C_code)     IM_44.jpg.1706084c2de090a3a1c82c01b3a49901.jpg

c) Then i steped by step start to do recomendation from "3"

3.1 I decided to tested text and program FLASH    IM_3.1 "4. Programming the  using Quad SPI" but get ERROR:3_1.thumb.jpg.c873bf5efc576dd6dcc1046c0e5d0b08.jpg

****** Xilinx Program Flash

****** Program Flash v2019.1 (64-bit)

  **** SW Build 2552052 on Fri May 24 14:49:42 MDT 2019

    ** Copyright 1986-2019 Xilinx, Inc. All Rights Reserved.

Connected to hw_server @ TCP:10.0.0.2:3121

Available targets and devices:

Target 0 : jsn-XSC0-Mv//////0

       Device 0: jsn-XSC0-Mv//////0-4ba00477-0

Retrieving Flash info...

Initialization done, programming the memory

===== mrd->addr=0xF800025C, data=0x00000005 =====

BOOT_MODE REG = 0x00000005

WARNING: [Xicom 50-100] The current boot mode is SD.

If flash programming fails, configure device for JTAG boot mode and try again.

Downloading FSBL...

===== mrd->addr=0xF8000110, data=0x00177EA0 =====

READ: ARM_PLL_CFG (0xF8000110) = 0x00177EA0

===== mrd->addr=0xF8000100, data=0x0001A008 =====

READ: ARM_PLL_CTRL (0xF8000100) = 0x0001A008

===== mrd->addr=0xF8000120, data=0x1F000400 =====

READ: ARM_CLK_CTRL (0xF8000120) = 0x1F000400

===== mrd->addr=0xF8000118, data=0x00177EA0 =====

READ: IO_PLL_CFG (0xF8000118) = 0x00177EA0

===== mrd->addr=0xF8000108, data=0x0001A008 =====

READ: IO_PLL_CTRL (0xF8000108) = 0x0001A008

Problem in Initializing Hardware

Flash programming initialization failed.

ERROR: Flash Operation Failed

FROM ERROR I SAW "The current boot mode is SD."

3.2 Such as Ettus E310 has SD card, i decided to tested text and program "3. Programming the using an SD card startup" 

a) I added for bootload file .elf from Debug (boot_my) + b) I added .bit file  + c) I added .elf file with my code from (Zynq_C_code)   IM_5 + IM_6 file5.jpg.a72ff896a22357a0a714e6927ae349c2.jpg6.jpg.8d28ea8523e83bbcff6d4cfcd18c937b.jpg

When i "3.4) Place your boot image file onto a fat32 formatted SD card " i use this program https://software.intel.com/en-us/get-started-galileo-windows-step1

After all this step i don't saw GPIO ON/OFF and don't saw message in terminal.((((

Could anybody help me and explain my mistakes????

Best regards.

Share this post


Link to post
Share on other sites

9 answers to this question

Recommended Posts

  • 0

Hi @andre19,

1. This board doesn't have QSPI. I see that the SD card images are provided by Ettus.

2. I see that you are using AXI UARTLITE. The RX and TX pins are mapped internally to PS in Zynq and there is no need to use AXI UARTLITE.

For starters, delete the AXI UARTLITE from your block design and export the HDF file to the sdk folder from your project, then Program FPGA using the new wrapper, then keep only the

print("Hello World\n\r") to test that everything is configured correctly and it's displayed in the terminal application.

In the terminal aplication you need to insert the protocol parameters ( probably 115200 baud rate, 1 stop bit, no parity, 8-bit character length).

3. I don't understand how you want to see "GPIO ON/OFF" ? GPIO is used to send/receive data through a digital line. You can see the signal with a digital analyzer.

Best regards,

Ana-Maria

 

Edited by Ana-Maria

Share this post


Link to post
Share on other sites
  • 0
On 9/20/2019 at 4:28 PM, Ana-Maria Balas said:

Hi @andre19,

1. This board doesn't have QSPI. I see that the SD card images are provided by Ettus.

2. I see that you are using AXI UARTLITE. The RX and TX pins are mapped internally to PS in Zynq and there is no need to use AXI UARTLITE.

For starters, delete the AXI UARTLITE from your block design and export the HDF file to the sdk folder from your project, then Program FPGA using the new wrapper, then keep only the

print("Hello World\n\r") to test that everything is configured correctly and it's displayed in the terminal application.

In the terminal aplication you need to insert the protocol parameters ( probably 115200 baud rate, 1 stop bit, no parity, 8-bit character length).

3. I don't understand how you want to see "GPIO ON/OFF" ? GPIO is used to send/receive data through a digital line. You can see the signal with a digital analyzer.

Best regards,

Ana-Maria

 

Hi @Ana-Maria Balas

1) For easily start with ettus e310 i bought Arty Z7-20 (open, programmed and supported). Made project in Vivado HLS and SDK , tested result on Arty Z7 , then in analogy created project for  e310. Arty Z7 (clg400) chip and E310 (clg484 ) chip.

2) For Arty I clicked in HLS "+" IP Zynq , then open properties  of Zynq. Default properties of Zynq: i created wrapper, launch SDK and wrote "Hello world" to terminal program via system debugger; and next via SD card (created  BOOT file = fsbl+system wrapper+my code). All works!

3) When i probed "2)" for e310  (i use SD card) - e310 don't start(((  

4) What do you phink i need to change in project or properties in Zynq IP ????1109249522_.thumb.png.644ed0cf41c846d7387ee37eac5a94bd.png

5) Please, look again on schematim of e310 (bank 500 - input for SD , boot mode)

721226715_.thumb.png.0be6cad0a5219db6248039e4cd8e016d.png

Best regards

 

Share this post


Link to post
Share on other sites
  • 0

I don't understand how you probed for e310? You took the SD card with boot.bin that you generated for Arty Z7 and inserted into SD port of the Ettus board?

Or did you make a new project for Ettus E310, and generated a new boot.bin for it ?

The Zynq chip is different for Arty and Ettus. The bitstream generated for Arty Z7 will never work on Ettus.

 

Share this post


Link to post
Share on other sites
  • 0
2 hours ago, Ana-Maria Balas said:

I don't understand how you probed for e310? You took the SD card with boot.bin that you generated for Arty Z7 and inserted into SD port of the Ettus board?

Or did you make a new project for Ettus E310, and generated a new boot.bin for it ?

The Zynq chip is different for Arty and Ettus. The bitstream generated for Arty Z7 will never work on Ettus.

 

Hi @Ana-Maria Balas.

I look configuration of Zynq for Arty Z, then generate NEW project for Ettus chip.  Properties of IP "Zynq" in both projects are same (first project for arty z chip clg400, second project for ettus chip clg484)

"Or did you make a new project for Ettus E310, and generated a new boot.bin for it ?" - yes.

Create boot for ettus, write to SD and insert SD to Ettus - don't work.

What do you phink?

Best regards.

Share this post


Link to post
Share on other sites
  • 0

Dear @Ana-Maria Balas

1) I look properties of IP Zynq, when created project for Arty Z7 : properties are default: (i create boot, write to SD, insert SD and it work, by UART0 it send "Hello world). For Arty Z all Ok. :

1227075065_.thumb.png.0d3bad27a63b6f4ce4b3ad68bc83744b.png

 

2) I send screen of properties of Zynq IP for ettus e310 (chip clg484 chip same type, such for zedboad digilent): 626343651_.png.4afd32a6cfebdf6d800d2b28fa0a5de2.png

a) In IP Zynq by default "Memory Interfaces" Quad SPI flash are selected. For ettus i deselected MIO 1-6 (i look schematic for ettus e310 bank500 ).

b) For SD0 card i selected CD (MIO_0), i decided that for ettus it must be selected

c) I selected UART0 (MIO_14_15)

 

3) What do you phink? Where could be mistake ? What properties of Zynq i must to set for ettus e310?

 

Best regards.

Share this post


Link to post
Share on other sites
  • 0

I created a boot.bin file BOOT.bin

I enabled only the UART and SD from Zynq. You can try it to see if it's printing in the terminal application window.

Set the appropriate COM port and 115200 baud rate, 1 stop bit, no parity, 8-bit character length.

Share this post


Link to post
Share on other sites
  • 0
3 hours ago, Ana-Maria Balas said:

I created a boot.bin file BOOT.bin

I enabled only the UART and SD from Zynq. You can try it to see if it's printing in the terminal application window.

Set the appropriate COM port and 115200 baud rate, 1 stop bit, no parity, 8-bit character length.

Hi @Ana-Maria Balas

Thank you for boot file. I copied it, writed to SD card, insert to ettus e310 board, set my terminal port  - don't saw any reaction, any text on terminal program.

It don't work(((

Share this post


Link to post
Share on other sites
  • 0

I think you should ask for support from Ettus company. I cannot help you because I don't have the preset that they are using for Zynq, and I don't know the DDR Controller Configuration and other configurations.

The purpose of this board is not to be used for general applications and I think you should use the Linux image provided by them, "the OS is responsible for all the device and peripheral management" they are saying on their website.

Edited by Ana-Maria Balas

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now