bare-metal experiments with VisionFive 2
r5os uses cmake and LLVM to be built. You can build r5os
using cmake:
cmake .
make
Then, you have many ways to run it on VisionFive 2:
In order to do this, you need to connect your VisionFive 2 to network where it can access a TFTP server. Then:
- Host a
build/r5os.elf
on your TFTP server. - Connect to your VisionFive 2 by UART (using e.g. minicom or putty).
- Run your VisionFive 2 and get to u-boot prompt. You can do this by running your VisionFive 2 without any storage medium or interrupting start-up when U-boot lists available images.
- Configure network. You can use command
dhcp
:
StarFive # dhcp
or manually assign address by setting ipaddr
and netmask
using setenv
:
StarFive # setenv ipaddr 192.168.0.100
StarFive # setenv netmask 255.255.255.0
- Load
r5os.elf
file from TFTP server:
StarFive # tftpboot ${loadAddr} [tftpServerAddr]:[pathToR5OsElf]
- r5os.elf is now loaded at
loadAddr
(0x60000000). Run it with commandbootelf
:
StarFive # bootelf
In order to do this, you need to connect to your VisionFive 2 by UART and use program capable of transfering files via ymodem (e.g. minicom).
CMake provides make vf2_ymodem
command to do so (define VF2_YMODEM_FILE
accordingly). You can also:
- Run your VisionFive 2 and get to u-boot prompt. You can do this by running your VisionFive 2 without any storage medium or interrupting start-up when U-boot lists available images.
- Enter
loady
command:
StarFive # loady
- Begin transfering file. In minicom, press
Ctrl+A
and thenS
. A menu should open - selectymodem
, and then navigate tobuild/r5os.elf
. Wait a while until transfer is complete and prompt appears. - r5os.elf is now loaded at
loadAddr
(0x60000000). Run it with commandbootelf
:
StarFive # bootelf
Note: you might need root access to use serial port.