starfive-tech / VisionFive2

454 stars 81 forks source link

Last versions are not flashable. #54

Open MiMillieuh opened 1 year ago

MiMillieuh commented 1 year ago

Fw images are not flashable on my board since VisionFive2 Software v2.11.5

root@DietPi:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00040000 00001000 "spl"
mtd1: 00300000 00001000 "uboot"
mtd2: 00010000 00001000 "data"
root@DietPi:~# flashcp -v visionfive2_fw_payload.img /dev/mtd0
visionfive2_fw_payload.img won't fit into /dev/mtd0!

even on sdcard.img or any other version that has flashcp...

I can flash uboot without issues.

MichaelZhuxx commented 1 year ago

@MiMillieuh please refer to https://doc-en.rvspace.org/VisionFive2/Quick_Start_Guide/VisionFive2_SDK_QSG/spl_new.html#updating_spl_and_u_boot-vf2__section_zpj_cqt_yvb the mtd0 is for spl(u-boot-spl.bin.normal.out) and mtd1 is for uboot(visionfive2_fw_payload.img)

MiMillieuh commented 1 year ago

So if I understand, I have to flash fw in uboot and uboot in spl ?

That's not really clear since in the example they list mtd and flash it like I've done it (point 4), but in the second one not (exemple of point 4).

MichaelZhuxx commented 1 year ago

would you please help us point out where misunderstandings are likely to occur

image
MiMillieuh commented 1 year ago

The not intuitive part is that you need to flash the uboot file in spl and the firmware file in uboot.

It wasn't the case before and I must admit that it's not really intuitive.

Maybe it should be pointed that the method has changed or something.

Actually what I understand is that I've flashed uboot in uboot on my board but it wasn't the right move cause uboot doesn't belong in uboot now but the firmware does.

Sans titre

(by the way did I brick my board by doing so ?)

MichaelZhuxx commented 1 year ago

It's just name or code that caused your misunderstanding.

SPL is first part of u-boot. so we call it u-boot-spl, and second-stage bootloader is regular U-Boot (or U-Boot proper); however, in the context of OpenSBI, U-Boot as a payload to the OpenSBI firmware, becoming the boot stage following the OpenSBI firmware execution, so that we call it'board name'-fw-paylad.