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
Observer philtempblue
Observer
405 Views
Registered: ‎02-05-2018

JTAG Boot Hangs - Unrecognized/unsupported machine ID

Hello all...

 

I'm trying to follow the steps to boot a PicoZed on an Avnet FMC Carrier Card gen2 using the v2017.4 (Dec 20, 2017) ug1144 "PetaLinux Tools Documentation".  I"m having trouble and many others seem to have had similar issues over the last handful of years.  But since I'm using 2017.4, it seems to be a bit different.  Would really appreciate some help.

 

After completing the "Package Prebuilt Image" steps on page page 27, I get the following files. 

 

NOTE: the .bit file was originally called system_wrapper.bit immediately after the packaging.  However, the petalinux-boot --jtag commands would NEVER load the bitstream correctly.  Digging through the forums, one person suggested renaming this file to download.bit, go figure... it worked and the FPGA DONE light comes on now.

 

~/dev/petalinux_projects/vanilla_petalinux/pre-built$ tree.
└── linux
    ├── etc
    ├── images
    │   ├── BOOT.BIN
    │   ├── system.dtb
    │   ├── System.map.linux
    │   ├── u-boot.elf
    │   ├── zImage
    │   └── zynq_fsbl.elf
    └── implementation
        └── download.bit

Running the following with verbosity... everything "looks" fine.  But when I get to the step towards the end where it's downloading the u-boot.elf something else is happening on the PicoZed's console output (shown next).

 

$ petalinux-boot --jtag -v --prebuilt 3

INFO: Append dtb - /home/phil/dev/petalinux_projects/vanilla_petalinux/pre-built/linux/images/system.dtb and other options to boot zImage
XSDB Script:
INFO: Launching XSDB for file download and boot.
INFO: This may take a few minutes, depending on the size of your image.

connect
puts stderr "INFO: Configuring the FPGA..."
puts stderr "INFO: Downloading bitstream to the target."
fpga "/home/phil/dev/petalinux_projects/vanilla_petalinux/pre-built/linux/implementation/download.bit"
after 2000
targets -set -nocase -filter {name =~ "arm*#0"}

source /home/phil/dev/petalinux_projects/vanilla_petalinux/project-spec/hw-description/ps7_init.tcl; ps7_post_config
catch {stop}
set mctrlval [string trim [lindex [split [mrd 0xF8007080] :] 1]]
puts "mctrlval=$mctrlval"
puts stderr "INFO: Downloading ELF file to the target."
dow "/home/phil/dev/petalinux_projects/vanilla_petalinux/pre-built/linux/images/zynq_fsbl.elf"
after 2000
con
after 3000; stop
targets -set -nocase -filter {name =~ "arm*#0"}
puts stderr "INFO: Downloading ELF file to the target."
dow "/home/phil/dev/petalinux_projects/vanilla_petalinux/pre-built/linux/images/u-boot.elf"
after 2000
con
after 2000; stop
targets -set -nocase -filter {name =~ "arm*#0"}

rst -processor; after 2000
dow -data "/home/phil/dev/petalinux_projects/vanilla_petalinux/pre-built/linux/images/system.dtb" 0x02408000
after 2000
rwr r2 0x02408000
targets -set -nocase -filter {name =~ "arm*#0"}
dow -data "/home/phil/dev/petalinux_projects/vanilla_petalinux/pre-built/linux/images/zImage" 0x00008000
after 2000
rwr pc 0x00008000
con
after 5000
exit
rlwrap: warning: your $TERM is 'xterm-256color' but rlwrap couldn't find it in the terminfo database. Expect some problems.: Inappropriate ioctl for device
attempting to launch hw_server

****** Xilinx hw_server v2017.4
**** Build date : Dec 13 2017-18:17:16
** Copyright 1986-2017 Xilinx, Inc. All Rights Reserved.

INFO: hw_server application started
INFO: Use Ctrl-C to exit hw_server application

INFO: To connect to this hw_server instance use url: TCP:127.0.0.1:3121

INFO: Configuring the FPGA...
INFO: Downloading bitstream to the target.
100% 3MB 1.8MB/s 00:02
mctrlval=30800100
INFO: Downloading ELF file to the target.
Downloading Program -- /home/phil/dev/petalinux_projects/vanilla_petalinux/pre-built/linux/images/zynq_fsbl.elf
section, .text: 0x00000000 - 0x0000d5fb
section, .handoff: 0x0000d5fc - 0x0000d647
section, .init: 0x0000d648 - 0x0000d65f
section, .fini: 0x0000d660 - 0x0000d677
section, .rodata: 0x0000d678 - 0x0000d9c3
section, .data: 0x0000d9c8 - 0x000108db
section, .eh_frame: 0x000108dc - 0x000108df
section, .mmu_tbl: 0x00014000 - 0x00017fff
section, .init_array: 0x00018000 - 0x00018003
section, .fini_array: 0x00018004 - 0x00018007
section, .rsa_ac: 0x00018008 - 0x0001903f
section, .bss: 0x00019040 - 0x0001ae71
section, .heap: 0x0001ae72 - 0x0001ce7f
section, .stack: 0xffff0000 - 0xffffd3ff
100% 0MB 0.6MB/s 00:00
Setting PC to Program Start Address 0x00000000
Successfully downloaded /home/phil/dev/petalinux_projects/vanilla_petalinux/pre-built/linux/images/zynq_fsbl.elf
INFO: Downloading ELF file to the target.
Downloading Program -- /home/phil/dev/petalinux_projects/vanilla_petalinux/pre-built/linux/images/u-boot.elf
section, .text: 0x04000000 - 0x04044bd3
section, efi_runtime_text: 0x04044bd4 - 0x04044bf7
section, .rodata: 0x04044bf8 - 0x040540e7
section, .hash: 0x040540e8 - 0x040540ff
section, .dtb.init.rodata: 0x04054100 - 0x0405784f
section, .data: 0x04057850 - 0x04059fcf
section, .got.plt: 0x04059fd0 - 0x04059fdb
section, efi_runtime_data: 0x04059fe0 - 0x0405a0b7
section, .u_boot_list: 0x0405a0b8 - 0x0405af5f
section, .rel.dyn: 0x0405af60 - 0x04064bf7
section, .bss_start: 0x0405af60 - 0x0405af5f
section, .bss: 0x0405af60 - 0x0409ac43
section, .bss_end: 0x0409ac44 - 0x0409ac43
100% 0MB 0.5MB/s 00:00
Setting PC to Program Start Address 0x04000000
Successfully downloaded /home/phil/dev/petalinux_projects/vanilla_petalinux/pre-built/linux/images/u-boot.elf
100% 0MB 0.5MB/s 00:00
Successfully downloaded /home/phil/dev/petalinux_projects/vanilla_petalinux/pre-built/linux/images/system.dtb
100% 24MB 0.6MB/s 00:44
Successfully downloaded /home/phil/dev/petalinux_projects/vanilla_petalinux/pre-built/linux/images/zImage

INFO: SOC Silicon version is 3.1.

Here is the PicoZed console output.  After (or during?) the u-boot.elf download, the PicoZed is displaying "Hit any key to stop autoboot:" and starts to count down.  When it gets to 3, it hangs until after the zImage is downloaded.  Then I get the "Uncompressing Linux..." etc...

 

U-Boot 2017.01 (Aug 16 2018 - 09:19:17 -0700)

Board: Xilinx Zynq
I2C:   ready
DRAM:  ECC disabled 1 GiB
MMC:   Card did not respond to voltage select!
sdhci@e0100000 - probe failed: -95
Card did not respond to voltage select!

SF: Detected s25fl128s_64k with page size 256 Bytes, erase size 64 KiB, total 16 MiB
In:    serial
Out:   serial
Err:   serial
Net:   ZYNQ GEM: e000b000, phyaddr 0, interface rgmii-id
eth0: ethernet@e000b000
Hit any key to stop autoboot:  4  3 Uncompressing Linux... done, booting the kernel.

Error: unrecognized/unsupported machine ID (r1 = 0x00000000).

Available machine support:

ID (hex)	NAME
ffffffff	Generic DT based system
ffffffff	ARM-Versatile Express
ffffffff	Xilinx Zynq Platform

Please check your kernel config and/or bootloader.

If I load u-boot only and printenv:

 

=~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2018.08.16 10:21:40 =~=~=~=~=~=~=~=~=~=~=~=
printenv
autoload=no
baudrate=115200
boot_img=BOOT.BIN
bootcmd=run default_bootcmd
bootdelay=4
bootenv=uEnv.txt
bootenvsize=0x20000
bootenvstart=0x500000
clobstart=0x10000000
console=console=ttyPS0,115200
cp_kernel2ram=mmcinfo && fatload mmc 0 ${netstart} ${kernel_img}
default_bootcmd=run uenvboot; run cp_kernel2ram && bootm ${netstart}
dtb_img=system.dtb
dtbnetstart=0x11800000
eraseenv=sf probe 0 && sf erase ${bootenvstart} ${bootenvsize}
ethact=ethernet@e000b000
ethaddr=00:0a:35:00:ff:ff
fault=echo ${img} image size is greater than allocated place - partition ${img} is NOT UPDATED
fdtcontroladdr=3ffa9100
importbootenv=echo "Importing environment from SD ..."; env import -t ${loadbootenv_addr} $filesize
install_boot=mmcinfo && fatwrite mmc 0 ${clobstart} ${boot_img} ${filesize}
install_jffs2=sf probe 0 && sf erase ${jffs2start} ${jffs2size} && sf write ${clobstart} ${jffs2start} ${filesize}
install_kernel=mmcinfo && fatwrite mmc 0 ${clobstart} ${kernel_img} ${filesize}
jffs2_img=rootfs.jffs2
kernel_img=image.ub
load_boot=tftpboot ${clobstart} ${boot_img}
load_dtb=tftpboot ${clobstart} ${dtb_img}
load_jffs2=tftpboot ${clobstart} ${jffs2_img}
load_kernel=tftpboot ${clobstart} ${kernel_img}
loadaddr=0x10000000
loadbootenv=load mmc $sdbootdev:$partid ${loadbootenv_addr} ${bootenv}
loadbootenv_addr=0x00100000
nc=setenv stdout nc;setenv stdin nc;
netboot=tftpboot ${netstart} ${kernel_img} && bootm
netstart=0x10000000
psserial0=setenv stdout ttyPS0;setenv stdin ttyPS0
sd_uEnvtxt_existence_test=test -e mmc $sdbootdev:$partid /uEnv.txt
sd_update_dtb=echo Updating dtb from SD; mmcinfo && fatload mmc 0:1 ${clobstart} ${dtb_img} && run install_dtb
sd_update_jffs2=echo Updating jffs2 from SD; mmcinfo && fatload mmc 0:1 ${clobstart} ${jffs2_img} && run install_jffs2
sdbootdev=0
serial=setenv stdout serial;setenv stdin serial
serverip=10.12.6.120
test_crc=if imi ${clobstart}; then run test_img; else echo ${img} Bad CRC - ${img} is NOT UPDATED; fi
test_img=setenv var "if test ${filesize} -gt ${psize}; then run fault; else run ${installcmd}; fi"; run var; setenv var
uenvboot=if run sd_uEnvtxt_existence_test; then run loadbootenv; echo Loaded environment from ${bootenv}; run importbootenv; fi; if test -n $uenvcmd; then echo Running uenvcmd ...; run uenvcmd; fi
update_boot=setenv img boot; setenv psize ${bootsize}; setenv installcmd "install_boot"; run load_boot ${installcmd}; setenv img; setenv psize; setenv installcmd
update_dtb=setenv img dtb; setenv psize ${dtbsize}; setenv installcmd "install_dtb"; run load_dtb test_img; setenv img; setenv psize; setenv installcmd
update_jffs2=setenv img jffs2; setenv psize ${jffs2size}; setenv installcmd "install_jffs2"; run load_jffs2 test_img; setenv img; setenv psize; setenv installcmd
update_kernel=setenv img kernel; setenv psize ${kernelsize}; setenv installcmd "install_kernel"; run load_kernel ${installcmd}; setenv img; setenv psize; setenv installcmd

Environment size: 3022/131068 bytes

I'm at a loss about what is going on.  The bitstream and device tree work correctly when using them as part of an SD card boot.   Not much is enabled in the PL other than the PS Ethernet and AXI I2C IP, which again works with the SD card boot.

 

Following the ug1144 steps, I'm not 100% clear on how the project needs to be configured to support JTAG boot.  At the very least, before re-building the working petalinux project ( which was working on SD card) to then flash using JTAG, I went through the petalinux-config >>​ Subsystem AUTO Hardware Settings >> Advanced bootable images storage settings... and made sure everything was set to "primary flash" (instead of "primary sd").

 
Specifically:
  • ​boot image settings >> image storage media
  • u-boot env partition >> image storage media (primary flash)
  • kernel image settings >> image storage media  (primary flash)
  • jffs2 rootfs image settings >> image storage media  (primary flash)
  • dtb image settings >> image storage media (from boot image)

 

 Unfortunately, I cannot use any of the provided board BSPs because I am trying to debug a PicoZed on a custom carrier card.

 

Any help and/or guidance is great appreciated.

0 Kudos
1 Reply
Moderator
Moderator
353 Views
Registered: ‎12-04-2016

Re: JTAG Boot Hangs - Unrecognized/unsupported machine ID

Hi

 

If your zImage size is more, you might see this issue. Try correcting the default jtag script. You can do something like this:

 

Append --tcl mytcl at the end of petalinux-boot command, it generates mytcl, adjust your memory layout so that your binaries don't overlap. You can also use --load-addr <LOADADDR> to change accordingly (run petalinux-boot --jtag --help) 

 

 

 

0 Kudos