UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Observer sconvertini
Observer
332 Views
Registered: ‎09-06-2018

Update fpga and rootfs during the execution of Linux

Hi to all,

I made a paetalinux OS to be programmed on a Microzed booting from the QSPI.

After building the project, I generated the boot.bin file to be flashed on the QSPI with the following command:

petalinux-package --boot --fsbl images/linux/zynq_fsbl.elf --kernel images/linux/image.ub --uboot images/linux/u-boot.elf --force

In <plnx-proj-root>/build/ there's a .bif file qith the following contents:

{
	[bootloader] /tmp/tmp.gehpCNqrcC/zynq_fsbl.elf
	[, offset=0x520000, partition_owner=uboot] /tmp/tmp.gehpCNqrcC/image.ub
	/tmp/tmp.gehpCNqrcC/u-boot.elf
}

I know that, following the partition table written in the device tree source, I have four partition on the flash as follow:

 

root@AC2R:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00500000 00010000 "boot"
mtd1: 00020000 00010000 "bootenv"
mtd2: 00a80000 00010000 "kernel"
mtd3: 00060000 00010000 "spare"

I have some questions:

  1. I use to refer to the bitstrem for the packagin of the boot.bin but where does the bitstream information are stored? which partition?
  2. what do I have to do if I want to update the fpga bitstream by remote during the execution of linux, without re-flashing the entire QSPI?
  3. what do I have to do if I want to update the rootfs by remote during the execution of linux, without re-flashing the entire QSPI?

 

If I transfer the image.ub (or the uImage or the zImage or the rootfs.bin) generating after petalinux-build command and flash it with flashcp in /dev/mtd2, after rebooting I cannot see nothing from the serial port (it seems that nothig is booted).

Even if I transfer the bitstream.bit in the RAM, I don't know where this file should be transfered.

Hope that someone can help me.

Thank to all for your support

0 Kudos
2 Replies
Moderator
Moderator
306 Views
Registered: ‎06-27-2017

Re: Update fpga and rootfs during the execution of Linux

hi @sconvertini,

 

1. Bitstream information will bein Boot.bin header and partition header table.

2. You can refer below wiki on how to update bitstream in Linux. You can do this after booting Linux

     https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842056/FPGA+Manager+ZCU102

3. For QSPI, Xilinx supports JFFS2 filesystem. you can update the filesystem in u-boot for that specific mtd partition by writing jffs2 filesystem. After that you can boot Linux.

 

Hope above points answered your questions.

 

Regards
Kranthi
--------------------------
Don't forget to reply, kudo, and accept as solution.

Best Regards
Kranthi
--------------------------
Don't forget to reply, kudo, and accept as solution.
0 Kudos
Observer sconvertini
Observer
300 Views
Registered: ‎09-06-2018

Re: Update fpga and rootfs during the execution of Linux

Dear gudishak, thank you for your reply.

I will try to explain better my environment.

I'm able to build, package and boot a Petalinux booting from QSPI for my MicroZed. To do this, I generate a single BOOT.BIN that three partitions:

mtdo for boot that contains contains fsbl, and bitstream;

mtd1 for bootenv: something like evniromental variable for u-boot if I'm not wrong;

mtd2 for image.ub (that contain kernel, rootfs and device tree);

mtd3 for spare;

The ROM image is built in the following way by Petalinux:

the_ROM_image:
{
	[bootloader] /tmp/tmp.VfvtvBVTO8/zynq_fsbl.elf
  /tmp/tmp.VfvtvBVTO8/system.bit
	[, offset=0x520000, partition_owner=uboot] /tmp/tmp.VfvtvBVTO8/image.ub
	/tmp/tmp.VfvtvBVTO8/u-boot.elf
}

At a first sight, they seems to be different, so in this situation, it is not clear for me where the u-boot is stored.

Anyway I cannot handle the single file of rootfs since I can handle only FIT image.ub.

Please could you tell me where I can find the source code for u-boot in Petalinux.

Thank you in advance for your support.

0 Kudos