P550 EsBurn Source Code?

62 views
Skip to first unread message

Matthew Croughan

unread,
Dec 11, 2024, 4:53:08 PM12/11/24
to devboard-community
I've finally managed to make Nix expressions to build and reproduce bootloader_ddr5_secboot.bin, and so far every tool to do that has been open source. Now that I have produced this combination of ddr firmware and u-boot/opensbi, I found that in order to apply it I need to use EsBurn, which after reading https://www.sifive.com/document-file/hifive-premier-p550-image-update-procedure I could not find a link to the source code for it. Does anybody know where I can find it?

Cheers,

Matt

Heinrich Schuchardt

unread,
Dec 11, 2024, 5:36:59 PM12/11/24
to Matthew Croughan, devboard-community
es_burn is a command in U-Boot to update the firmware in the SPI flash.

EsBurn is a Linux tool that sets up a TFTP server and then passes commands to U-Boot. es_burn is one of the commands.

You could update the firmware without EsBurn. Just look at the U-Boot commands listed as output in "5.2.5 Step 5 - Start the EsBurn Tool".

In the unlucky event of having a corrupted U-Boot, recovery is possible by booting from the UART.

Best regards

Heinrich

Samuel Holland

unread,
Dec 11, 2024, 8:18:34 PM12/11/24
to RISC-V Developer Board Community, Matthew Croughan
Hi Matt,

On Wednesday, December 11, 2024 at 3:53:08 PM UTC-6 Matthew Croughan wrote:
I've finally managed to make Nix expressions to build and reproduce bootloader_ddr5_secboot.bin, and so far every tool to do that has been open source. Now that I have produced this combination of ddr firmware and u-boot/opensbi, I found that in order to apply it I need to use EsBurn, which after reading https://www.sifive.com/document-file/hifive-premier-p550-image-update-procedure I could not find a link to the source code for it. Does anybody know where I can find it?

If you already have a functioning U-Boot on the board, you can flash the new firmware following the instructions in Chapter 2, using the es_burn command from the U-Boot command line. For reference, the source code for that command can be found here:


If you do not have a functioning U-Boot already, you can boot the board over USB without using the EsBurn tool. While this is more or less what EsBurn does under the hood, this procedure is not the official way to recover the bootloader and is not guaranteed to work:
  1. Set the DIP switches as shown in Figure 7 in the above document.
  2. Power on the SoC. It will show up as a mass storage device as described in Section 5.2.3. That mass storage device will have a FAT filesystem on it.
  3. Mount the filesystem, copy bootloader_ddr5_secboot.bin to it, and unmount it. When you unmount the filesystem, the boot ROM will execute the ddr firmware.
  4. Once that completes, mount the filesystem again, copy bootloader_ddr5_secboot.bin to it, and unmount it. When you unmount the filesystem the second time, the boot ROM will execute OpenSBI/U-Boot.
  5. At this point, you can follow the instructions for flashing the firmware from U-Boot.
  6. Don't forget to return the DIP switches to their normal position as shown in Figure 9.
As far as I am aware, the source code for EsBurn has not been released.

Regards,
Samuel

Han Gao/Revy

unread,
Dec 13, 2024, 8:28:19 AM12/13/24
to RISC-V Developer Board Community, Matthew Croughan
Can be done without es_burn software.

Case1:  U-boot can work

1.1 bootloader_ddr5_secboot.bin in U disk
fatload usb 0 0x90000000 bootloader_secboot_ddr5_hifive-p550.bin;
es_burn write 0x90000000 flash;

1.2 bootloader_ddr5_secboot.bin in emmc
ext4load mmc 0:3 0x90000000 bootloader_secboot_ddr5_hifive-p550.bin;
es_burn write 0x90000000 flash;

Case2: U-boot not working

Adjust DIP Switch SW2: 0011
USB0 Connection to HOST machine.
At this point the system will prompt for a 4G disk.
Copy the bootloader_secboot_ddr5_hifive-p550.bin under the shell
(Using the GUI may have failed I'm guessing that creating the file placeholder first caused the bootrom to read an incomplete bootloader)
Wait 5-30s to enter uboot.
Then refer to Case1.
Reply all
Reply to author
Forward
0 new messages