cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
bog_dan
Visitor
Visitor
10,391 Views
Registered: ‎02-21-2018

Wrong Image Format for bootm command - Petalinux Boot 2016.4

Hey everyone,

 

I'm trying to build a petalinux flash image on the 2016.4 release. I've followed the basic petalinux flow where you create the project, configure the settings, build it, then package it to a boot image. The problem is when I load it on the QSPI flash I get the error described above. The full bootlog can be found below:

U-Boot 2016.07 (Jun 18 2018 - 14:32:51 -0400)

DRAM:  ECC disabled 512 MiB
SF: Detected N25Q256 with page size 256 Bytes, erase size 4 KiB, total 32 MiB
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
U-BOOT for

Hit any key to stop autoboot:  0
SF: Detected N25Q256 with page size 256 Bytes, erase size 4 KiB, total 32 MiB
device 0 offset 0xe00000, size 0xa80000
SF: 11010048 bytes @ 0xe00000 Read: OK
Wrong Image Format for bootm command
ERROR: can't get kernel image!
Zynq>

I'm sure it's some configuration setting that's wrong for the QSPI boot. I've managed to build a working image for an SD card (granted it was a newer release of petalinux). I've done the basics like set the kernel and boot image settings to primary flash in the advanced bootable images settings. I don't even have the option to select SD card. I've also tried the suggestion in this link since I am trying to include a bitstream file in the boot image. 

 

Any help would be greatly appreciated!

0 Kudos
11 Replies
wdecook
Contributor
Contributor
10,375 Views
Registered: ‎01-02-2015

Check your setting at:

petalinux-config ->

  Subsystem AUTO Hardware Settings ->

    Advanced bootable images storage Settings ->

      Kernel image settings ->

        image storage media

 

It sounds like you need to set this to primary flash. Then make sure primary flash is set to qspi at:

  Subsystem AUTO Hardware Settings ->

    Flash Settings ->

      Primary Flash

0 Kudos
sandeepg
Moderator
Moderator
10,352 Views
Registered: ‎04-24-2017

Hi @bog_dan,

 

Which device are you using?

Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
0 Kudos
bog_dan
Visitor
Visitor
10,325 Views
Registered: ‎02-21-2018

wdecook,

 

Thank you for your suggestion, I have tried that already and it did not help.

 

sandeepg,

 

I am using a Zynq-7000 SoC.

0 Kudos
stephenm
Moderator
Moderator
10,317 Views
Registered: ‎09-12-2007

Just to test the image, can you do a fatload, and bootm manually:

http://www.wiki.xilinx.com/U-boot

0 Kudos
bog_dan
Visitor
Visitor
10,293 Views
Registered: ‎02-21-2018

stephenm,

 

The image I built does not appear to have the filesystem commands that are listed on the reference document you posted. I've combed through the commands I have available and have not seen anything that would dump the addressing of the filesystem to boot manually. 

 

Wrong Image Format for bootm command
ERROR: can't get kernel image!
Zynq> fatinfo
Unknown command 'fatinfo' - try 'help'
Zynq> fatload
Unknown command 'fatload' - try 'help'
Zynq> help
?       - alias for 'help'
base    - print or set address offset
bdinfo  - print Board Info structure
boot    - boot default, i.e., run 'bootcmd'
bootd   - boot default, i.e., run 'bootcmd'
bootefi - Boots an EFI payload from memory
bootelf - Boot from an ELF image in memory
bootm   - boot application image from memory
bootvx  - Boot vxWorks from an ELF image
clk     - CLK sub-system
cmp     - memory compare
coninfo - print console devices and information
cp      - memory copy
crc32   - checksum calculation
dcache  - enable or disable data cache
dm      - Driver model low level access
echo    - echo args to console
editenv - edit environment variable
env     - environment handling commands
exit    - exit script
ext4load- load binary file from a Ext4 filesystem
ext4ls  - list files in a directory (default /)
ext4size- determine a file's size
false   - do nothing, unsuccessfully
fdt     - flattened device tree utility commands
fpga    - loadable FPGA image support
fstype  - Look up a filesystem type
go      - start application at address 'addr'
help    - print command description/usage
icache  - enable or disable instruction cache
iminfo  - print header information for application image
imxtract- extract a part of a multi-image
itest   - return true/false on integer compare
load    - load binary file from a filesystem
loadb   - load binary file over serial line (kermit mode)
loads   - load S-Record file over serial line
loadx   - load binary file over serial line (xmodem mode)
loady   - load binary file over serial line (ymodem mode)
loop    - infinite loop on address range
ls      - list files in a directory (default /)
md      - memory display
mm      - memory modify (auto-incrementing address)
mw      - memory write (fill)
nm      - memory modify (constant address)
printenv- print environment variables
reset   - Perform RESET of the CPU
run     - run commands in an environment variable
save    - save file to a filesystem
saveenv - save environment variables to persistent storage
saves   - save S-Record file over serial line
setenv  - set environment variables
sf      - SPI flash sub-system
showvar - print local hushshell variables
size    - determine a file's size
sleep   - delay execution for some time
source  - run script from memory
sspi    - SPI utility command
test    - minimal test like /bin/sh
true    - do nothing, successfully
version - print monitor, compiler and linker version
0 Kudos
trigger
Voyager
Voyager
10,270 Views
Registered: ‎09-14-2016

Hi @bog_dan,

 

You should take a look here and try to load your image from QSPI to RAM and boot your kernel manually.

 

http://www.wiki.xilinx.com/U-boot#Programming%20QSPI%20Flash

 

It's certainly a misunderstanding but you can't use use fatload with QSPI if there is no file system in place.

 

So I think you should probably use sf read and bootm command.

 

Cheers,

Trigger

0 Kudos
bog_dan
Visitor
Visitor
10,256 Views
Registered: ‎02-21-2018

@trigger,

 

Thanks for the suggestion. I managed to get a petalinux image to boot on qspi by upgrading to version 2017.4. The system was built in 2016.4 so I assumed I would need to use the same release of the petalinux tools. This wasn't the case. A boot image built on the 2017.4 version in the same way loaded on the flash boots with no issues.

 

Thanks for the help everyone.

0 Kudos
pedro_uno
Advisor
Advisor
9,196 Views
Registered: ‎02-12-2013

Hello, I am getting the same error message using Petalinux 2018.3 to boot from QSPI on a MicroZed board.

I set the suggested values to "Primary Flash" and generated the BOOT.BIN in the standard way.  I have burned the BOOT.BIN file to QSPI and set the boot mode pins to boot from QSPI. 

When I release reset u-boot starts with all the right configs to boot from the QSPI flash.  Below is a little u-boot transcript. My understanding is that Petalinux creates the BOOT.BIN containing the FSBL, U-Boot, device tree, linux kernel and minimal root filesystem.  It adjusts the configuration settings on u-boot to have the right boot commands.  I don't think I am supposed to create the BOOT.BIN using bootgen anymore. Peta does that now.  Am I wrong?

Zynq> help boot
boot - boot default, i.e., run 'bootcmd'

Usage:
boot
Zynq> printenv bootcmd
bootcmd=run default_bootcmd
Zynq> printenv default_bootcmd
default_bootcmd=run cp_kernel2ram && bootm ${netstart}
Zynq> boot
SF: Detected s25fl128s_64k with page size 256 Bytes, erase size 64 KiB, total 16 MiB
device 0 offset 0x520000, size 0xa80000
SF: 11010048 bytes @ 0x520000 Read: OK
Wrong Image Format for bootm command
ERROR: can't get kernel image!
Zynq> run cp_kernel2ram
SF: Detected s25fl128s_64k with page size 256 Bytes, erase size 64 KiB, total 16 MiB
device 0 offset 0x520000, size 0xa80000
SF: 11010048 bytes @ 0x520000 Read: OK
Zynq>  bootm ${netstart}
Wrong Image Format for bootm command
ERROR: can't get kernel image!
Zynq>

----------------------------------------
DSP in hardware and software
-----------------------------------------
0 Kudos
pedro_uno
Advisor
Advisor
9,151 Views
Registered: ‎02-12-2013

OK, I found my immediate (nooby) mistake.  I did not tell petalinux-package to include the kernel.

Here is the one that did not work for lack of a kernel image.

    petalinux-package --boot --force --fsbl --u-boot              --fpga ../../../fpga/implement/results/top.bit

Here is what worked.

    petalinux-package --boot --force --fsbl --u-boot --kernel --fpga ../../../fpga/implement/results/top.bit

----------------------------------------
DSP in hardware and software
-----------------------------------------
0 Kudos
jasminetifei
Adventurer
Adventurer
7,625 Views
Registered: ‎06-24-2011

I had the same issue, here is how I overcome it:

After my Petalinux generates bl31.elf, pmufw.elf, u-boot.elf, image.ub, along with my FSBL.elf (you can include BIT if you need one), I grab them together and follow ug1209 page78 to generate my BOOT.bin.

When you add image.ub as page82 described, remember to enter the correct offset value. In this original post the Offset value is 0xe00000.

ug1209 page82 says Offset value is 0x1E40000, but you need to find your own offset value.

Then I can see my linux kernel. 

 

offset_value.png
0 Kudos
sabankocal
Voyager
Voyager
6,184 Views
Registered: ‎08-02-2019

Hi,

I had same problem and solved it like this:

I have an fsbl project in SDK project workspace, when I create image.ub, I was using this fsbl.elf and system can not started properly.

Instead of that, I started to use images/linux/zynq_fsbl.elf and my problem solved.

Good luck.

Saban

<--- If reply is helpful, please feel free to give Kudos, and close if it answers your question --->
0 Kudos