cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
johnfrye11
Explorer
Explorer
7,514 Views
Registered: ‎10-18-2017

ZCU104 -- Bad ARM64 Image magic!

Hello I am getting a boot message 

 

 

reading system.dtb

31506 bytes read in 18 ms (1.7 MiB/s)

Bad  Linux ARM64 Image magic!

ZynqMP>

 

 

I am not sure what the problem is here. The boot sequence is obviously reaching U-Boot but for whatever reason cannot get into the oeprating system. 

 

Currently I have the SD card partitioned with two partitions.

I created BOOT.BIN with the command petalinux-package --boot --fsbl <> --fpga <> --pmufw <> --u-boot

 

The kernel and boot image are configured to live on the SD card. 

 

I put BOOT.BIN, image.ub, and system.dtb on the FAT32 first bootable partition.

I untarred the rootfs.tar.gz on the second partition which is ext4.

 

During the boot sequence the green light comes on and it seems as though it is booting successfully up to this point in the sequence.

 

Anyone seeing this and if so could offer some advice?

0 Kudos
17 Replies
stephenm
Xilinx Employee
Xilinx Employee
7,488 Views
Registered: ‎09-12-2007

You only need the boot.bin and the image.ub. The image.ub is a fit image that contains the image, dts and rootfs.

0 Kudos
johnfrye11
Explorer
Explorer
7,464 Views
Registered: ‎10-18-2017

Ok. Now I have two partitions

 

Partition 1: FAT32

BOOT.BIN

image.ub

 

Partition 2:

Nothing

 

Begins booting and I get the message 

 

** Unable to read file system.dtb **

ZynqMP> 

What configuration for device tree should I select for petalinux-config? I have it set to SD. Perhaps the problem is there.

 

0 Kudos
stephenm
Xilinx Employee
Xilinx Employee
7,457 Views
Registered: ‎09-12-2007

The dtb should be in the image.ub

Can you share the bootlog? You should see the fit image expand here. It should contain the image, dtb and the rootfs.
0 Kudos
sandeepg
Moderator
Moderator
7,450 Views
Registered: ‎04-24-2017

Hi @johnfrye11,

 

Make sure dtb is part of boot image in petalinux-config

 

petalinux-config -> Subsystem AUTO Hardware Settings -> Advanced bootable images storage Settings -> dtb image settings -> (X) from boot image

 

#
# dtb image settings
#
CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_DTB_MEDIA_BOOTIMAGE_SELECT=y
# CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_DTB_MEDIA_FLASH_SELECT is not set
# CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_DTB_MEDIA_SD_SELECT is not set
# CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_DTB_MEDIA_ETHERNET_SELECT is not set
# CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_DTB_MEDIA_MANUAL_SELECT is not set
CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_DTB_IMAGE_NAME="system.dtb"
Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
0 Kudos
johnfrye11
Explorer
Explorer
7,429 Views
Registered: ‎10-18-2017

I believe I tried that before rebuilding the project. I will retry and let you know.

0 Kudos
johnfrye11
Explorer
Explorer
7,376 Views
Registered: ‎10-18-2017

hey @sandeepg

 

I do have that configuration set. What should the configurations be for the components:

Subsystem AUTO Hardware Settings:

  Advanced bootable images storage Settings

    boot image settings ---->

    u-boot env partition settings ---->

    kernel image settings ----->

    jffs2 rootfs image settings ----->

    dtb image settings ---->

 

Image Packing Configuration

  Root Filesystem Type --->

 

How should SD be partitioned and which files should go on which partitions?

 

Thanks.

0 Kudos
trigger
Voyager
Voyager
7,352 Views
Registered: ‎09-14-2016

Hi @johnfrye11,

 

You should try to do what @stephenm said -> Load only the image.ub and not the kernel/dtb/ramdisk separatly.

 

If you really want to boot with dtb you have to unpack the FIT image and try something like that:

 

fatload mmc 0 0x3000000 Image

fatload mmc 0 0x2A00000 dtb

fatload mmc 0 0x2000000 rootfs

booti 0x3000000 0x2000000 0x2A00000

 

Cheers,

Trigger

0 Kudos
johnfrye11
Explorer
Explorer
7,341 Views
Registered: ‎10-18-2017

I have not tried your idea @trigger. I will check that out. I have put the dtb into image.ub but when I boot I get console output similiar to this 

https://forums.xilinx.com/t5/Embedded-Linux/IMX274-boot-failed/td-p/886389

 

 I was able to boot by having root fs as INITRAMFS and not copying and untarring the rootfs on the second partition.

 

 

When I try to shut down the system though, it seems like its taking forever for "Unmounting remote filesystems..." . When I preempt it by turning the power off, the changes I made to the filesystem are not persisitent to the next boot.

0 Kudos
trigger
Voyager
Voyager
7,328 Views
Registered: ‎09-14-2016

Hi@johnfrye11,

 

You should try my first solution ;)

 

According to:

 I was able to boot by having root fs as INITRAMFS and not copying and untarring the rootfs on the second partition.

You should also take a look to command line arg and specifically something like root=/dev/mmcblk0pX

 

Good luck,

Cheers,

Trigger 

0 Kudos
jschell
Adventurer
Adventurer
6,764 Views
Registered: ‎05-01-2012

I'm having the same problem.  All I can determine is that the error is caused by a problem in the header of the linux Image file.  There is a magic number that is supposed to be in a certain location, and it's not there.  In my case, the number is one byte later than it should be.  I have no idea why or how this can happen.

0 Kudos
colombini_luca
Explorer
Explorer
6,708 Views
Registered: ‎11-05-2008

Hi @jschell,

 

  is this problem being solved?

 

  I am facing exactly the same problem with Petalinux 2018.2 build flow.

 

  Please let me know.

 

Luca

0 Kudos
colombini_luca
Explorer
Explorer
6,705 Views
Registered: ‎11-05-2008

Hi @sandeepg,

   why we can't use system.dtb from SD card?

Thanks,

Luca

0 Kudos
jschell
Adventurer
Adventurer
6,696 Views
Registered: ‎05-01-2012

My problem ended up being that I was transferring the image from one system to another using ftp and it somehow got set into text mode instead of binary, so it added a 0x0A after every 0x0D.

0 Kudos
colombini_luca
Explorer
Explorer
6,685 Views
Registered: ‎11-05-2008

Thanks @jschell!
0 Kudos
shabbirk
Moderator
Moderator
6,680 Views
Registered: ‎12-04-2016

Hi @colombini_luca@jschell

 

If the issue have been fixed, I would suggest to mark the appropriate answer thread as an accepted solution, that will help other users looking for solution 

 

 

0 Kudos
colombini_luca
Explorer
Explorer
6,638 Views
Registered: ‎11-05-2008

Hi @shabbirk,

 

   It seems I still have this issue. It seems it is not an issue on file transfer type as @jschell suggested in my case.

 

   I will report progresses as soon as I will make further experiments.

    Please Xilinx should verify if the linux boot with separated system.dtb and a second partition with rootfs is working or not,

    with a 2018.2 flow.

 

    Please @shabbirk report about that to the community.

 

Thanks,

Luca

0 Kudos
gudishak
Moderator
Moderator
6,608 Views
Registered: ‎06-27-2017

 Hi @colombini_luca,

 

May I know which filesystem you are trying to boot from U-boot?

Could you please try with rootfs.cpio.gz.u-boot (from petalinux)? Can you share the exact logs?

 

Regards
Kranthi
--------------------------
Don't forget to reply, kudo, and accept as solution.

Best Regards
Kranthi
--------------------------
Don't forget to reply, kudo, and accept as solution.
0 Kudos