cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
160 Views
Registered: ‎01-27-2016

Petalinux Bad Fit Kernel Image

Jump to solution

Hello Community.

I am trying to store in QSPI flash a petalinux 2028.2 image, and I get "bad fit kernel image" message.

jasonweb_1-1600067999243.png

 

I have seen other posts and several Xilinx UGs but I am not able to configure correctly my system.

 

- petalinux-config with next flash settings:

jasonweb_0-1600067796978.png

(0x500000+0x900000 = 0xE00000 offset)

 

For BIN file generation, I try two options.

Option 1:

Packaging:

jasonweb_2-1600068249122.png

 

And then, flash 'BOOT.BIN' and 'zynqmp_fsbl.elf' with Vivado Hardware Manager.

 

Option 2:

- With XSDK, create Boot Image

jasonweb_3-1600068368431.png

and set the offset for image.ub

jasonweb_4-1600068409204.png

 

In both options, I am not able to get a correct system running.

I suspect it may be regarding the offset of kernel partition, but I not found the error.

 

Thank you for your help.

Regards.

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Xilinx Employee
Xilinx Employee
96 Views
Registered: ‎10-06-2016

Hi @jasonweb 

Did you try to read from U-Boot the memory content on the flash image and check against the expected data (image.ub)? Is the read size of the file correct (0xa80000)?

Regards


Ibai
Don’t forget to reply, kudo, and accept as solution.

View solution in original post

4 Replies
Highlighted
Mentor
Mentor
129 Views
Registered: ‎01-28-2008

Hi @jasonweb 

  The BOOT.BIN you're creating with petalinux-package command includes the kernel image. While that may be a valid way of shipping the kernel to the target, I haven't done it that way. In the QSPI partitions, you should program the image.ub at the offset 0xE00000 according to your partitioning. This is the offset where U-Boot will look for the image to load from QSPI.

  That said, I'd try the following:

a) Remove the kernel from BOOT.BIN (i.e. the --kernel switch in petalinux-package).

b) Use Vivado hardware manager, XSDK/Vitis or "program_flash" binary to program the image.ub to QSPI at 0xE00000.

 

Thanks,

-Pat

https://tuxengineering.com/blog
0 Kudos
Highlighted
Visitor
Visitor
108 Views
Registered: ‎01-27-2016

Hi @patocarr 

Thank you for your response, but I can´t get successful results.

 

a) If I remove --kernel option packaging the image, I get the next error (flashing with Vivado Hardware Manager)

jasonweb_0-1600149740835.png

 

 

b) Trying to flash only 'image.ub' at 0xE00000 with the next command

program_flash -f image.ub -fsbl zynqmp_fsbl.elf -offset 0xE00000 -flash_type qspi_single -cable type xilinx_tcf url tcp:localhost:3121

i get the known error:

jasonweb_1-1600153006886.png

 

Any more suggestions?

 

Thank you a lot.

0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
97 Views
Registered: ‎10-06-2016

Hi @jasonweb 

Did you try to read from U-Boot the memory content on the flash image and check against the expected data (image.ub)? Is the read size of the file correct (0xa80000)?

Regards


Ibai
Don’t forget to reply, kudo, and accept as solution.

View solution in original post

Highlighted
Visitor
Visitor
68 Views
Registered: ‎01-27-2016

Hi @ibaie 

OK! that was the mistake!

My kernel partition wasn´t big enought for the kernel file.

In petalinux-config, I have configured the correct partition size and my system start successfully!

 

I am going to summarize my steps for other users. I use a custom project with my hardware design.

 

1. Configure hw:

 

petalinux-config --get-hw-description=<path_to_my_design>

 

- Subsystem AUTO Hardware settings --> Advanced Bootable...--> boot image settings --> image storage media --> primary flash.

- Subsystem AUTO Hardware settings --> Advanced Bootable...--> kernel image settings --> image storage media --> primary flash.

- Subsystem AUTO Hardware settings -->Flash Settings --> be sure kernel offset match with previous partitions sizes (0xe00000 = 0x500000 + 0x900000)

 

And kernel partition size is bigger than image.ub file. This file is generated after this proccess. If you check this size and it it bigger than partition size, you must to relaunch the step 1 and increment kernel partition size.

 

jasonweb_0-1600149740835.png

 
 

2. Configure rootfs:

 

petalinux-config -c rootfs

 

 

3. Configure kernel:

 

petalinux-config -c kernel

 

 

4. Build

 

petalinux-build

 

 

5. Packaging:

 

petalinux-package --boot --fsbl images/linux/zynqmp_fsbl.elf --atf images/linux/bl31.elf --u-boot images/linux/u-boot.elf --fpga hw_source_vme/design_1_wrapper.bit --kernel --force

 

 

6. Flash the image (boot.bin + zynqmp_fsbl.elf) using Vivado hardware Manager.

 

 

Thank you a lot @ibaie.

 

0 Kudos