cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
andreandre
Visitor
Visitor
842 Views
Registered: ‎08-12-2019

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

Hi everybody!

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_3

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_4

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:

****** 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 file

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.

1.jpg
2.jpg
3.jpg
3_1.jpg
4.jpg
6.jpg
0 Kudos
2 Replies
savula
Moderator
Moderator
799 Views
Registered: ‎10-30-2017

Hi @andreandre ,

It is not possible to program the SD card using SDK. after creating the boot image (*.bin) place the bin file in SD card (using your PC) and put the sd card into the board and start your application. Incase if you want to program the QSPI flash then put the boot mode to JTAG and program the device and make sure you need to provide FSBL (boot_my.elf) file instead of your application Zynq_C_code1.elf.

Please refer this user guide for more information :https://www.xilinx.com/support/documentation/sw_manuals/xilinx2015_1/ug1165-zynq-embedded-design-tutorial.pdf

 

Best Regards,

Srikanth

 

0 Kudos
andreandre
Visitor
Visitor
789 Views
Registered: ‎08-12-2019

Hey. Hi @savula !!
1) You inattentively read my question(( And you answered not that i have asked "It is not possible to program the SD card using SDK" ((
I wrote in 3.2, "a" that added the boot file "(boot_my)"
 "b" then added a .bit file to the file
“c” after that, added a file with my code and then GENERATED THE DOWNLOAD FILE.
I wrote this file through a computer in the Win32DiskImager program to the SD card and ONLY then inserted SD into the E310 board !!!

I ask you to see again
a) maybe I did not create the download file in the correct sequence, either created a file unequally, which was then recorded on the CD
b) there is no switch on the E310 board, I connected the programmer to the JTAG socket and programmed it.
c) I do not know how to switch the board to boot from a flash, not an SD card
Best regards

0 Kudos