取消
显示结果 
搜索替代 
您的意思是: 
Highlighted
Observer
Observer
767 次查看
注册日期: ‎11-29-2019

请问zynq7020 flash启动失败can't get kernel image 原因

转到解答

大家好

    使用petalinux 2018.2 对zynq7020移植了linux。启动失败,请问可能的原因是什么?谢谢

 

U-Boot 2018.01 (Jun 04 2020 - 21:57:25 +0800) Xilinx Zynq ZC702

Board: Xilinx Zynq
Silicon: v3.1
DRAM: ECC disabled 256 MiB
SF: Detected n25q128 with page size 512 Bytes, erase size 128 KiB, total 32 MiB
*** Warning - bad CRC, using default environment

In: serial@e0001000
Out: serial@e0001000
Err: serial@e0001000
Board: Xilinx Zynq
Silicon: v3.1
Net: No ethernet found.
U-BOOT for single

No ethernet found.
Hit any key to stop autoboot: 0
SF: Detected n25q128 with page size 512 Bytes, erase size 128 KiB, total 32 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>

 

petalinux操作步骤:

petalinux-config --get-hw-description=./       默认值无修改

petalinux-build

petalinux-package --boot --fsbl zynq_fsbl.elf --fpga system.bit --u-boot --kernel --force

 

设备树:system-user.dtsi

/include/ "system-conf.dtsi"
/ {

};
&gem0 {
status = "disabled";
};

&qspi {
is-dual = <1>;
};

 

 

flash为stack模式

11.png22.png

 

0 项奖励
1 个已接受解答

已接受的解答
Highlighted
Observer
Observer
109 次查看
注册日期: ‎11-29-2019

回复: 请问zynq7020 flash启动失败can't get kernel image 原因

转到解答

问题已解决。感谢大家的支持!

原因是板卡只有256MB内存。

petalinux-config --get-hw-description=./ 

然后进入uboot-configuration

修改netboot offset

在原帖中查看解决方案

0 项奖励
16 条回复16
Highlighted
Moderator
Moderator
732 次查看
注册日期: ‎07-01-2019

回复: 请问zynq7020 flash启动失败can't get kernel image 原因

转到解答

你好 @round_chen ,

 

开发板是自定义的吗?使用工具烧录程序的时候,最好勾选上blank check和verify,排除一下烧写的问题

在u-boot下输入print将env信息以附件的形式发上来看一下

另外你使用的是Dual QSPI,需要按照以下这个链接来改一下设备树和内核配置:

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842262/Zynq+QSPI+Driver

-------------------------------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------------------------------
如果提供的信息能解决您的问题,请标记为“接受为解决方案”。
如果您认为帖子有帮助,请点击“奖励”。谢谢!
-------------------------------------------------------------------------------------------------
0 项奖励
Highlighted
Observer
Observer
674 次查看
注册日期: ‎11-29-2019

回复: 请问zynq7020 flash启动失败can't get kernel image 原因

转到解答

@shengjie 感谢您的答复

修改了设备树和内核配置之后,反复重启。烧写时也勾选上blank check和verify了

请帮忙看一下,谢谢!

内核配置:

33.png

设备树:system-conf.dtsi  其他部分都是petalinux自动生成的配置

/include/ "system-conf.dtsi"
/ {

};
&gem0 {
status = "disabled";
};

&qspi {
xlnx,qspi-mode = <0x2>;

};

 

日志见附件

0 项奖励
Highlighted
Xilinx Employee
Xilinx Employee
620 次查看
注册日期: ‎06-19-2019

回复: 请问zynq7020 flash启动失败can't get kernel image 原因

转到解答

Wrong Image Format for bootm command
ERROR: can't get kernel image!

看这错误像是没有获取到kernel的image,你可以确认一下bootm命令中,指向的是哪个image文件,这个image文件是否你烧写的时候烧入到你的FLASH中去了。

------------------------------------------------------------------
Don't forget to reply, kudo, and accept as solution.
如果提供的信息能解决您的问题,请标记为“接受为解决方案”。
如果您认为帖子有帮助,请点击“奖励”。谢谢!
-------------------------------------------------------------------
0 项奖励
Highlighted
Observer
Observer
594 次查看
注册日期: ‎11-29-2019

回复: 请问zynq7020 flash启动失败can't get kernel image 原因

转到解答

十分感谢您的答复,获取的信息如下。

Hit any key to stop autoboot: 0
Zynq> bootm
## Loading kernel from FIT Image at 10000000 ...
Could not find configuration node
ERROR: can't get kernel image!
Zynq> iminfo

## Checking Image at 10000000 ...
FIT image found
FIT description: U-Boot fitImage for PetaLinux/4.14-xilinx-v2018.2+gitAUTOINC
+ad4cd988ba/plnx-zynq7
Image 0 (kernel@1)
Description: Linux kernel
Type: Unknown Image
Compression: Unknown Compression
Data Start: 0x10000104
Data Size: 3938153 Bytes = 3.8 MiB
## Checking hash(es) for FIT Image at 10000000 ...
Hash(es) for Image 0 (kernel@1):
Zynq> bootelf
## No elf image at address 0x10000000
Zynq>

 

我有一个zc702的开发板,flash可以启动并进入内核,中断启动后输入bootm信息如下:

Hit any key to stop autoboot: 0
Zynq> bootm
Wrong Image Format for bootm command
ERROR: can't get kernel image!
Zynq> iminfo

## Checking Image at 10000000 ...
Unknown image format!
Zynq> iminfo

## Checking Image at 10000000 ...
Unknown image format!
Zynq> bootelf
## No elf image at address 0x10000000
Zynq>

采用petalinux2018.2移植。

petalinux操作步骤:

petalinux-config --get-hw-description=./       默认值无修改

petalinux-build

petalinux-package --boot --fsbl zynq_fsbl.elf --fpga system.bit --u-boot --kernel --force

0 项奖励
Highlighted
Xilinx Employee
Xilinx Employee
565 次查看
注册日期: ‎06-19-2019

回复: 请问zynq7020 flash启动失败can't get kernel image 原因

转到解答

采用petalinux2018.2移植。你把什么移植到了2018.2上?

另外,你在u-boot下用printenv打印出所有相关环境变量,然后看一下bootm的指令内容。

------------------------------------------------------------------
Don't forget to reply, kudo, and accept as solution.
如果提供的信息能解决您的问题,请标记为“接受为解决方案”。
如果您认为帖子有帮助,请点击“奖励”。谢谢!
-------------------------------------------------------------------
0 项奖励
Highlighted
Observer
Observer
519 次查看
注册日期: ‎11-29-2019

回复: 请问zynq7020 flash启动失败can't get kernel image 原因

转到解答

感谢答复!

采用petalinux2018.2移植。我的意思是用petalinux2018.2移植的linux系统

步骤:

petalinux-config --get-hw-description=./       默认值无修改

petalinux-build

petalinux-package --boot --fsbl zynq_fsbl.elf --fpga system.bit --u-boot --kernel --force

printenv打印

U-Boot 2018.01 (Jun 09 2020 - 22:38:19 +0800) Xilinx Zynq ZC702

Board: Xilinx Zynq
Silicon: v3.1
DRAM: ECC disabled 256 MiB
SF: Detected n25q128 with page size 256 Bytes, erase size 64 KiB, total 16 MiB
*** Warning - bad CRC, using default environment

In: serial@e0001000
Out: serial@e0001000
Err: serial@e0001000
Board: Xilinx Zynq
Silicon: v3.1
Net: No ethernet found.
U-BOOT for single

No ethernet found.
Hit any key to stop autoboot: 0
Zynq> pirntenv
Unknown command 'pirntenv' - try 'help'
Zynq> printenv
arch=arm
autoload=no
baudrate=115200
board=zynq
board_name=zynq
boot_img=BOOT.BIN
bootcmd=run default_bootcmd
bootdelay=4
bootenvsize=0x20000
bootenvstart=0x500000
bootsize=0x500000
bootstart=0x0
clobstart=0x10000000
console=console=ttyPS0,115200
cp_kernel2ram=sf probe 0 && sf read ${netstart} ${kernelstart} ${kernelsize}
cpu=armv7
default_bootcmd=run cp_kernel2ram && bootm ${netstart}
dtb_img=system.dtb
dtbnetstart=0x23fff000
eraseenv=sf probe 0 && sf erase ${bootenvstart} ${bootenvsize}
ethaddr=00:0a:35:00:1e:53
fault=echo ${img} image size is greater than allocated place - partition ${img}
is NOT UPDATED
fdtcontroladdr=ffc8a10
install_boot=sf probe 0 && sf erase ${bootstart} ${bootsize} && sf write ${clobs
tart} ${bootstart} ${filesize}
install_jffs2=sf probe 0 && sf erase ${jffs2start} ${jffs2size} && sf write ${cl
obstart} ${jffs2start} ${filesize}
install_kernel=sf probe 0 && sf erase ${kernelstart} ${kernelsize} && sf write $
{clobstart} ${kernelstart} ${filesize}
jffs2_img=rootfs.jffs2
kernel_img=image.ub
kernelsize=0xa90000
kernelstart=0x520000
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
modeboot=qspiboot
nc=setenv stdout nc;setenv stdin nc;
netboot=tftpboot ${netstart} ${kernel_img} && bootm
netstart=0x10000000
psserial0=setenv stdout ttyPS0;setenv stdin ttyPS0
sdbootdev=0
serial=setenv stdout serial;setenv stdin serial
serverip=192.168.93.130
soc=zynq
stderr=serial@e0001000
stdin=serial@e0001000
stdout=serial@e0001000
test_crc=if imi ${clobstart}; then run test_img; else echo ${img} Bad CRC - ${im
g} is NOT UPDATED; fi
test_img=setenv var "if test ${filesize} -gt ${psize}; then run fault; else run
${installcmd}; fi"; run var; setenv var
update_boot=setenv img boot; setenv psize ${bootsize}; setenv installcmd "instal
l_boot"; run load_boot test_img; setenv img; setenv psize; setenv installcmd
update_dtb=setenv img dtb; setenv psize ${dtbsize}; setenv installcmd "install_d
tb"; run load_dtb test_img; setenv img; setenv psize; setenv installcmd
update_jffs2=setenv img jffs2; setenv psize ${jffs2size}; setenv installcmd "ins
tall_jffs2"; run load_jffs2 test_img; setenv img; setenv psize; setenv installcm
d
update_kernel=setenv img kernel; setenv psize ${kernelsize}; setenv installcmd "
install_kernel"; run load_kernel test_crc; setenv img; setenv psize; setenv inst
allcmd
vendor=xilinx

看起来是标红的信息导致的错误。请问什么导致的镜像大小错误呢?

我的这个板卡和zc702开发板不一样的地方就是flash是stack模式的两片mt25q128.

已经按照链接做了修改,从打印total 16 MiB看系统没有识别出来2片flash.

 

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842262/Zynq+QSPI+Driver

 

/include/ "system-conf.dtsi"
/ {

};
&gem0 {
status = "disabled";
};

&qspi {
xlnx,qspi-mode = <0x2>;

};

0 项奖励
Highlighted
Moderator
Moderator
483 次查看
注册日期: ‎07-01-2019

回复: 请问zynq7020 flash启动失败can't get kernel image 原因

转到解答

我看了一下内核驱动源码,设备树的qspi-mode属性是不做检测的,is-dual属性应该为0,num-cs属性修改为2试一下

 

内核源码中对zynq qspi控制器的设备树属性要求如下所示,参考https://github.com/Xilinx/linux-xlnx/blob/master/Documentation/devicetree/bindings/spi/spi-zynq-qspi.txt

Required properties:
- compatible		: Should be "xlnx,zynq-qspi-1.0".
- reg			: Physical base address and size of QSPI registers map.
- interrupts		: Property with a value describing the interrupt
			  number.
- interrupt-parent	: Must be core interrupt controller
- clock-names		: List of input clock names - "ref_clk", "pclk"
			  (See clock bindings for details).
- clocks		: Clock phandles (see clock bindings for details).

Optional properties:
- num-cs		: Number of chip selects used.

Example:
	qspi@e000d000 {
		compatible = "xlnx,zynq-qspi-1.0";
		clock-names = "ref_clk", "pclk";
		clocks = <&clkc 10>, <&clkc 43>;
		interrupt-parent = <&intc>;
		interrupts = <0 19 4>;
		num-cs = <1>;
		reg = <0xe000d000 0x1000>;
	} ;
-------------------------------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------------------------------
如果提供的信息能解决您的问题,请标记为“接受为解决方案”。
如果您认为帖子有帮助,请点击“奖励”。谢谢!
-------------------------------------------------------------------------------------------------
0 项奖励
Highlighted
Xilinx Employee
Xilinx Employee
471 次查看
注册日期: ‎06-19-2019

回复: 请问zynq7020 flash启动失败can't get kernel image 原因

转到解答

@round_chen 在执行bootm之前,你先要把FLASH中的image读到内存中去。

sf probe 0 && sf read ${netstart} ${kernelstart} ${kernelsize}

 

------------------------------------------------------------------
Don't forget to reply, kudo, and accept as solution.
如果提供的信息能解决您的问题,请标记为“接受为解决方案”。
如果您认为帖子有帮助,请点击“奖励”。谢谢!
-------------------------------------------------------------------
0 项奖励
Highlighted
443 次查看
注册日期: ‎05-08-2018

回复: 请问zynq7020 flash启动失败can't get kernel image 原因

转到解答

kernel有多大啊,看看config分区够不够。小了的话会出错。

0 项奖励
Highlighted
Observer
Observer
404 次查看
注册日期: ‎11-29-2019

回复: 请问zynq7020 flash启动失败can't get kernel image 原因

转到解答

感谢答复!

按照您的建议修改之后,现象仍然一样。识别出来是16MB,反复重启

之前是在sdk中裸跑的,dual模式没问题,最近需要改成跑linux操作系统,遇到这个问题

 

设备树中关于qspi的地方:

1.zynq-7000.dtsi

qspi: spi@e000d000 {
clock-names = "ref_clk", "pclk";
clocks = <&clkc 10>, <&clkc 43>;
compatible = "xlnx,zynq-qspi-1.0";
status = "disabled";
interrupt-parent = <&intc>;
interrupts = <0 19 4>;
reg = <0xe000d000 0x1000>;
#address-cells = <1>;
#size-cells = <0>;
};

2.pcw.dtsi

&qspi {
is-dual = <0>;
num-cs = <0x1>;
spi-rx-bus-width = <4>;
spi-tx-bus-width = <4>;
status = "okay";
};

3.system-conf.dtsi

&qspi {
#address-cells = <1>;
#size-cells = <0>;
flash0: flash@0 {
compatible = "n25q512a","micron,m25p80";
reg = <0x0>;
#address-cells = <1>;
#size-cells = <1>;
spi-max-frequency = <50000000>;
partition@0x00000000 {
label = "boot";
reg = <0x00000000 0x00500000>;
};
partition@0x00500000 {
label = "bootenv";
reg = <0x00500000 0x00020000>;
};
partition@0x00520000 {
label = "kernel";
reg = <0x00520000 0x00a90000>;
};
partition@0x00fb0000 {
label = "spare";
reg = <0x00fb0000 0x00000000>;
};
};
};

4.system-user.dtsi

/include/ "system-conf.dtsi"
/ {

};
&gem0 {
status = "disabled";
};

&qspi {
num-cs = <2>;

};

 

 

0 项奖励
Highlighted
Observer
Observer
400 次查看
注册日期: ‎11-29-2019

回复: 请问zynq7020 flash启动失败can't get kernel image 原因

转到解答

感谢答复! 现象和启动时一样,bootm后会反复重启

 

Hit any key to stop autoboot: 0
Zynq> sf probe 0 && sf read ${netstart} ${kernelstart} ${kernelsize}
SF: Detected n25q128 with page size 256 Bytes, erase size 64 KiB, total 16 MiB
device 0 offset 0x520000, size 0xa90000
SF: 11075584 bytes @ 0x520000 Read: OK
Zynq> bootm
## Loading kernel from FIT Image at 10000000 ...
Using 'conf@system-top.dtb' configuration
Verifying Hash Integrity ... OK
Trying 'kernel@1' kernel subimage
Description: Linux kernel
Type: Kernel Image
Compression: gzip compressed
Data Start: 0x10000104
Data Size: 3938159 Bytes = 3.8 MiB
Architecture: ARM
OS: Linux
Load Address: 0x00008000
Entry Point: 0x00008000
Hash algo: sha1
Hash value: a36344940e9dd096df4368fd8adf3c4678cef9ad
Verifying Hash Integrity ... sha1+ OK
## Loading ramdisk from FIT Image at 10000000 ...
Using 'conf@system-top.dtb' configuration
Trying 'ramdisk@1' ramdisk subimage
Description: petalinux-user-image
Type: RAMDisk Image
Compression: gzip compressed
Data Start: 0x103c5230
Data Size: 6030973 Bytes = 5.8 MiB
Architecture: ARM
OS: Linux
Load Address: unavailable
Entry Point: unavailable
Hash algo: sha1
Hash value: f95f4dd637253dd5301eb4eb58469a34f4c56441
Verifying Hash Integrity ... sha1+ OK
## Loading fdt from FIT Image at 10000000 ...
Using 'conf@system-top.dtb' configuration
Trying 'fdt@system-top.dtb' fdt subimage
Description: Flattened Device Tree blob
Type: Flat Device Tree
Compression: uncompressed
Data Start: 0x103c1974
Data Size: 14329 Bytes = 14 KiB
Architecture: ARM
Hash algo: sha1
Hash value: 540fd8e774dcd5929bd4691b839d3557593be385
Verifying Hash Integrity ... sha1+ OK
Booting using the fdt blob at 0x103c1974
Uncompressing Kernel Image ... Error: inflate() returned -3
gzip compressed: uncompress error -1
Must RESET board to recover
resetting ...

0 项奖励
Highlighted
Observer
Observer
399 次查看
注册日期: ‎11-29-2019

回复: 请问zynq7020 flash启动失败can't get kernel image 原因

转到解答

感谢答复!

image.ub大小是9,985,596 bytes

我是用petalinux-package --boot --fsbl zynq_fsbl.elf --fpga system.bit --u-boot --kernel --force打包成BOOT.bin的,如果大小不合适,应该回无法打包的

0 项奖励
Highlighted
Xilinx Employee
Xilinx Employee
316 次查看
注册日期: ‎06-19-2019

回复: 请问zynq7020 flash启动失败can't get kernel image 原因

转到解答

1)之前你bootm无法启动的问题,是由于在执行bootm前没有从flash中加载keneral到内存导致的,看你结果已经解决了。

2)重复启动,是由于kernel加载失败。你先打包的时候不包含kernel,然后启动到u-boot之后,通过JTAG把你的image.ub下载到你的内存0x10000000位置上,然后再用bootm启动,看看是否成功。判断下是否是kernel本身的问题。

------------------------------------------------------------------
Don't forget to reply, kudo, and accept as solution.
如果提供的信息能解决您的问题,请标记为“接受为解决方案”。
如果您认为帖子有帮助,请点击“奖励”。谢谢!
-------------------------------------------------------------------
Highlighted
Observer
Observer
190 次查看
注册日期: ‎11-29-2019

回复: 请问zynq7020 flash启动失败can't get kernel image 原因

转到解答

@terryn @shengjie 您好,最近几天查问题,发现我们的硬件是256MB内存的,根据打印信息,好像内核的image加载到0x10000000的位置,正好是256MB。可能这是无法启动的原因。

请问有办法可以修改内核加载的位置吗?谢谢!

 

Board: Xilinx Zynq
Silicon: v3.1
DRAM: ECC disabled 256 MiB 

 

loadaddr=0x10000000
modeboot=qspiboot

0 项奖励
Highlighted
Xilinx Employee
Xilinx Employee
175 次查看
注册日期: ‎06-19-2019

回复: 请问zynq7020 flash启动失败can't get kernel image 原因

转到解答

在u-boot下,你可以更改env中的加载位置。

------------------------------------------------------------------
Don't forget to reply, kudo, and accept as solution.
如果提供的信息能解决您的问题,请标记为“接受为解决方案”。
如果您认为帖子有帮助,请点击“奖励”。谢谢!
-------------------------------------------------------------------
0 项奖励
Highlighted
Observer
Observer
110 次查看
注册日期: ‎11-29-2019

回复: 请问zynq7020 flash启动失败can't get kernel image 原因

转到解答

问题已解决。感谢大家的支持!

原因是板卡只有256MB内存。

petalinux-config --get-hw-description=./ 

然后进入uboot-configuration

修改netboot offset

在原帖中查看解决方案

0 项奖励