
新版petalinux生成的u-boot是通過boot.scr來加載linux kernel的。如果我們用petalinux工程默認配置和下面命令生成boot image并從flash啟動,會出現下面的錯誤:
petalinux-package --boot --u-boot --kernel
device 0 offset 0xf40000, size 0x6400000
SF: 104857600 bytes @ 0xf40000 Read: OK
Wrong Image Format for bootm command
ERROR: can't get kernel image!
Booting using Fit image failed
在2021.1和2021.2的boot.scr中,linux fit image的offset是通過下面的配置來設置的:
petalinux-config → u-boot Configuration → u-boot script configuration(qspi fit image offset默認0xF40000)
但是petalinux-package命令生成的BIF文件里,fit image的offset采用的是“petalinux-config->Subsystem AUTO Hardware Settings->Flash Settings”里第二個partition(默認名字為kernel)的offset來配置的。所以就會出現boot.scr讀取到錯誤數據的問題。解決辦法就是保持這兩個配置里的offset一致。

