How to build First Stage Bootloader (FSBL) for ultra96 V2 based on Avnet BSP 2021.1

Updated: Apr 28



Build Steps



FSBL source code location

u96v2_sbc_base_2021_1/build/tmp/work/ultra96_zynqmp-xilinx-linux/fsbl


# Setup PetaLinux Environment

cd ~petalinux-install-directory

source peta/settings.sh


source peta/settings.sh

PetaLinux environment set to '/home/jimmy/petalinux/2021.1/peta'

INFO: Checking free disk space

INFO: Checking installed tools

INFO: Checking installed development libraries

INFO: Checking network and other services


# go to BSP source code directory

cd u96v2_sbc_base_2021_1


# In order to clean up build temp files By running following command:

petalinux-build -c fsbl -x distclean


# You should see following debug messages:

petalinux-build -c fsbl -x distclean

[INFO] Sourcing buildtools

[INFO] Building fsbl

[INFO] Sourcing build environment

[INFO] Generating workspace directory

INFO: bitbake fsbl -c cleansstate

NOTE: Started PRServer with DBfile: /home/jimmy/petalinux/2021.1/u96v2_sbc_base_2021_1/build/cache/prserv.sqlite3, IP: 127.0.0.1, PORT: 43845, PID: 9933

Loading cache: 100% |########################################################################################################################################################################| Time: 0:00:06

Loaded 5139 entries from dependency cache.

Parsing recipes: 100% |######################################################################################################################################################################| Time: 0:00:01

Parsing of 3514 .bb files complete (3504 cached, 10 parsed). 5149 targets, 227 skipped, 0 masked, 0 errors.

NOTE: Resolving any missing task queue dependencies

Initialising tasks: 100% |###################################################################################################################################################################| Time: 0:00:01

Sstate summary: Wanted 0 Found 0 Missed 0 Current 0 (0% match, 0% complete)

NOTE: No setscene tasks

NOTE: Executing Tasks

NOTE: Tasks Summary: Attempted 2 tasks of which 0 didn't need to be rerun and all succeeded.

[INFO] Successfully built fsbl

# In order to fetch source ode, please run following command:

petalinux-build -c fsbl -x fetch


# You will see following debug messages:

petalinux-build -c fsbl -x fetch

[INFO] Sourcing buildtools

[INFO] Building fsbl

[INFO] Sourcing build environment

[INFO] Generating workspace directory

INFO: bitbake fsbl -c fetch

NOTE: Started PRServer with DBfile: /home/jimmy/petalinux/2021.1/u96v2_sbc_base_2021_1/build/cache/prserv.sqlite3, IP: 127.0.0.1, PORT: 35685, PID: 11079

Loading cache: 100% |########################################################################################################################################################################| Time: 0:00:01

Loaded 5139 entries from dependency cache.

Parsing recipes: 100% |######################################################################################################################################################################| Time: 0:00:01

Parsing of 3514 .bb files complete (3504 cached, 10 parsed). 5149 targets, 227 skipped, 0 masked, 0 errors.

NOTE: Resolving any missing task queue dependencies

Initialising tasks: 100% |###################################################################################################################################################################| Time: 0:00:01

Sstate summary: Wanted 0 Found 0 Missed 0 Current 68 (0% match, 100% complete)

NOTE: Executing Tasks

NOTE: Tasks Summary: Attempted 309 tasks of which 308 didn't need to be rerun and all succeeded.

INFO: Successfully copied built images to tftp dir: /tftpboot

[INFO] Successfully built fsbl


# In order to unpack source ode, please run following command:

petalinux-build -c fsbl -x unpack

# You will see following debug messages:

petalinux-build -c fsbl -x unpack

[INFO] Sourcing buildtools

[INFO] Building fsbl

[INFO] Sourcing build environment

[INFO] Generating workspace directory

INFO: bitbake fsbl -c unpack

NOTE: Started PRServer with DBfile: /home/jimmy/petalinux/2021.1/u96v2_sbc_base_2021_1/build/cache/prserv.sqlite3, IP: 127.0.0.1, PORT: 40291, PID: 12054

Loading cache: 100% |########################################################################################################################################################################| Time: 0:00:06

Loaded 5139 entries from dependency cache.

Parsing recipes: 100% |######################################################################################################################################################################| Time: 0:00:01

Parsing of 3514 .bb files complete (3504 cached, 10 parsed). 5149 targets, 227 skipped, 0 masked, 0 errors.

NOTE: Resolving any missing task queue dependencies

Initialising tasks: 100% |###################################################################################################################################################################| Time: 0:00:01

Sstate summary: Wanted 0 Found 0 Missed 0 Current 68 (0% match, 100% complete)

NOTE: Executing Tasks

NOTE: Tasks Summary: Attempted 310 tasks of which 309 didn't need to be rerun and all succeeded.

INFO: Successfully copied built images to tftp dir: /tftpboot

[INFO] Successfully built fsbl


# In order to rebuild source ode, please run following command:

petalinux-build -c fsbl -x build


# You will see following debug messages:


petalinux-build -c fsbl -x build

[INFO] Sourcing buildtools

[INFO] Building fsbl

[INFO] Sourcing build environment

[INFO] Generating workspace directory

INFO: bitbake fsbl -c build

NOTE: Started PRServer with DBfile: /home/jimmy/petalinux/2021.1/u96v2_sbc_base_2021_1/build/cache/prserv.sqlite3, IP: 127.0.0.1, PORT: 37553, PID: 12959

Loading cache: 100% |########################################################################################################################################################################| Time: 0:00:06

Loaded 5139 entries from dependency cache.

Parsing recipes: 100% |######################################################################################################################################################################| Time: 0:00:01

Parsing of 3514 .bb files complete (3504 cached, 10 parsed). 5149 targets, 227 skipped, 0 masked, 0 errors.

NOTE: Resolving any missing task queue dependencies

Initialising tasks: 100% |###################################################################################################################################################################| Time: 0:00:01

Sstate summary: Wanted 104 Found 10 Missed 94 Current 851 (9% match, 90% complete)

NOTE: Executing Tasks

NOTE: Tasks Summary: Attempted 2569 tasks of which 2553 didn't need to be rerun and all succeeded.

INFO: Successfully copied built images to tftp dir: /tftpboot

[INFO] Successfully built fsbl





How to load and debug over JTAG

# We need set device board boot switch to 00, which is booting from JTAG

# start xilinx hardware server

/home/jimmy/petalinux/2021.1/peta/tools/xsct/bin/xsct

# you will see following debug message

****** Xilinx Software Commandline Tool (XSCT) v2021.1

**** SW Build 3240477 on 2021-06-05-19:57:09

** Copyright 1986-2021 Xilinx, Inc. All Rights Reserved.



xsct%

# run connect command to start hardware server


xsct% connect

attempting to launch hw_server

****** Xilinx hw_server v2021.1.0

**** Build date : Jun 5 2021 at 17:46:51

** Copyright 1986-2021 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


tcfchan#0

xsct%


# Power on the device, and then run following commands

petalinux-boot --jtag --u-boot --hw_server-url TCP:127.0.0.1:3121 -v


# You will see following debug message from host

petalinux-boot --jtag --u-boot --hw_server-url TCP:127.0.0.1:3121 -v

[INFO] Sourcing buildtools

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 -url TCP:127.0.0.1:3121

for {set i 0} {$i < 20} {incr i} {

if { [ta] != "" } break;

after 50

}

targets -set -nocase -filter {name =~ "*PSU*"}

mask_write 0xFFCA0038 0x1C0 0x1C0

targets -set -nocase -filter {name =~ "*MicroBlaze PMU*"}

puts stderr "INFO: Downloading ELF file: /home/jimmy/petalinux/2021.1/u96v2_sbc_base_2021_1/images/linux/pmufw.elf to the target."

dow "/home/jimmy/petalinux/2021.1/u96v2_sbc_base_2021_1/images/linux/pmufw.elf"

after 2000

con

targets -set -nocase -filter {name =~ "*APU*"}

mwr 0xffff0000 0x14000000

mask_write 0xFD1A0104 0x501 0x0

after 5000

targets -set -nocase -filter {name =~ "*A53*#0"}


source /home/jimmy/petalinux/2021.1/u96v2_sbc_base_2021_1/project-spec/hw-description/psu_init.tcl

puts stderr "INFO: Downloading ELF file: /home/jimmy/petalinux/2021.1/u96v2_sbc_base_2021_1/images/linux/zynqmp_fsbl.elf to the target."

dow "/home/jimmy/petalinux/2021.1/u96v2_sbc_base_2021_1/images/linux/zynqmp_fsbl.elf"

after 2000

con

after 4000; stop; catch {stop}; psu_ps_pl_isolation_removal; psu_ps_pl_reset_config

targets -set -nocase -filter {name =~ "*A53*#0"}

puts stderr "INFO: Loading image: /home/jimmy/petalinux/2021.1/u96v2_sbc_base_2021_1/images/linux/system.dtb at 0x00100000"

dow -data "/home/jimmy/petalinux/2021.1/u96v2_sbc_base_2021_1/images/linux/system.dtb" 0x00100000

after 2000

targets -set -nocase -filter {name =~ "*A53*#0"}

puts stderr "INFO: Downloading ELF file: /home/jimmy/petalinux/2021.1/u96v2_sbc_base_2021_1/images/linux/u-boot.elf to the target."

dow "/home/jimmy/petalinux/2021.1/u96v2_sbc_base_2021_1/images/linux/u-boot.elf"

after 2000

targets -set -nocase -filter {name =~ "*A53*#0"}

puts stderr "INFO: Downloading ELF file: /home/jimmy/petalinux/2021.1/u96v2_sbc_base_2021_1/images/linux/bl31.elf to the target."

dow "/home/jimmy/petalinux/2021.1/u96v2_sbc_base_2021_1/images/linux/bl31.elf"

after 2000

con

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

INFO: Downloading ELF file: /home/jimmy/petalinux/2021.1/u96v2_sbc_base_2021_1/images/linux/pmufw.elf to the target.

INFO: Downloading ELF file: /home/jimmy/petalinux/2021.1/u96v2_sbc_base_2021_1/images/linux/zynqmp_fsbl.elf to the target.

INFO: Loading image: /home/jimmy/petalinux/2021.1/u96v2_sbc_base_2021_1/images/linux/system.dtb at 0x00100000

INFO: Downloading ELF file: /home/jimmy/petalinux/2021.1/u96v2_sbc_base_2021_1/images/linux/u-boot.elf to the target.

INFO: Downloading ELF file: /home/jimmy/petalinux/2021.1/u96v2_sbc_base_2021_1/images/linux/bl31.elf to the target.



# You will see following debug message from minicom/hyperterminal


Xilinx Zynq MP First Stage Boot Loader

Release 2021.1 Jun 6 2021 - 07:07:32

NOTICE: ATF running on XCZU3EG/silicon v4/RTL5.1 at 0xfffea000

NOTICE: BL31: v2.4(release):v1.1-7609-g851523ea2

NOTICE: BL31: Built : 08:27:07, Apr 28 2021

U-Boot 2021.01 (Jun 01 2021 - 11:54:06 +0000)

Board: Xilinx ZynqMP

DRAM: 2 GiB

PMUFW: v1.1

Jimmy EL Level: EL2

Chip ID: zu3eg

NAND: 0 MiB

MMC: mmc@ff160000: 0, mmc@ff170000: 1

In: serial

Out: serial

Err: serial

Bootmode: JTAG_MODE

Reset reason: EXTERNAL

Net: No ethernet found.

Hit any key to stop autoboot: 0

JTAG: Trying to boot script at 20000000

## Executing script at 20000000

Wrong image format for "source" command

JTAG: SCRIPT FAILED: continuing...

starting USB...

Bus dwc3@fe300000: Register 2000440 NbrPorts 2

Starting the controller

USB XHCI 1.00

scanning bus dwc3@fe300000 for devices... 4 USB Device(s) found

scanning usb for storage devices... 0 Storage Device(s) found



23 views0 comments