1BeagleV 2======= 3 4BeagleV is a low-cost RISC-V 64-bit based platform, powered by a 5Starfive JH7100 processor. The current defconfig in Buildroot has been 6tested with the JH7100 chip used on the beta version of the BeagleV 7board. 8 9How to build 10============ 11 12$ make beaglev_defconfig 13$ make 14 15Build results 16============= 17 18After building, output/images contains: 19 20+ bootloader-BEAGLEV-buildroot.bin.out 21+ ddrinit-2133-buildroot.bin.out 22+ Image 23+ fw_payload.bin 24+ fw_payload.bin.out 25+ fw_payload.elf 26+ rootfs.ext2 27+ rootfs.ext4 28+ sdcard.img 29+ u-boot.bin 30 31The four important files are: 32 33 - bootloader-BEAGLEV-buildroot.bin.out, the first stage bootloader 34 35 - ddrinit-2133-buildroot.bin.out, the DDR initialization firmware 36 37 - fw_payload.bin.out, which is the bootloader image, containing 38 both OpenSBI and U-Boot. 39 40 - sdcard.img, the SD card image, which contains the root filesystem, 41 kernel image and Device Tree. 42 43Flashing the SD card image 44========================== 45 46$ sudo dd if=output/images/sdcard.img of=/dev/sdX 47 48Preparing the board 49=================== 50 51Connect the Beagle-V fan to the 5V supply (pin 2 or 4 of the GPIO 52connector) and GND (pin 6 of the GPIO connector). 53 54Connect a TTL UART cable to pin 8 (TX), 10 (RX) and 14 (GND). 55 56Insert your SD card. 57 58Power-up the board using an USB-C cable. 59 60Flashing OpenSBI/U-Boot 61======================= 62 63The bootloader pre-flashed on the Beagle-V has a non-working 64fdt_addr_r environment variable value, so it won't work 65as-is. Reflashing the bootloader with the bootloader image produced by 66Buildroot is necessary. 67 68When the board starts up, a pre-loader shows a count down of 2 69seconds, interrupt by pressing any key. You should reach a menu like 70this: 71 72--------8<---------- 73 74bootloader version:210209-4547a8d 75ddr 0x00000000, 1M test 76ddr 0x00100000, 2M test 77DDR clk 2133M,Version: 210302-5aea32f 780 79*************************************************** 80*************** FLASH PROGRAMMING ***************** 81*************************************************** 82 830:update uboot 841:quit 85select the function: 86 87--------8<---------- 88 89Press 0 and Enter. You will now see "C" characters being 90displayed. Ask your serial port communication program to send 91fw_payload.bin.out using the Xmodem protocol. 92 93After reflashing is complete, restart the board, it will automatically 94start the system from the SD card, and reach the login prompt. 95 96Flashing low-level bootloaders 97============================== 98 99The BeagleV comes pre-flashed with functional low-level bootloaders 100(called "secondboot" and "ddrinit"). Re-flashing them is not necessary 101to use this Buildroot defconfig. However, for the sake of 102completeness, Buildroot builds and provides those low-level bootloader 103images. 104 105You can flash them as follows: 106 107 - In the same "pre-loader" menu as the one used above, instead of 108 entering 0 or 1, enter the magic "root@s5t" string. This enters the 109 "expert" features. 110 111 - Then, press 0 and send over X-modem the 112 bootloader-BEAGLEV-buildroot.bin.out file. 113 114 - Then, press 1 and send over X-modem the 115 ddrinit-2133-buildroot.bin.out. 116 117Note that the reflashing mechanism itself relies on those low-level 118bootloaders, so if you flash non-working versions, you'll have to go 119through a recovery process. This requires wiring up to a separate 120debug UART, which pins are located near the HDMI connector. See 121https://wiki.seeedstudio.com/BeagleV-Update-bootloader-ddr-init-boot-uboot-Recover-bootloader/ 122section "Recover the bootloader" for more details. The instructions 123make use of a jh7100-recover tool, which Buildroot has built as part 124of this defconfig: it is available as output/host/bin/jh7100-recover. 125