取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
lary
Visitor
Visitor
341 次查看
注册日期: ‎09-08-2021

zc7045 设置从SD卡启动,使用petalinux制作出来的BOOT.BIN 不执行fsbl阶段。请问下是啥原因?

使用下面命令制作的BOOT.BIN:

petalinux-package --boot --fsbl ./zynq_fsbl.elf --u-boot --force

linux启动直接从uboot开始打印,看起来是跳过了fsbl阶段直接加载uboot:

uar1串口打印:

U-Boot 2020.01 (Sep 15 2021 - 02:08:17 +0000)

CPU: Zynq 7z045
Silicon: v3.1
DRAM: ECC disabled 640 MiB
Flash: 0 Bytes
NAND: 0 MiB
MMC: mmc@e0100000: 0
In: serial@e0001000
Out: serial@e0001000
Err: serial@e0001000
Net:
ZYNQ GEM: e000b000, mdio bus e000b000, phyaddr -1, interface rgmii-id

Warning: ethernet@e000b000 using MAC address from DT
eth0: ethernet@e000b000
Hit any key to stop autoboot: 0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found U-Boot script /boot.scr
2010 bytes read in 15 ms (130.9 KiB/s)
## Executing script at 03000000
11627748 bytes read in 653 ms (17 MiB/s)
## 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: uncompressed
Data Start: 0x100000e8
Data Size: 4335192 Bytes = 4.1 MiB
Architecture: ARM
OS: Linux
Load Address: 0x00200000
Entry Point: 0x00200000
Hash algo: sha256
Hash value: 3faf3d538262f75c06d5b033077297926b1366fe40ab76f1c398eddc19e7c774
Verifying Hash Integrity ... sha256+ OK
## Loading ramdisk from FIT Image at 10000000 ...
Using 'conf@system-top.dtb' configuration
Verifying Hash Integrity ... OK
Trying 'ramdisk@1' ramdisk subimage
Description: petalinux-image-minimal
Type: RAMDisk Image
Compression: uncompressed
Data Start: 0x104271a4
Data Size: 7271881 Bytes = 6.9 MiB
Architecture: ARM
OS: Linux
Load Address: unavailable
Entry Point: unavailable
Hash algo: sha256
Hash value: 7eb454deee2d6f8674c416ae9614cc09b43cdd043584d7c09d03858dd86029b9
Verifying Hash Integrity ... sha256+ OK
## Loading fdt from FIT Image at 10000000 ...
Using 'conf@system-top.dtb' configuration
Verifying Hash Integrity ... OK
Trying 'fdt@system-top.dtb' fdt subimage
Description: Flattened Device Tree blob
Type: Flat Device Tree
Compression: uncompressed
Data Start: 0x1042284c
Data Size: 18571 Bytes = 18.1 KiB
Architecture: ARM
Hash algo: sha256
Hash value: 6c530e9b7588a8170d31df7cc5f0844be2bbc7a7aa8714c04d75a7b89299cc2e
Verifying Hash Integrity ... sha256+ OK
Booting using the fdt blob at 0x1042284c
Loading Kernel Image
Loading Ramdisk to 1f910000, end 1ffff5c9 ... OK
Loading Device Tree to 1f908000, end 1f90f88a ... OK

Starting kernel ...

 

又做了以下实验:

(1)制作BOOT.BIN时候不打包fsbl。只包含uboot,linux也能正常启动,uart1打印跟前面是一样的

petalinux-package --boot --u-boot  --force

 

(2)如果只打包fsbl,上电后uart1串口没有任务打印。

 

 

请问下可能是什么原因?

 

0 项奖励
8 回复数
terryn
Xilinx Employee
Xilinx Employee
331 次查看
注册日期: ‎06-19-2019

你仔细看一下你执行了petalinux-package后的log信息,BOOT.bin中会默认把FSBL打进去的。

你输出LOG没有包含FSBL部分的打印信息,很可能是电路上UART启动的太慢,导致FSBL的信息都没有被输出来。

你可以尝试在已经上电的基础上,手动触发一下板子上的POR_B,这样你应该就能看到FSBL的输出信息了。

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

我尝试过触发POR按键,也没有看到FSBL信息,直接就是打印uboot启动。

这个问题一开始我是用了下面命令把fpga也打包到里面,发现fpga没加载,正常应该是fsbl加载的fpga吧,所以才怀疑是fsbl没执行,才做了上述实验。

petalinux-package --boot --fsbl ./zynq_fsbl.elf --fpga system.bit --u-boot --add rtos.elf --force

 

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

BOOTROM不会直接加载U-boot代码的。你可以在petalinux工程的build文件夹下找到bif文件。

petalinux-package就是按照这个bif文件来执行的,你可以看一下第一个应该就是FSBL

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

制作BOOT.BIN时候不打包zynq_fsbl.elf 。只包含uboot,linux也能正常启动,这个怎么解释啊,想不通

petalinux-package --boot --u-boot  --force

 

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

我之前的回复有说明。petalinux-package --boot --u-boo生成的BOOT.bin一定是包含fsbl的。

你可以从petalinux-package的输出信息,和bif文件中看到。

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

petalinux-package --boot --u-boo生成的BOOT.bin一定是包含fsbl的

---从petalinux-package的输出信息看确实是这样

fsbl阶段有打印开关吗?一点fsbl打印都没有

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

如果你没有打开FSBL的DBUG开关的话,应该只会打印2行字。

所以如果你UART启动慢一点,那么就看不到这2行字了。

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


把fsbl源码中fsbl_printf(type,...) 的开关控制去掉,强制打印出来,果然就看到了。

不改代码,打开FSBL的DBUG开关要怎么打开?有相关编译选项吗?

Xilinx First Stage Boot Loader
Release 2020.1 Sep 15 2021-08:29:22
Devcfg driver initialized
Silicon Version 3.1
Boot mode is SD
SD: rc= 0
SD Init Done
Flash Base Address: 0xE0100000
Reboot status register: 0x60400000
Multiboot Register: 0x0000C000
Image Start Address: 0x00000000
Partition Header Offset:0x00000C80
Partition Count: 5
Partition Number: 1
Header Dump
Image Word Len: 0x0032D130
Data Word Len: 0x0032D130
Partition Word Len:0x0032D130
Load Addr: 0x00000000
Exec Addr: 0x00000000
Partition Start: 0x000065D0
Partition Attr: 0x00000020
Partition Checksum Offset: 0x00000000
Section Count: 0x00000001
Checksum: 0xFF67242E
Bitstream
In FsblHookBeforeBitstreamDload function
PCAP:StatusReg = 0x40000A30
PCAP:device ready
PCAP:Clear done
Level Shifter Value = 0xA
Devcfg Status register = 0x40000A30
PCAP:Fabric is Initialized done
PCAP register dump:
PCAP CTRL 0xF8007000: 0x4C00E07F
PCAP LOCK 0xF8007004: 0x0000001A
PCAP CONFIG 0xF8007008: 0x00000508
PCAP ISR 0xF800700C: 0x0802000B
PCAP IMR 0xF8007010: 0xFFFFFFFF
PCAP STATUS 0xF8007014: 0x00000A30
PCAP DMA SRC ADDR 0xF8007018: 0x00100001
PCAP DMA DEST ADDR 0xF800701C: 0xFFFFFFFF
PCAP DMA SRC LEN 0xF8007020: 0x0032D130
PCAP DMA DEST LEN 0xF8007024: 0x0032D130
PCAP ROM SHADOW CTRL 0xF8007028: 0xFFFFFFFF
PCAP MBOOT 0xF800702C: 0x0000C000
PCAP SW ID 0xF8007030: 0x00000000
PCAP UNLOCK 0xF8007034: 0x757BDF0D
PCAP MCTRL 0xF8007080: 0x30800100
...................................................................................................
DMA Done !

FPGA Done !
In FsblHookAfterBitstreamDload function
Partition Number: 2
Header Dump
Image Word Len: 0x0002CBD3
Data Word Len: 0x0002CBD3
Partition Word Len:0x0002CBD3
Load Addr: 0x04000000
Exec Addr: 0x04000000
Partition Start: 0x00333700
Partition Attr: 0x00000011
Partition Checksum Offset: 0x00000000
Section Count: 0x00000001
Checksum: 0xF7C46314
Application
Partition Number: 3
Header Dump
Image Word Len: 0x00001223
Data Word Len: 0x00001223
Partition Word Len:0x00001223
Load Addr: 0x00100000
Exec Addr: 0x00000000
Partition Start: 0x003602E0
Partition Attr: 0x00000011
Partition Checksum Offset: 0x00000000
Section Count: 0x00000001
Checksum: 0xFFB9C434
Application
Partition Number: 4
Header Dump
Image Word Len: 0x00006004
Data Word Len: 0x00006004
Partition Word Len:0x00006004
Load Addr: 0x30000000
Exec Addr: 0x30000000
Partition Start: 0x00361510
Partition Attr: 0x00000010
Partition Checksum Offset: 0x00000000
Section Count: 0x00000001
Checksum: 0x9FC8C852
Application
Handoff Address: 0x04000000
In FsblHookBeforeHandoff function
SUCCESSFUL_HANDOFF
FSBL Status = 0x1


U-Boot 2020.01 (Sep 15 2021 - 07:33:16 +0000)

CPU: Zynq 7z045
Silicon: v3.1
DRAM: ECC disabled 640 MiB
Flash: 0 Bytes
NAND: 0 MiB
MMC: mmc@e0100000: 0
In: serial@e0001000
Out: serial@e0001000
Err: serial@e0001000

0 项奖励