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: 
Highlighted
Participant rankeney
Participant
8,287 Views
Registered: ‎11-26-2014

Uboot and image.ub in Petalinux

I've built a few custom kernels (one with RT-preempt and one with Xenomai) and was trying to figure out how to boot them on my Zynq system. I use the Petalinux tools to create the BOOT.BIN file containing the FSBL, the BIT file and the u-boot.elf file. If I use a stock Petalinux kernel, the image.ub file created works fine. But I don't know how the image.ub file is generated. If I interrupt the uboot process, I can try loading the kernel, device tree and root file system:

 

U-Boot-PetaLinux> fatload mmc 0 0x8000 uImage
reading uImage
11050224 bytes read in 1033 ms (10.2 MiB/s)
U-Boot-PetaLinux> fatload mmc 0 0x1000000 system.dtb
reading system.dtb
17391 bytes read in 17 ms (999 KiB/s)
U-Boot-PetaLinux> fdt addr 0x1000000

U-Boot-PetaLinux> fatload mmc 0 0x80000 urootfs.cpio.gz
reading urootfs.cpio.gz
7665876 bytes read in 717 ms (10.2 MiB/s)
U-Boot-PetaLinux> go 0x8000
## Starting application at 0x00008000 ...

undefined instruction
pc : [<0000800c>]          lr : [<3ff77634>]
reloc pc : [<ef704f8c>]    lr : [<2f6745b4>]
sp : 3fb52d98  ip : 00000030     fp : 3ff775ec
r10: 00000002  r9 : 3fa54170     r8 : 3ffb0d44
r7 : 3fb62050  r6 : 00008000     r5 : 00000002  r4 : 3fb62054
r3 : 00008000  r2 : 3fb62054     r1 : 3fb62054  r0 : 3fb52fb0
Flags: nZCv  IRQs off  FIQs off  Mode SVC_32
Resetting CPU ...

 

That clearly didn't work. FWIW, I created the uImage file with:

/opt/petalinux-v2015.2-final/tools/linux-i386/petalinux/bin/unexport/mkimage -A arm -O linux -T kernel -C none -a 0x8000 -e 0x8000 -n "Linux kernel" -d images/linux/zImage uImage

 

I created the system.dtb with:

cd subsystems/linux/configs/device-tree/

dtc -I dts -O dtb -o system.dtb system.dts

 

Any ideas as to how to correctly boot manually, how the image.ub is created, and/or what the sequence of events is when uboot loads the image.ub? Obviously in images/linux there is no uImage or system.dtb, so maybe the above steps may not be needed.

 

Thanks for any help!

 

Tags (3)
0 Kudos
2 Replies
Xilinx Employee
Xilinx Employee
7,944 Views
Registered: ‎07-01-2010

Re: Uboot and image.ub in Petalinux

@rankeney

 

The easy way is to follow the petalinux flow [petalinux-build].

 

As you wanted to use the custom kernel, you can replace the petalinux kernel with your custom kernel and still follow petalinux flow to build , customize kernel and build the required images.

http://www.xilinx.com/support/answers/55977.html

 

TRD link section 7 gives details of adding kernel to petalinux and building the kernel.

 

hope this help.

 

Regards,

Achutha

 

---------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------
0 Kudos
Participant rankeney
Participant
7,924 Views
Registered: ‎11-26-2014

Re: Uboot and image.ub in Petalinux

Thanks for the reply, but no luck. The first link says to go to the directory "${PETALINUX}/software/linux-2.6.x/" which doesn't exist in any Petalinux version I've worked with. Normally it would be "$(PETALINUX)/components/linux-kernel/xlnx-3.xx". The second link I had tried previously, but the Petalinux kernel build flow doesn't seem to work. I've managed to successfully build the kernels by hand, but with the Petalinux flow, I get errors with my Xenomai build:

 

[INFO ] build linux/kernel
[ERROR] make[5]: *** [scripts/kconfig/zconf.tab.o] Error 1
[ERROR] make[4]: *** [silentoldconfig] Error 2
[ERROR] make[3]: *** No rule to make target `include/config/auto.conf', needed by `include/config/kernel.release'.  Stop.

From build.log:
...
[INFO ] build linux/kernel
[ALL  ] make ARCH=arm CROSS_COMPILE=arm-xilinx-linux-gnueabi- O=/home/robert/build/linux/kernel/linux-xlnx-v14.5 KCONFIG_CONFIG="/home/robert/build/linux/kernel/linux-xlnx-v14.5"/.config -j1 -C /opt/petalinux-v2015.2-final/components/linux-kernel/linux-xlnx-v14.5 all
[ALL  ] make[2]: Entering directory `/home/robert/linux-xlnx-v14.5'
[ALL  ]   GEN     /home/robert/build/linux/kernel/linux-xlnx-v14.5/Makefile
[ALL  ]   SHIPPED scripts/kconfig/zconf.tab.c
[ALL  ]   HOSTCC  scripts/kconfig/zconf.tab.o
[ALL  ] scripts/kconfig/zconf.tab.c:200:24: error: zconf.hash.c: No such file or directory

I had a different set of errors with my RT_preempt build. Is it possible to work outside the Petalinux flow? It doesn't seem like it should be too difficult to package the files I have already generated.

 

 

0 Kudos