Lesson 11 – Booting Linux on the ARM host of ZYNQ
So far we have shown our example designs on the ZYNQ device using a bare-metal system for the ARM CPU cores. In this lesson we focus on the procedure through which the Linux operating system can be run on the ARM cores of the ZYNQ. We try to show every possible option for bringing up Linux on the ZYNQ.
We then create a simple hardware, consisting of two GPIO units implemented on the PL. For these hardware units we develop a Linux kernel level driver, along with its user level application, so that we can write to these hardware blocks and read from them through our software running on teh ARM host.
Videos recorded for Lesson 11 (Booting Linux on ZYNQ) so far:Part | Description | Link |
---|---|---|
1 | Part I covers the Linux boot sequence on ZYNQ device. Brief description of BOOT.ini file contents and brief description of our hardware test platform for this lesson. | Watch online |
2 | In Part II we practically show the steps required for compiling the u-boot and the Linux kernel (mainline) for the ZYNQ. And then we boot the result of our work on the zed board. | Watch online |
3 | In Part III, we study how to boot Linux from the SD card. We then look at how tftp protocol can be used to load the required files over the network to the ZYNQ device memory during booting operation. | Watch online |
Please make a donation if the videos have been useful for you.
hello sir,
i need your help, basically i want to design a moving average with AXI compatibility which will average the last three samples. and want to check that IP on zedboard for streaming apllication…so can you please guide me how should i proceed?
Thanx in advance
Well honestly speaking for people who are new to AXI, and designing RTL with it, my first suggestion is to use the Vivado HLS flow.
Then you directly code in C, and the generated RTL by the tool really works on the hardware.
But as of your task, it is extremely easy using an AXI Stream interface. If you have watched my current videos carefully should really be able to do it.
Very excited for next entries in this lesson. Thanks for you work in these videos.
hello
I’m tring to make u-but for zynq_zc706 like your works in video but when i insert in command line ‘make’ ,i reach to bellow error
m-reza@mreza-N43SN:~/linux/u-boot-xlnx$ make zynq_zc70x_config
Configuring for zynq_zc70x board…
m-reza@mreza-N43SN:~/linux/u-boot-xlnx$ make
gcc: error: unrecognized command line option ‘-mno-unaligned-access’
gcc: error: unrecognized command line option ‘-mfpu=neon’
GEN include/autoconf.mk.dep
gcc: error: unrecognized command line option ‘-mno-unaligned-access’
gcc: error: unrecognized command line option ‘-mfpu=neon’
GEN include/autoconf.mk
gcc: error: unrecognized command line option ‘-mno-unaligned-access’
gcc: error: unrecognized command line option ‘-mfpu=neon’
CHK include/config/uboot.release
CHK include/generated/version_autogenerated.h
CHK include/generated/timestamp_autogenerated.h
UPD include/generated/timestamp_autogenerated.h
CC lib/asm-offsets.s
gcc: error: unrecognized command line option ‘-mno-unaligned-access’
gcc: error: unrecognized command line option ‘-mfpu=neon’
make[1]: *** [lib/asm-offsets.s] Error 1
make: *** [prepare0] Error 2
m-reza@mreza-N43SN:~/linux/u-boot-xlnx$
do you know how i can solve it?
thanks
are you sure cross_compile and arch environment variables are set?
Hi,
Thank you for your very interesting videos. I have found them more useful than official videos from Xilinx.
Could you please make a video about the boards which are based on Zynq devices and compare their features with respect to their prices? I think it will be useful for the guys who want to buy one of them.
Could you tell me the ways to write devicetree for getting interrupt from GPIO?
با عرض سلام و احترام
من محمد ایوب زاده هستم از مشهد که تازه کار با میکروی ARM رو شروع کردم
آموزش های شما رو در زمینه میکرو های ARM و معماری کامپیوتر دیدم بسیار آموزنده بود مطالبی که در هیچ کتاب و سایت مشابه نیست واقعا از زحمات شما ممنونم
اقای دکتر یک سوال مهم از شما داشتم
آیا این امکان وجود داره که به برنامه bootloader داخلی میکرو که سازنده پروگرم کرده است دست رسی پیدا کرد ؟
این مثال در میکرو ها AVR وجود داره و این برنامه موجود هست ولی در مورد میکرو ها LPC1768 و LPC1788 و یا هر میکرو بر پایه ARM نیر این امکان هست که به برنامه bootloader میکرو دست رسی پیدا کرد ؟ و تغییراتی در ان ایجاد کرد ؟
و یا بدون استفاده از نرم افزار flash magic این کارو با UART انجام داد ؟
لطفا اگر اطلاعاتی در این مورد دارید کمک کنید خیلی بهش نیاز دارم .
ممنون از شما
Very nice tutorials. Waiting for next one.
I want to send the video stream to PL which I read from sd card with help of opencv in PS on linux environment, process the video in HLS and send it back to ps for processing and display. Any kind expert advice how to send the video stream from ps to pl in linux.
Thanks
Hi. That is easy! use the AXI VDMA. The VDMA can act in both directions. It can receive your video pixels over an AXI Stream input and copy it to the DRAM memory over its AXI Master MM plug and also it can read the video pixels from DRAM and send them out through an AXI Stream master port.
Thanks I will try it. Might be i need to see all your video once again. You are doing really great job for begginers like me. Tons of Thanks.
Hi,
When I try to compile the linux kernel (after having configured it for Zedboard as given in your tutorials), I get the following error:
arch/arm/kernel/asm-offsets.c:53:2: error: #error Your compiler is too buggy; it is known to miscompile kernels
#error Your compiler is too buggy; it is known to miscompile kernels
arch/arm/kernel/asm-offsets.c:54:2: error: #error and result in filesystem corruption and oopses.
#error and result in filesystem corruption and oopses.
^
make[1]: *** [arch/arm/kernel/asm-offsets.s] Error 1
make: *** [prepare0] Error 2
I have updated my gcc to version 4.9.2 and set it as default, but I am still getting this error. Please help.
The first thing which comes into my mind is that you have not set the CROSS_COMPILE env variable. Also after setting that one make sure you have sourced the setting64.sh file in vivado.
e.g.
source /opt/Xilinx/Vivado/Vivado…/setting64.sh
after connecting zed-board, executing the command below:
[root@DeToNaToR dev]# picocom –b 115200 –f n –p n /dev/ttyACM0
picocom v1.6
port is : /dev/ttyACM0
flowcontrol : none
baudrate is : 115200
parity is : none
databits are : 8
escape is : C-a
local echo is : no
noinit is : no
noreset is : no
nolock is : no
send_cmd is : sz -vv
receive_cmd is : rz -vv
imap is :
omap is :
emap is : crcrlf,delbs,
FATAL: cannot open /dev/ttyACM0: No such file or directory
_____________________________________________ _______________________
After listing the contents of the directory “/dev” ,ttyACM0 is missing.
well, lets say it this way, the zed board’s usb console interface is bullshit! (This is my view of course)
The ZC702 usb serial interface is much more stable and better.
said that,
when you connect your zed board to your computer (better to say, when you turn it on)
in the command prompt, run this command
dmesg
this gives you the messages generated by your linux kernel. Now here at the end of messages, double check if there is any error or error like message.
If yes, re-power the board, even reboot your system. If no, then the /dev/ttyACM0 interface should work.
Now, the kernel may also show you which /dev/ttyACMx the device is using. This you can use to issue the command:
e.g.
sudo picocom –b 115200 –f n –p n /dev/ttyACM0
hope this help you.
Hi,Sir,
Many thanks for your great video.
I got one question: if I want to initialize some registers(after the bitstream is downloaded into PL) located in PL during u-boot phase, how should I customize my u-boot to do this? Do you have any experiences on this?
Thanks in advance! Looking forward to your reply.
Best Regards,
Chris Song
Hi What about putting it some where in /u-boot-xlnx/board/xilinx/zynq/board.c e.g. after dram controller initialization is done. ?
Hi Mohammad S. Sadri,
I would like to thank you for these videos. I have been watching these videos in order to get familiar with Zynq and how to compile linux in order to boot linux, which I have been able to do thanks to you. Currently I am trying to send and read data from linux to a custom peripherical which is basically a combinational circuit that I want to send a 1024 bits as input and read 512 bits. My problem is that I haven’t written before a driver and I don’t know what would be the best approach to do this or if there is any example out there that I can use to achieve this (any documentation or examples that you may think can be useful would be great).
Thank You very much
Jorge Rios
Hi. well, for writing a linux kernel level driver, if you want to be able to do it yourself, read the lovely book : Linux Device Drivers Edition 4. And…dada!… you become a Linux kernel level driver developer.
do you have any guide on how to run dma on petalinux? i got the baremetal running, but not sure how to get the dma run on zynq linux
Hi. I have put this video in the list of videos to be created. Soon I will have it on my channel.
Hi dear Sadri
in this lesson(Booting Linux on the ARM host of ZYNQ), you explained the whole process in linux enviroment, so how can i do the same thing for windows? i used CMD, but it showed an error when i executed the “make” command…
so what should i do?
Hi. What is Windows? 😉
Hi dear Sadri
When i issue the “make” command, i encounter with this error :
reza@reza-laptop:~/MylinuxTools/Xilinx—linux/u-boot-xlnx-master$ make
make: arm-xilinx-linux-gnueabi-gcc: Command not found
/bin/sh: 1: arm-xilinx-linux-gnueabi-gcc: not found
dirname: missing operand
Try ‘dirname –help’ for more information.
scripts/kconfig/conf –silentoldconfig Kconfig
CHK include/config.h
UPD include/config.h
GEN include/autoconf.mk
/bin/sh: 1: arm-xilinx-linux-gnueabi-gcc: not found
make[1]: *** [include/autoconf.mk] Error 1
make: *** No rule to make target `include/config/auto.conf’, needed by `include/config/uboot.release’. Stop.
do u know how can i solve it?
what so
Hi dear Sadri
plz make a lesson about linux drivers!
I would love to do that. But that needs a financial support from a university or an organization. If TU kaiserslautern or any one wanted to support me through these, I will create some videos on high level synthesis , pci express and linux kernel driver development.
Please note that each of those videos that you see on youtube has taken tremendous amount of work.
Hi
I want to say thank you and I have a question
I’m using parallella board and followed this http://www.adapteva.com/white-papers/building-linux-for-parallella-platform To boot over an SD card
How would I get user application to run automatically after the parallella boots up?
I have created a C project in SDK that should be run on the zynq PS and should write and read from the PL
Does the root file system image for your linux contain init.sh file? if yes, it is a good place to put your executable there.
other good place is inside /etc/init.d (for this one do a google search to learn how to update those scripts)
another possible place is /etc/profile (if it exists)
I’m using the rtfs provided in this link http://www.adapteva.com/white-papers/building-linux-for-parallella-platform
I don’t have linux in my laptop, and I manage to create BOOT.BIN using all what is provided exept the bitstream
how can I do that task without the need of linux in my laptop
Is there any way that I can set my SD card to contain my C program allong with (or among) the BOOT.BIN files and then just insert it in the platform and it will run
I don’t mean user application to run automatically , I mean my project
Hi Ok sorry may be I didn’t get your question.
You have a bare metal (stand alone) system or a Linux based one?
I have not used the Parallela board directly (and I don’t see why I should use it!?) but if you elaborate your problem further, I can help you.
I’m using the rtfs provided in this link http://www.adapteva.com/white-papers/building-linux-for-parallella-platform
I don’t have linux in my laptop, and I manage to create BOOT.BIN using all what is provided exept the bitstream
how can I do that task without the need of linux in my laptop
Is there any way that I can set my SD card to contain my C program allong with (or among) the BOOT.BIN files and then just insert it in the platform and it will run
http://stackoverflow.com/questions/32640304/setting-sd-card-to-automatically-run-program-after-booting-before-inserting-it
For example I want the ARM processor to transfer some data to the PL and read it back automatically after booting up and I want to see that on my terminal, just ARM running that C code
salam,
How we can obtain a copy of Petalinux with its related softwares?
Thank you
direct download from xilinx web site, or if you have problem and you need help, purchase as fpga download help package from
green-electrons.ir
Hi Mohammad,
First of all, thanks for taking the time to make these videos, very helpful! You mentioned at the start of this set of lectures that you were planning to show an example of how to access PL resources through an application in the user space. I understand that these videos are made in your spare time and that you may not have the time or resources to make as many as you would like. However, in the meantime, how and what would you suggest to someone seeking to develop such an application? Can you recommend any other good resources?
Also, in your opinion, would it be quicker and easier to begin by designing an application running through a Linux OS or is it more straightforward to begin by implementing a bare-metal system (with regards to including some PL co-processing)?
hi
thanks for your great work.
i’ve been always following your videos since i was a student in IUT
would you please create some videos about writing Linux kernel level drivers. in lesson 11 part I you said at the end your gonna show us how to create Linux kernel drivers and how to connect to m_axi_gp0 and also how to handle interrupt from pl. but it never happened 🙁
i really appreciate if you do so or at least give me some hints or documentation.
Hi Ramin, such a video is already available and you can purchase it at the green-electrons iranian online shop http://www.green-electrons.com/ir/
Hi, thanks for informative videos, they really helped me during my project.
Could you extend this Lesson to developing Drivers. ?
It would be really helpful.
Hi Mohammad,
Thank you for all your videos. They are consistently awesome.
I would like to add my support to the last two comments.
It would be amazing if this lesson could have a part 4 on accessing PL resources through an application in the user space + device drivers.
You’re Excellencies,
Dear mr.Sadri,
After Booting Linux on the ARM host of ZYNQ, how can I do the transfer data from ZYNQ PL to PS and from PS to PL using SDK?
With Bare-metal application it is easy to do that using #include “xparameters.h” and #include “xil_io.h”; it accept any instruction like this one Xil_Out32(INTPTR Addr, u32 Value). But with linux application, I got the following error : undefined reference to `Xil_Out32′
Kind regards,
Hi there, I have a set of educational videos which teaches you how you can do that. Basically you will need to develop some linux kernel level drivers in order to talk to your hardware ip in the PL and to send data to it and to receive data from it. The educational videos will teach you how you can create your own linux kernel level driver for the axi dma. it teaches you every thing in a simple and easy to understand language (not like the examples of xilinx).
The videos are not available publicly. Please contact me directly if you are interested in them.
Hi Sadri
I really appreciate your video which helps me a lot.
I am a student in Beijing Institute of Technology. The educational videos about linux drive on zynq PL hardware will definitely helps me a lot. I hope that you could do me a favour.
With your help, I have already started built my own zynq block design. When I am trying to use dma as a measure to transfer data from a linux host PS to PL, it still bothers me a lot.
Thank you sincerely.
HI
I too interested in these videos which includes data transfer
from PL to PS and vice versa using AXI DMA with linux as OS
How can I get access to those videos
Hello Sir,
Your videos are very informative, they created a new interest in me to learn FPGA.
I would like to understand how to transfer data between PS and PL using AXI DMA.
How to write a sample application in linux -PS to access taht DMA data etc.
Thanks,
SK
Hi. I have a set of videos on AXI DMA, please watch them all.
Hi Sir,
Very informative tutorial, very helpful.
I have just one question about the part III : Booting Linux on ZYNQ using SD Card or Network tutorial,
what is the value of “bootargs” attribute in devicetree.dts file.
Thank you.
Hi, If you have access to the shared design source code, you can look the parameters up by opening the .dts file, it is there.
sorry to bother you , can you point me to the shared design source code.
the problem is when i first cloned the linux kernel from https://github.com/Xilinx/u-boot-xlnx.git it had a zynq dts file with empty value for “bootargs” property.
Thank you for the fast reply, I really appreciate your help .
Hi, by making a donation you will have access to those files.
Hi Sadri
Your videos are really helpful. Currently I am facing a problem trying to boot linux. When in the u-boot-xlnx folder after setting the environment variables I am getting this error:
/bin/sh: dtc: command not found
make[2]: *** [arch/arm/dts/zynq-zc702.dtb] Error 127
make[1]: *** [arch-dtbs] Error 2
make: *** [dts] Error 2
I am running this on Centos 7 and I have no idea what to do with this error. Hope you can help me out. Thanks
sorry, i forgot to mention, this error is seen after issuing the make command
dtc is the device tree compiler and is located inside the linux kernel source folder.
that should be inside the scripts folder inside linux kernel source code.
add that to your path.
Dear Mr. Sadri,
Please accept my huge “thank you” for all the knowledge you’ve put here. I realize, that you invest a lot of time in this lessons to share your expertise. I really appreciate this.
Thanks.
Be safe, lots of health and inspiration.
Hi,
before I forget, thanks a lot for all the content!
I’m wondering, are you going to finish this lesson? I mean, the development of the linux kernel driver and user application?
Thank you!
hi. i am doing my best to make time to keep producing the zynq ultrascale+ videos.
regarding linux kernel driver development, i have already a good educational package, it is not free though.
And i am gonna make a new package soon. but i cant put every thing for free…