Jump to content
  • 0

Real time Linux on Zybo


Jimmy.L

Question

Hey Guys, 

I am trying to install a Preempt_RT patch on the linux. I downloaded the Linux kernel from github which is described in 'Embedded Linux Hands-on Tutorial': https://github.com/DigilentInc/Linux-Digilent-Dev.git . I noticed that the kernel version is 3.18.0, so I install the patch 3.18.24-rt22.patch (since there is no patch for 3.18.0). But when I try to compile the patched kernel with the configuration of full RT, I got this following errors:

 CC      kernel/softirq.o
kernel/softirq.c:1115:13: error: redefinition of 'run_ksoftirqd'
 static void run_ksoftirqd(unsigned int cpu)
             ^
kernel/softirq.c:626:13: note: previous definition of 'run_ksoftirqd' was here
 static void run_ksoftirqd(unsigned int cpu)
             ^
kernel/softirq.c: In function 'run_ksoftirqd':
kernel/softirq.c:1123:3: error: implicit declaration of function '__do_softirq' [-Werror=implicit-function-declaration]
   __do_softirq();
   ^
kernel/softirq.c: At top level:
kernel/softirq.c:626:13: warning: 'run_ksoftirqd' defined but not used [-Wunused-function]
 static void run_ksoftirqd(unsigned int cpu)
             ^
cc1: some warnings being treated as errors
make[1]: *** [kernel/softirq.o] Error 1
make: *** [kernel] Error 2

So I am wondering how to solve this. And I also wonder if there is anybody else trying to use a real time linux on the zybo.

Regards,

Jimmy

 

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

I have a tutorial to build the kernel from scratch, but It's in spanish. With the help of google translate and some carefull reading, I believe that you can make it work ignoring all the OpenCV stuff and using your linux distribution instead of arch: 

http://blog.zembia.cl/instalando-linux-en-la-tarjeta-zybo/

If there are enough interested people, I could translate it.

Reading your post I realized that maybe it's hangs up because is triying to boot Ramdisk. If you compiled u-boot by youtself edit the zynq_zybo.h in /include/configs/.

Change this:

    "sdboot=if mmcinfo; then " \
            "run uenvboot; " \
            "echo Copying Linux from SD to RAM fs... && " \
            "fatload mmc 0 0x3000000 ${kernel_image} && " \
            "fatload mmc 0 0x2A00000 ${devicetree_image} && " \
            "fatload mmc 0 0x2000000 ${ramdisk_image} && " \
            "bootm 0x3000000 0x2000000 0x2A00000; " \
        "fi\0" \

to this:

    "sdboot=if mmcinfo; then " \
            "run uenvboot; " \
            "echo Copying Linux from SD to RAM fs... && " \
            "fatload mmc 0 0x3000000 ${kernel_image} && " \
            "fatload mmc 0 0x2A00000 ${devicetree_image} && " \
            "bootm 0x3000000 - 0x2A00000; " \
        "fi\0" \

then compile u-boot and try again.

 

Best regards

Link to comment
Share on other sites

Recently I tried a mainline kernel, which has the version of 3.12.50. The Preempt_RT patch can be installed perfectly but when I try to boot the kernel on ZYBO. it hands at starting kernel..... 

Device: zynq_sdhci
Manufacturer ID: 2
OEM: 544d
Name: SE08G 
Tran Speed: 50000000
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 7.2 GiB
Bus Width: 4-bit
reading uEnv.txt
** Unable to read file uEnv.txt **
Copying Linux from SD to RAM...
reading uImage
2978320 bytes read in 268 ms (10.6 MiB/s)
reading devicetree.dtb
7430 bytes read in 18 ms (402.3 KiB/s)
reading uramdisk.image.gz
3694172 bytes read in 330 ms (10.7 MiB/s)
## Booting kernel from Legacy Image at 03000000 ...
   Image Name:   Linux-3.12.50-rt68-xilinx
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2978256 Bytes = 2.8 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 02000000 ...
   Image Name:   
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    3694108 Bytes = 3.5 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 02a00000
   Booting using the fdt blob at 0x2a00000
   Loading Kernel Image ... OK
   Loading Ramdisk to 1f7a9000, end 1fb2ee1c ... OK
   Loading Device Tree to 1f7a4000, end 1f7a8d05 ... OK

Starting kernel ...

Booting Linux on physical CPU 0x0
Linux version 3.12.50-rt68-xilinx (jimmy@ubuntu) (gcc version 4.8.1 (Sourcery CodeBench Lite 2013.11-53) ) #1 SMP PREEMPT RT Mon Nov 23 12:24:04 EST 2015
CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine: Xilinx Zynq Platform, model: Xilinx Zynq

I download this kernel from https://www.kernel.org/ , and just copy the zynq_zybo.dts and .config file from https://github.com/Digilent/linux-Digilent-Dev

And how do you guys run real time Linux on Zybo? Any hints?

 

Regards,

Jimmy

Link to comment
Share on other sites

Hey Alejandro,

Thanks for your reply!

Finally I solved the kernel panic problem and also patched the linux kernel with realtime patch, but I still interested in your blog. 

I have to say it's a great blog for the beginners even it is written in Spanish :) and I have some questions regarding your blog.

You mentioned that in zynq_zybo.h file, the line of ramdisk should be removed because you are not going to use ramdisk. I am confusing by this because I think a ramdisk file is necessary for booting Linux, so I got a uramdisk.image.gz in my SD card. I mean, ramdisk is a kind of file system and it is necessary for Linux, right?

And also, about the device tree file. There is one for ZYBO in the folder Linux-Digilent-Dev/arch/arm/boot/dts/ so you don't have to generate from Vivado by yourself.

Best regards,

Jimmy

Link to comment
Share on other sites

Hey Alejandro,

Thanks for your reply!

Finally I solved the kernel panic problem and also patched the linux kernel with realtime patch, but I still interested in your blog. 

I have to say it's a great blog for the beginners even it is written in Spanish :) and I have some questions regarding your blog.

You mentioned that in zynq_zybo.h file, the line of ramdisk should be removed because you are not going to use ramdisk. I am confusing by this because I think a ramdisk file is necessary for booting Linux, so I got a uramdisk.image.gz in my SD card. I mean, ramdisk is a kind of file system and it is necessary for Linux, right?

And also, about the device tree file. There is one for ZYBO in the folder Linux-Digilent-Dev/arch/arm/boot/dts/ so you don't have to generate from Vivado by yourself.

Best regards,

Jimmy

Yeah, I know that you dont have to generate the device tree, but is good to know how. 

Regarding the ramdisk, is not necesary for booting linux. I don't have a uramdisk image in my sd card and I booted archlinux from the sd card and also Linaro ubuntu. But if you don't have ramdisk and don't modify the zynq_zybo.h it wont boot at all.

 

best regards.

Alejandro

Link to comment
Share on other sites

Glad to know it.

I just followed the hands-on tutorial and don't know we also have other choices. 

So, you are using archlinux and Linaro Ubuntu instead of uramdisk because archlinux and Linaro Ubuntu are file system as well, am I correct? But the Linux kernel is the same, which is 3.18.0 downloaded from Github, Digilent branch.

Best regards

Jimmy

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...