cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
joancab
Advisor
Advisor
387 Views
Registered: ‎05-11-2015

Boot SD creation in Vitis (2020.2)

I have a Vitis project with a platform and two domains/ apps: linux and bare metal.

I created my linux image with petalinux from the corresponding xsa.

I will be reusing fsbl and pmufw from a 3rd source

On the linux domain it asks for the bif file and boot components directory. I'm not clear about what to include and what will Vitis generate.

Should I point Vitis to the 'images' folder generated by petalinux? (in my case after replacing the fsbl and pmufw)

Should I populate the bif file or will Vitis do it?

Then there is the optional linux image folder, with u-boot and image.ub. These are not referred in the bif file, so if I leave it blank, how is Vitis going to include u-boot and kernel image in the SD card?

joancab_0-1616581201962.png

 

Are applications to be included in that bif file? (even the app for the rpu domain in the bif in the linux domain)

 

Tags (4)
0 Kudos
9 Replies
joancab
Advisor
Advisor
365 Views
Registered: ‎05-11-2015

Neither I understand why it produces two BOOT.BIN, one per domain

joancab_0-1616582850063.png

When creating a boot sd card with petalinux, fsbl, pmufw and u-boot are bundled into boot.bin and the kernel image is written aside. 

I suppose if I should do that in Vitis, include u-boot in the bif file and just copy the image.ub with the boot.bin, but now I found each domain creates its own!

The sd creation should belong to the platform, not to domains as there can be more than one, may I have misconfigured something?

 

Tags (3)
0 Kudos
joancab
Advisor
Advisor
351 Views
Registered: ‎05-11-2015

I tried the following bif (paths intentionally shortened) and putting the BOOT.BIN and image.ub together

 

//arch = zynqmp; split = false; format = BIN
the_ROM_image:
{
	[bootloader, destination_cpu = a53-0]C:\...\fsbl.elf
	[destination_cpu = pmu]C:\...\pmufw.elf
	[destination_device = pl]C:\...\bd_wrapper.bit
	[destination_cpu = a53-0]C:\...\u-boot.elf
	[destination_cpu = r5-0]C:\...\r5_app.elf
}

 

I get the FSBL banner plus the R5 app 'hello' then u-boot starts (and fails):

 

Hello from R5
Successfully ran Hello World application

U-Boot 2020.01 (Mar 24 2021 - 09:29:28 +0000)

Board: Xilinx ZynqMP
DRAM:  4 GiB
usb dr_mode not found
PMUFW:  v1.1
EL Level:       EL3
Chip ID:        zu4ev
Multiboot:      0
NAND:  0 MiB
MMC:   mmc@ff160000: 0, mmc@ff170000: 1
In:    serial@ff000000
Out:   serial@ff000000
Err:   serial@ff000000

 

 

Tags (3)
0 Kudos
stephenm
Moderator
Moderator
345 Views
Registered: ‎09-12-2007

Producing a boot.bin per domain is correct (most of the time). You are targeting the same processor. So, unless you have the elf files are different offsets, then they would overwrite each other.

You can use the system.bif generated by the tools as a reference, and add the images you want. Then call bootgen manually

bootgen -arch zynqmp -image bootgen.bif -w on -o BOOT.BIN

If you are booting linux on the zynq ultrascale from SD card, then your boot image should have the following; fsbl, pmufw, dtb, bl31 and the uboot. You can place the image.ub (which has uboot headers)

on the SD card too, and this will boot for you.

joancab
Advisor
Advisor
343 Views
Registered: ‎05-11-2015

Each of the generated BOOT.BIN boots with only its domain app and the Linux app is actually running as bare metal.

I assume these BOOT.BIN are to be ignored and I should make my own, still don't know how, mainly because of the linux boot components

0 Kudos
joancab
Advisor
Advisor
338 Views
Registered: ‎05-11-2015

@stephenm 

Do you mean I should include both BOOT.BIN in the SD?

bin offsets is something I didn't explicitly set, where to do that?

dtb and bl31 on the BIF, good point!

0 Kudos
stephenm
Moderator
Moderator
338 Views
Registered: ‎09-12-2007

The OS for both apps is standalone. Anyway, the linux app would not be loaded into memory. It would be added to the linux filesystem

If you want to create a linux app in Vitis, you would set the OS to linux in the domain, and add your sysroots (created in petalinux)

Then for testing you you can debug from Vitis, or place the linux app on the sd card and execute from there (the sd card is mounted by default in Petalinux)

Then once it is working, you can use petalinux to place the prebuilt binary (see ug1144) into the filesystem

So, you just need to update the your BIF

 

the_ROM_image:
{
     [bootloader, destination_cpu = a53-0]C:\...\fsbl.elf
     [destination_cpu = pmu]C:\...\pmufw.elf
     [destination_device = pl]C:\...\bd_wrapper.bit
     [destination_cpu = r5-0]C:\...\r5_app.elf
     [destination_cpu=a53-0, load=0x00100000] system.dtb
     [destination_cpu=a53-0,exception_level=el-3,trustzone] bl31.elf
     [destination_cpu=a53-0,exception_level=el-2] u-boot.elf
}

 

0 Kudos
joancab
Advisor
Advisor
320 Views
Registered: ‎05-11-2015

Oh, my bad... for some reason my "linux" app is targeted for the R5

joancab_0-1616586208139.png

 

0 Kudos
joancab
Advisor
Advisor
257 Views
Registered: ‎05-11-2015

I started again from the platform, only one linux domain, no linux app (I first want to see linux booting) and I found that apparently the dtb cannot be before u-boot in the BIF (it doesn't boot up). My bif is:

 

the_ROM_image:
{
     [bootloader, destination_cpu = a53-0]C:\...\fsbl.elf
     [destination_cpu = pmu]C:\...\pmufw.elf
     [destination_device = pl]C:\...\bd_wrapper.bit
     [destination_cpu = r5-0]C:\...\r5_app.elf
     [destination_cpu=a53-0,exception_level=el-2] u-boot.elf
     [destination_cpu=a53-0,exception_level=el-3,trustzone] bl31.elf
     [destination_cpu=a53-0, load=0x01000000] system.dtb
}

 

I also had to change the DTB offset to 0x0100_0000 there was an error about overlapping the previous section.

The boot.bin generated and the image.ub from petalinux fail at the start of u-boot:

 

PMU Firmware 2019.2     Feb  3 2020   17:52:54
PMU_ROM Version: xpbr-v8.1.0-0


U-Boot 2020.01 (Mar 24 2021 - 09:29:28 +0000)

Board: Xilinx ZynqMP
DRAM:  4 GiB
usb dr_mode not found
PMUFW:  v1.1
EL Level:       EL3
Chip ID:        zu4ev
Multiboot:      0
NAND:  0 MiB
MMC:   mmc@ff160000: 0, mmc@ff170000: 1
In:    serial@ff000000
Out:   serial@ff000000
Err:   serial@ff000000
Bootmode: SD_MODE1
Reset reason:   EXTERNAL
Net:   No ethernet found.
Hit any key to stop autoboot:  0
switch to partitions #0, OK
mmc1 is current device
Scanning mmc 1:1...
JTAG: Trying to boot script at 0x20000000
## Executing script at 20000000
Wrong image format for "source" command
JTAG: SCRIPT FAILED: continuing...
switch to partitions #0, OK
mmc0(part 0) is current device
** No partition table - mmc 0 **
switch to partitions #0, OK
mmc1 is current device
Scanning mmc 1:1...
Warning: SPI speed fallback to 100 kHz
SF: Detected n25q512a with page size 512 Bytes, erase size 128 KiB, total 128 MiB
device 0 offset 0x3e80000, size 0x80000
SF: 524288 bytes @ 0x3e80000 Read: OK
QSPI: Trying to boot script at 0x20000000
## Executing script at 20000000
Wrong image format for "source" command
QSPI: SCRIPT FAILED: continuing...


no devices available
NAND: SCRIPT FAILED: continuing...
starting USB...
No working controllers found
USB is stopped. Please issue 'usb start' first.
starting USB...
No working controllers found
USB is stopped. Please issue 'usb start' first.
scanning bus for devices...

Device 0: unknown device
starting USB...
No working controllers found
No ethernet found.
missing environment variable: pxeuuid
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00000000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0000000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/000000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default-arm-zynqmp-zynqmp
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default-arm-zynqmp
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default-arm
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default
No ethernet found.
Config file not found
starting USB...
No working controllers found
No ethernet found.
No ethernet found.

 

 

0 Kudos
stephenm
Moderator
Moderator
246 Views
Registered: ‎09-12-2007

The uboot expects the dtb to be at a certain offset:

https://github.com/Xilinx/u-boot-xlnx/blob/master/board/xilinx/common/board.c#L330

default CONFIG_XILINX_OF_BOARD_DTB_ADDR is 0x100000 for zynq and zynq ultrascale

 

Also, you need a boot.scr on the SD card, this will be built by petalinux and placed in the images/Linux folder.

Or, you can just boot manually using bootm:

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18841973/Build+U-Boot