UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor snoopy87
Visitor
10,507 Views
Registered: ‎06-18-2014

Zynq booting Linux from SD Card

Hi,

 

I have developed a Linux application with some custom IP in the PL. Until now, in order to run my program, I pluged  a sd card with a linux image on it downloaded from Microzed website and then load the bitstream thanks to Vivado and my linux app with SDK.

Now, I would like to put on the SD card my linux app and also my bitstream in order to start my programm after powering on my Microzed board.

 

In order to do this, I have created a FSBL project on SDK. I have generated the boot.bin file with the following file inside:

  • fsbl.elf (bootloader)
  • myBitstream.bit (datafile)
  • u-boot.elf (datafile)

In my SD card I have loaded the followings files:

  • boot.bin
  • devicetree.dtb
  • init.sh
  • uImage
  • uramdisk.image.gz
  • myApplication.elf

When I plug the SD card on my Microzed nothing happen. No message are display in the terminal. The jumper are correctly set. Where are my mistake ?

 

Regards,

 

Snoopy

 

0 Kudos
6 Replies
10,492 Views
Registered: ‎03-27-2014

Re: Zynq booting Linux from SD Card

hello,

did you partition the sd card well?
mmcblk0p1 (boot) has to be FAT 16
mmcblk0p2 (rootfs) has to be ext4

sudo fdisk /dev/sdb
then p 1 and p 2 (set the memory block)
then t 83 1 and t 83 2 (set Linux as default type)
then a 1 (/dev/sdb1 is now bootable)
w (save)
sudo mkfs.vfat -F 16 /dev/sdb1 (have you done this?)
sudo mkfs.ext4 /dev/sdb2 

 populate the new /dev/sdb2 with a debian rootfs or any other, as you want - we will see that way later.


I guess you generated the devicetree.dtb with the Xilinx tools (SDK) am i right?
never done this before.


I only use the xilinx tools to create the BOOT.bin, and to do so,
you need a bootloader, a bitstream and u-boot.
The bitstream will be used to program the PL at booting (no need to be your final application as you can reprogram it later from the kernel driver).
The bootloader can be easily created by the SDK (fsbl project).
u-boot.elf is a renamed u-boot file obtained by cross compiling u-boot (from the relevant git).

you **need** the arm-xilinx-linux-gnueabi- cross compiler
(source the /vivado/settingsxx.sh at least - may need more complex tools if you are using another toolchain)

Here is a working system

guillaume@debian: source $XILINX_INSTALL_DIR/Vivado/2014.1/settings32.sh
guillaume@debian:~/zynq/zc706/tools$ arm-xilinx-linux-gnueabi-gcc --version arm-xilinx-linux-gnueabi-gcc (Sourcery CodeBench Lite 2013.11-53) 4.8.1 Copyright (C) 2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

 For instance you could retrieve the u-boot-xlnx repository

 

git clone git://git.xilinx.com/u-boot-xlnx.git
cd u-boot-xlnx
make ARCH=arm CROSS_COMPILE=arm-xilinx-linux-gnueabi- zynq_zed 
make ARCH=arm CROSS_COMPILE=arm-xilinx-linux-gnueabi-
cp u-boot u-boot.elf (to be called by SDK later)

reminder: retrieve anyother available configuration in u-boot-xlnx/include/configs
now call the SDK from a VIVADO/EDK project and create a fsbl for your current development board - soc.

 

Go for Tools-> Create Boot Image:

#point to an output folder  /tmp

#search for the fsbl and set it as a bootloader

#search for the project bitstream.bit and set it as a datafile

#search for the renamed u-boot.elf and set is as a datafile

Order and Types are important.

this will create BOOT.bin in /tmp

 

copying BOOT.bin fsbl u-boot.elf bitstream.bit (not needed), should give you at least a u-boot> prompt on the serial port.
Come back if you still got problems having at least a prompt, this shouldn't be to hard to obtain.
Having a booting kernel is another matter.

 

G.W.,
NIST - Time Frequency metrology
0 Kudos
Visitor snoopy87
Visitor
10,482 Views
Registered: ‎06-18-2014

Re: Zynq booting Linux from SD Card

Hi,

 

Thanks for the response. I have tried and now I get the following error: 

 

Xilinx First Stage Boot Loader

Release 2014.1 Aug 20 2014-14:24:47

Silicon Version 3.1

Boot mode is SD

SD: Unable to open file BOOT.BIN: 3

               SD_INIT_FAIL

FSBL Status  = 0xA009

 

Regards,

 

Snoopy

0 Kudos
10,478 Views
Registered: ‎03-27-2014

Re: Zynq booting Linux from SD Card

I never had such an error
did you strictly follow the process? getting a working u-boot is rather easy,

a good starting point would be
http://www.instructables.com/id/Embedded-Linux-Tutorial-Zybo/?ALLSTEPS

step 21 to step 30, skipping step 28
I didn't see you were working on the Microzed, I don't know it but you have to make sure your hardware design is dedicated to this board and you must strictly follow the SDK process, mainly the files types and orders
G.W.,
NIST - Time Frequency metrology
0 Kudos
Visitor snoopy87
Visitor
10,469 Views
Registered: ‎06-18-2014

Re: Zynq booting Linux from SD Card

Hi,

 

I have found a workaround to my problem.

 

I take the default SD image from microzed, I copy on a SD card with my bitstream (bit reversing) and my linux application . Then, in the init.sh file, I load my bitstream and start my application.  

 

 

0 Kudos
10,463 Views
Registered: ‎03-27-2014

Re: Zynq booting Linux from SD Card

I think it's a good idea to start from a working system,
you can softly change things step by step if you want to change the distribution for instance.

is it a petalinux?
once you've got a running linux you can (re)program the PL as you want with the /dev/xdvcfg driver, using a bitstream at boot time programs the fpga but this is not definitive.
G.W.,
NIST - Time Frequency metrology
0 Kudos
Visitor snoopy87
Visitor
10,455 Views
Registered: ‎06-18-2014

Re: Zynq booting Linux from SD Card

Yes, I'm using petalinux. 

0 Kudos