I can't boot into image

how have you created your SDcard?
are you sure that the switches on the board are set correctly? (maybe it is trying to boot from the QSPI).

2 Likes

U-Boot SPL 2021.10 (May 31 2023 - 16:54:00 +0800)
DDR version: dc2e84f0.
Trying to boot from SPI

OpenSBI v1.2

I think you have the original uboot
look around the forum for updating the flash

drops you at the uboot prompt
StarFive #
? will show you a list of commands
printenv will show you the scripts and env variables built in

2 Likes

@chabulhwi
use the SD boot mode.
If you have created the SD card from the image, there is a u-boot partition that will start properly your configuration.

check here how to configure the switches on the VF2 board:
https://rvspace.org/en/project/VisionFive2_Debian_Wiki_202306_Release
look at the section Boot Mode Settings

2 Likes

I used balenaEtcher to flash the image to a micro-SD card.

I set the switches as in the following picture:

1 Like

I should’ve changed the boot mode to the SDIO mode.

1 Like

@giacomo Now I can’t login. See https://paste.sr.ht/blob/cf27ffda0a2c7e51bbdc11a71b6a8b571f222cc2.

It doesn’t show commands; it just hangs.


U-Boot SPL 2021.10 (Oct 31 2022 - 12:11:37 +0800)
DDR version: dc2e84f0.
Trying to boot from SPI

OpenSBI v1.0
   ____                    _____ ____ _____
  / __ \                  / ____|  _ \_   _|
 | |  | |_ __   ___ _ __ | (___ | |_) || |
 | |  | | '_ \ / _ \ '_ \ \___ \|  _ < | |
 | |__| | |_) |  __/ | | |____) | |_) || |_
  \____/| .__/ \___|_| |_|_____/|____/_____|
        | |
        |_|

Platform Name             : StarFive VisionFive V2
Platform Features         : medeleg
Platform HART Count       : 5
Platform IPI Device       : aclint-mswi
Platform Timer Device     : aclint-mtimer @ 4000000Hz
Platform Console Device   : uart8250
Platform HSM Device       : ---
Platform Reboot Device    : ---
Platform Shutdown Device  : ---
Firmware Base             : 0x40000000
Firmware Size             : 360 KB
Runtime SBI Version       : 0.3

Domain0 Name              : root
Domain0 Boot HART         : 3
Domain0 HARTs             : 0*,1*,2*,3*,4*
Domain0 Region00          : 0x0000000002000000-0x000000000200ffff (I)
Domain0 Region01          : 0x0000000040000000-0x000000004007ffff ()
Domain0 Region02          : 0x0000000000000000-0xffffffffffffffff (R,W,X)
Domain0 Next Address      : 0x0000000040200000
Domain0 Next Arg1         : 0x0000000042200000
Domain0 Next Mode         : S-mode
Domain0 SysReset          : yes

Boot HART ID              : 3
Boot HART Domain          : root
Boot HART Priv Version    : v1.11
Boot HART Base ISA        : rv64imafdcbx
Boot HART ISA Extensions  : none
Boot HART PMP Count       : 8
Boot HART PMP Granularity : 4096
Boot HART PMP Address Bits: 34
Boot HART MHPM Count      : 2
Boot HART MIDELEG         : 0x0000000000000222
Boot HART MEDELEG         : 0x000000000000b109


U-Boot 2021.10 (Oct 31 2022 - 12:11:37 +0800), Build: jenkins-VF2_515_Branch_SDK_Release-10

CPU:   rv64imacu
Model: StarFive VisionFive V2
DRAM:  8 GiB
MMC:   sdio0@16010000: 0, sdio1@16020000: 1
Loading Environment from SPIFlash... SF: Detected gd25lq128 with page size 256 Bytes, erase size 4 KiB, total 16 MiB
*** Warning - bad CRC, using default environment

StarFive EEPROM format v2

--------EEPROM INFO--------
Vendor : StarFive Technology Co., Ltd.
Product full SN: VF7110A1-2250-D008E000-00001337
data version: 0x2
PCB revision: 0xa1
BOM revision: A
Ethernet MAC0 address: 6c:cf:39:00:27:f3
Ethernet MAC1 address: 6c:cf:39:00:27:f4
--------EEPROM INFO--------

In:    serial@10000000
Out:   serial@10000000
Err:   serial@10000000
Model: StarFive VisionFive V2
Net:   eth0: ethernet@16030000, eth1: ethernet@16040000
switch to partitions #0, OK
mmc1 is current device
found device 1
bootmode flash device 1
406 bytes read in 2 ms (198.2 KiB/s)
Importing environment from mmc1 ...
Can't set block device
Hit any key to stop autoboot:  2 a 1 
 0 
## Error: "load_distro_uenv" not defined
## Error: "bootcmd_distro" not defined
StarFive # ?
?
?
It just hangs

@coltree How do I update U-Boot when I can’t run any command on the U-Boot command mode?

I’ve just flashed Image-55 and managed to log into Debian using the 1-bit QSPI NOR FLASH mode. But I can’t update U-Boot.

@chabulhwi You can try with this image: https://github.com/starfive-tech/VisionFive2/releases/download/VF2_v2.5.0/sdcard.img
Connect from another machine with ssh.

sudo apt install mtd-utils
I transferred the files with a USB stick.
https://doc-en.rvspace.org/VisionFive2/PDF/VisionFive2_QSG.pdf (Section 4.3)

cat /proc/mtd

flashcp -v u-boot-spl.bin.normal.out /dev/mtd0
flashcp -v visionfive2_fw_payload.img /dev/mtd1

1 Like

I can send commands with GTKTerm, but not with minicom. I don’t know why.

Most important thing, did you manage to update the firmware with GTKTerm?
If I’m correct, the newer images can do this directly.

I failed to transfer u-boot-spl.bin.normal.out to VF2. I will use your method after I wake up.

StarFive # setenv ipaddr 172.30.1.3; setenv serverip 172.30.1.2; setenv gatewayip 172.30.1.254
StarFive # ping 172.30.1.2
Using ethernet@16030000 device
host 172.30.1.2 is alive
StarFive # sf probe
SF: Detected gd25lq128 with page size 256 Bytes, erase size 4 KiB, total 16 MiB
StarFive # tftpboot 0xa0000000 ${serverip}:u-boot-spl.bin.normal.out
Using ethernet@16030000 device
TFTP from server 172.30.1.2; our IP address is 172.30.1.3
Filename 'u-boot-spl.bin.normal.out'.
Load address: 0xa0000000
Loading: T T T T T T T T T T 
Retry count exceeded; starting again
StarFive # ping 172.30.1.3
Using ethernet@16040000 device

ARP Retry count exceeded; starting again
ping failed; host 172.30.1.3 is not alive
StarFive # 

@LivingLinux Using sdcard.img from v2.5.0, I was able to flash visionfive2_fw_payload.img from the 202306 release, but not u-boot-spl.bin.normal.out from the same release. So I tried to update the U-Boot binary again with the 202302 release, and it worked well.

Thank you all for your help!

@chabulhwi
in minicom, by default it has flow control, which are lines not presents on your wire.
you need to go into the option Ctrl-A Z O, select the modem section, and disable flow control F, then it will work.

1 Like

@giacomo I had to select “Serial port setup” instead of “Modem and dialing.” But thanks anyway!

Hi,
before updating firmware in /dev/mtd*
run
root@starfive:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
mtdblock0 31:0 0 128K 0 disk
mtdblock1 31:1 0 3M 0 disk
mtdblock2 31:2 0 1M 0 disk
and
root@starfive:~# cat /proc/mtd
dev: size erasesize name
mtd0: 00020000 00001000 “spl”
mtd1: 00300000 00001000 “uboot”
mtd2: 00100000 00001000 “data”

the size of /dev/mtd partitions are mapped from the dtb file
above is from dtb v2.10.4
below is from dtb v2.11.5

root@starfive:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
mtdblock0 31:0 0 256K 0 disk
mtdblock1 31:1 0 3M 0 disk
mtdblock2 31:2 0 1M 0 disk
cat /proc/mtd
dev: size erasesize name
mtd0: 00040000 00001000 “spl”
mtd1: 00300000 00001000 “uboot”
mtd2: 00100000 00001000 “data”

You can’t flash a new u-boot when running from an old debian image
What came first ? the chicken or the egg ?

1 Like

202306-SD is include new spl/uboot. Use SDIO boot mode to boot VF2 .
If you do not want boot from NVME, update spl/uboot is not necessary.

1 Like

I think this might answer your question:

1 Like

using dtc to decompile the dtb’s
in visionfive-2.5.0.dtb
partitions {
compatible = “fixed-partitions”;
#address-cells = <0x01>;
#size-cells = <0x01>;

				spl@0 {
					reg = <0x00 0x20000>;
				};

				uboot@100000 {
					reg = <0x100000 0x300000>;
				};

				data@f00000 {
					reg = <0xf00000 0x100000>;
				};
			};

and in 3.1.5.dtb
partitions {
compatible = “fixed-partitions”;
#address-cells = <0x01>;
#size-cells = <0x01>;

				spl@0 {
					reg = <0x00 0x40000>;
				};

				uboot@100000 {
					reg = <0x100000 0x300000>;
				};

				data@f00000 {
					reg = <0xf00000 0x100000>;
				};
			};

this is what maps the mtd* partitions,
so… the chicken comes first…

1 Like