Skip to content

Commit 8e591de

Browse files
committed
readme: add flash instructions for nand
1 parent f5a7a25 commit 8e591de

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,26 @@ kernelfile=bpi-r4_6.5.0-rc1.tar.gz
3131
```
3232
both configs can be used together to not download anything from my github releases.
3333

34+
## how to build nand-image
35+
36+
To use specifc files you can set them in the sourcefiles_bpi-r*.conf.
37+
If they are not defined, script tries to download the latest files.
38+
39+
if using r4-2g5, r4pro or r4lite board you should set the variant variable.
40+
41+
```
42+
variant=bpi-r4-lite
43+
skipubootdownload=1
44+
fipfile=bpi-r4lite_spim-nand_ubi_fip.bin
45+
skipkerneldownload=1
46+
kernelfile=bpi-r4_6.17.0-rc1-r4lite.tar.gz
47+
skipinitrddownload=1
48+
initrd=rootfs_arm64.cpio.zst
49+
```
50+
finally run build process
51+
```
52+
./ubifs.sh bpi-r4
53+
```
3454
## how add packages
3555

3656
add this option in the sourcefiles_board.conf
@@ -41,10 +61,33 @@ userpackages="ethtool iperf3 tcpdump"
4161

4262
## how to write image
4363

64+
### sd/emmc
65+
66+
flash from linux host
67+
4468
```sh
4569
gunzip -c bpi-r3_sdmmc.img.gz | sudo dd bs=1M status=progress conv=notrunc,fsync of=/dev/sdX
4670
```
4771

72+
### nand
73+
74+
how to write bl2 and ubinized image to nand in uboot for R4
75+
76+
```sh
77+
# erase full nand or only bl2 section
78+
mtd erase spi-nand0
79+
mtd erase spi-nand0 0x0 0x200000
80+
# load bl2 and flash it
81+
fatload usb 0:1 $loadaddr bpi-r4pro_spim-nand_ubi_bl2.img
82+
mtd write spi-nand0 $loadaddr 0x0 $filesize
83+
# erase ubi mtd partition (if not done full erase)
84+
mtd erase spi-nand0 0x200000
85+
# load and flash ubinized image
86+
fatload usb 0:1 $loadaddr bpi-r4-pro_nand.img
87+
mtd write spi-nand0 $loadaddr 0x200000 $filesize
88+
```
89+
make sure size of ubi partition in devicetree matches your nand size on first linux boot to correctly resize the ubifs, else EC errors occour when booting from nand.
90+
4891
## first bootup
4992

5093
### login

0 commit comments

Comments
 (0)