Sorry, you need to enable JavaScript to visit this website.

Illegal Instruction

Unsolved
6 posts / 0 new
astronomer's picture
astronomer
Junior(0)
Illegal Instruction

Hi all,

I just purchased the microZed board and followed the getting started manual. Now I tried to compile the example helloworld based on Adam Taylor's tutorial. But when I upload the elf file into the sd card and execute on terminal. It gives an "illegal instruction" error. Currently I do not have a JTAG cable thus copying the file is the only option. I suppose this error is related to instruction set used for ARM version.BTW, I'm using 2015.2 vivado.

Could someone with more experience shed light on what might be the causes behinds this error.

Thanks in advance.

TroutChaser's picture
TroutChaser
Moderator(18)
If I understand correctly you

If I understand correctly you just copied your .elf file to the SD Card, changed the MicroZed boot option to SD CARD, and tried to boot the MicroZed?
 
The helloworld .elf file you generated is an executable file but it does not contain any mechanism for initializing the Zynq PS (Processing System). When you use the SDK to download the application via JTAG it is using the ps7_init.tcl file to initialized the Zynq PS prior to running the application. In order to boot directly from the SD Card and run your application you will need to create a boot.bin file that includes an FSBL (First Stage Boot Loader) along with your application code.
 
You might want to take a look at the Avnet Zynq SW Speedway workshop material. It will take you through the process and has hands on labs for your MicroZed board as well.:
Developing Zynq®-7000 All Programmable SoC Software (Vivado 2013.3 and 2014.4.1)
 
-Gary

astronomer's picture
astronomer
Junior(0)
Thanks for the reply. I

Thanks for the reply. I copied the elf file and the entire default boot image from the website. I boot the microZed successfully from the SD card and connect it through URAT with a terminal on my PC. Then from the terminal I execute the elf file with typical linux cmd:

zynq> ./test.elf

which is my hello world executable.

I'll look at the tutorial. Thanks!

TroutChaser's picture
TroutChaser
Moderator(18)
Ahh, I misunderstood, I

Ahh, I misunderstood, I thought that you were trying to boot and run a 'stand alone' application rather than a Linux application.
 
Did you select 'Linux Application' as opposed to 'Standalone Application' when you generated your helloworld app in the SDK?
 
This Xilinx Tutorial Video might be helpful: http://www.xilinx.com/training/zynq/how-to-create-linux-application-usin...
 
-Gary

astronomer's picture
astronomer
Junior(0)
Oh, now I understand what's

Oh, now I understand what's going on. I've made a standalone app which should be boot directly by FSBL.
Another related question, in the linux application, I will no longer have access to all the hardware like GPIOs or SPI interface?

TroutChaser's picture
TroutChaser
Moderator(18)
You can have access to

You can have access to hardware features like GPIO and SPI from a Linux application. But there must be a driver for the hardware either as part of the basic Linux (like sysfs) or by adding a driver. You also have to make sure that Linux is aware of your hardware by adding it to your devicetree if it is not already supported or added.
 
The PicoZed FMC Carrier Card has a current example of using GPIO:
http://zedboard.org/sites/default/files/documentations/PicoZed_FMC_CC_Ge...
 
You can look at the Xilinx wiki for more general information on Linux drivers: http://www.wiki.xilinx.com/Linux+Drivers
 
Your best option would probably be to take a look at some of the very good training videos on Linux, drivers, etc. available on the Xilinx zynq training page: http://www.xilinx.com/training/zynq/
Look under "Runtime Software: FSBL, Linux...."
 
-Gary