Please use a terminal that supports YMODEM
file transfers. For Windows there is Tera Term
. On Linux I recommend minicom
, but ensure lrzsz
is also installed, as the file transfer feature uses it.
Set up connection at 115200 bps, 8N1.
First, prepare the files you want to flash, such as from the latest release:
https://github.com/starfive-tech/VisionFive2/releases
- u-boot-spl.bin.normal.out
- visionfive2_fw_payload.img
Boot in flash mode, without a sdcard inserted, or otherwise interrupt u-boot’s autoboot:
Hit any key to stop autoboot: 0
StarFive #
After sending loady
command, start the YMODEM upload through your terminal’s interface.
Like:
StarFive # loady
## Ready for binary (ymodem) download to 0xA0000000 at 115200 bps...
CCxyzModem - CRC mode, 1(SOH)/128(STX)/0(CAN) packets, 7 retries
## Total Size = 0x0001fe80 = 130688 Bytes
StarFive #
There is strong assurance that the transfer went well, as YMODEM uses a CRC16 checksum on every block sent (1KB blocks), so if $filesize matches, it should be good. Regardless, it’s possible to CRC32 the whole file and manually compare.
StarFive # crc32 $loadaddr $filesize
crc32 for a0000000 ... a001fe7f ==> ca14da8e
OK. It’s the same file. Let’s flash it next. First, detect the SPI Flash:
StarFive # sf probe
SF: Detected gd25lq128 with page size 256 Bytes, erase size 4 KiB, total 16 MiB
Then, time to flash the file we transferred.
For u-boot-spl.bin.normal.out the offset at the flash is zero:
#WARNING: This is for u-boot-spl.bin.normal.out. Ensure that is the file we loaded!
StarFive # sf update $loadaddr 0x0 $filesize
device 0 offset 0x0, size 0x1fe80
130688 bytes written, 0 bytes skipped in 0.600s, speed 221563 B/s
Whereas for visionfive2_fw_payload.img the right offset is 0x100000:
#WARNING: This is for visionfive2_fw_payload.img. Ensure that is the file we loaded!
StarFive # sf update $loadaddr 0x100000 $filesize
device 0 offset 0x100000, size 0x2aae85
867973 bytes written, 1929216 bytes skipped in 5.750s, speed 497796 B/s
Once done, reboot by either using the reset
command or physically pressing the reset button.