基于StarFive VisionFive 2(昉·星光 2 )打造智能家居平台的尝试
分享作者:user202010140595
评测品牌:赛昉科技
评测型号:VF202040-A0
申请理由(产品应用):用于智能家居控制系统集成测试,参与过飞腾派首批测评,芯查查论坛发表过多篇测评报告及DIY帖子。
发布时间:2024-10-09 09:19:39
前言
StarFive VisionFive 2(昉·星光 2 )是一款基于RISC-V架构的开发板,基于此开发板尝试打造智能家居控制平台。
开源口碑分享内容

RISC-V(发音为 “risk-five”)是一种基于精简指令集(RISC)原则的开源指令集架构(ISA),是一种区别于ARM架构的较新的架构,其主要特点如下:

开放与免费:与传统的指令集架构(如 x86 和 ARM)不同,RISC-V 是开源且免费的,这大大降低了芯片设计的门槛和成本,允许任何人使用其指令集进行芯片设计和软件开发,吸引了众多企业和开发者参与。

精简:具有简洁的指令集,指令数量相对较少,易于实现和优化,能够提高处理器的性能和效率。

模块化与可扩展性:其指令集采用模块化设计,开发者可以根据具体需求选择不同的模块进行组合,还可以添加自定义的指令集,以适应特定的应用场景,具有很强的灵活性和可扩展性。

可移植性强:可以在不同的硬件平台上实现,方便开发者将代码在不同的 RISC-V 处理器上进行移植和优化。

StarFive VisionFive 2(昉·星光 2 )是一款基于RISC-V架构的开发板,它由赛昉科技推出,是全球首款集成 3D GPU 的高性能量产 RISC-V 单板计算机。

它搭载了昉·惊鸿-7110(JH-7110)RISC-V多媒体处理器,采用64位四核RISC-V CPU,工作频率高达1.5GHz。VisionFive 2不仅性能强劲,而且接口丰富、可扩展性强,软件资源丰富,为开发者提供了一个高效、易用、安全的数据存储和管理平台。以下是关于StarFive VisionFive 2的详细介绍:

主要规格参数

- CPU:昉·惊鸿-7110,64位四核RISC-V CPU,工作频率1.5GHz。

- GPU:Imagination  IMG BXE-4-32 MC1,支持3D图形处理。

- 内存:可选2GB/4GB/8GB LPDDR4 SDRAM。

- 存储:支持MicroSD卡和eMMC模块,以及M.2 2280接口。

- 接口:4个USB 3.0接口,2个千兆网口,HDMI 2.0接口,40针GPIO接口。

软件生态支持

- 操作系统:官方适配 Debian 操作系统,同时通过社区合作适配了各种 Linux 发行版,包括 Ubuntu、OpenSUSE、OpenKylin、OpenEuler、Deepin 等。据说VisionFive 2 还是全球首款支持开源鸿蒙(OpenHarmony)的 RISC-V 单板电脑,后续会加入OpenHarmony 主线支持。- 开发工具:提供编译工具链和常用开发工具,支持ROS2等机器人操作系统。

应用场景

- 家庭NAS:适用于数据备份、媒体服务器、远程访问等家庭存储需求。

- 教育和开发:适合教育机构、开发者进行RISC-V架构的教学和开发工作。

StarFive VisionFive 2凭借其高性能、丰富的接口和软件生态支持,成为RISC-V领域的一款重要产品,尤其适合对RISC-V架构感兴趣的开发者和个人用户。

庐山真面目

物理规格

100mm x 74mm 的板卡尺寸略小于飞腾派的 119mm x 93.1mm,作为对比树莓派4B尺寸为85mm x 56mm

在使用昉·星光 2时,避免硬物接触以免造成开发板损坏,官方建议使用单头六角铜柱(尺寸:M2.5*10 + 6mm)

双通六角铜螺柱(尺寸:M2.5*4)进行隔离。这里建议官方可以在包装盒内附赠以上规格螺柱,提升体验感���

板载资源

芯片展示

前期准备

启动模式开关:

RGPIO_1:0    RGPIO_0:0    启动模式:flash

RGPIO_1:0    RGPIO_0:1    启动模式:TF Card    

RGPIO_1:1    RGPIO_0:0    启动模式:eMMC

RGPIO_1:1    RGPIO_0:1    启动模式:UART

调试接口:复用 40PIN 引脚上的第 8、10 脚(物理地址标号),提供 UART TX 和 UART RX 功能

固件下载

官方Debian系统:https://debian.starfivetech.com/

最新版本202405,需要吐槽的是百度网盘连接,没有SVIP会员根本下载不动,作为一款广受好评的开发板,提供这么一种下载服务太不应该了。有人说OneDrive网盘下载很快,我尝试时链接失效,另外OneDrive在国内访问也不是那么顺畅。 后面尝试OneDrive可以下载了,下载速度还是挺快的!

Deepin镜像:https://cdimage.deepin.com/RISC-V/preview-20240613-riscv64/deepin-23-beige-preview-riscv64-visionfive2-20240613-125619.tar.xz

依旧是技术预览版本,镜像贼大,比X86和ARM构架的镜像大多了。

openKylin镜像:https://mirrors.hust.edu.cn/openkylin-cdimage/2.0/openKylin-Embedded-V2.0-Release-visionfive2-riscv64.img.xz

去年还是1.0版本的时候,下载在飞腾派上使用过,当时镜像相当简陋,不知道2.0版本是否改观,后续烧录体验。

Ubuntu镜像:

https://cdimage.ubuntu.com/releases/24.04.1/release/ubuntu-24.04.1-preinstalled-server-riscv64+visionfive2.img.xz

https://cdimage.ubuntu.com/releases/24.04/release/ubuntu-24.04-preinstalled-server-riscv64+visionfive2.img.xz

英文版网站入口隐藏比较深,中文版下载站版本不是最新,链接点击报错,但是可以右键复制到下载地址。

Armbian镜像:https://www.armbian.com/visionfive2/

https://dl.armbian.com/visionfive2/Noble_edge_xfce

https://dl.armbian.com/visionfive2/Noble_edge_minimal

Armbian 是一个轻量级的基于 Debian 或 Ubuntu 的 Linux 发行版,专门为 ARM 开发板进行优化和定制,当然目前也支持RISC-V架构。个人更倾向于使用Armbian系统,很多小伙伴都用斐讯N1、玩客云、树莓派这些设备跑Armbian,提供的一些Armbian config等什么的命令还是非常方便的。

Ubuntu镜像刷写可能需要注意硬件版本号,不同的版本略有不同。

镜像烧录

使用balenaEtcher进行镜像烧录

尴尬,数据验证进度迟迟不动,跳过也没有反应,换了低版本又烧录了一次,直接跳过验证。

经过N次烧录尝试,发现需要解压.img.xz为.img镜像,否则会出现校验失败问题。

固件启动

使用串口工具连接好开发板和笔记本USB接口后,使用串口调试软件或者Putty查看启动日志,判断是否正常进入系统。

我这里使用的串口工具是PWLINK。

调节启动模式为SPI或者SD卡,可看到以下日志,下面为各系统启动存在问题的日志信息

1  U-Boot SPL 2021.10 (Feb 28 2023 - 21:44:53 +0800)

2  DDR version: dc2e84f0.

3  Trying to boot from SPI

4  

5  OpenSBI v1.2

6     ____                    _____ ____ _____

7    / __ \                  / ____|  _ \_   _|

8   | |  | |_ __   ___ _ __ | (___ | |_) || |

9   | |  | | '_ \ / _ \ '_ \ \___ \|  _ < | |

10   | |__| | |_) |  __/ | | |____) | |_) || |_

11    \____/| .__/ \___|_| |_|_____/|____/_____|

12          | |

13          |_|

14  

15  Platform Name             : StarFive VisionFive V2

16  Platform Features         : medeleg

17  Platform HART Count       : 5

18  Platform IPI Device       : aclint-mswi

19  Platform Timer Device     : aclint-mtimer @ 4000000Hz

20  Platform Console Device   : uart8250

21  Platform HSM Device       : jh7110-hsm

22  Platform PMU Device       : ---

23  Platform Reboot Device    : pm-reset

24  Platform Shutdown Device  : pm-reset

25  Firmware Base             : 0x40000000

26  Firmware Size             : 292 KB

27  Runtime SBI Version       : 1.0

28  

29  Domain0 Name              : root

30  Domain0 Boot HART         : 1

31  Domain0 HARTs             : 0*,1*,2*,3*,4*

32  

33  Domain0 Region00          : 0x0000000002000000-0x000000000200ffff (I)

34  Domain0 Region01          : 0x0000000040000000-0x000000004007ffff ()

35  Domain0 Region02          : 0x0000000000000000-0xffffffffffffffff (R,W,X)

36  Domain0 Next Address      : 0x0000000040200000

37  Domain0 Next Arg1         : 0x0000000042200000

38  Domain0 Next Mode         : S-mode

39  Domain0 SysReset          : yes

40  

41  Boot HART ID              : 1

42  Boot HART Domain          : root

43  Boot HART Priv Version    : v1.11

44  Boot HART Base ISA        : rv64imafdcbx

45  Boot HART ISA Extensions  : none

46  Boot HART PMP Count       : 8

47  Boot HART PMP Granularity : 4096

48  Boot HART PMP Address Bits: 34

49  Boot HART MHPM Count      : 2

50  Boot HART MIDELEG         : 0x0000000000000222

51  Boot HART MEDELEG         : 0x000000000000b109

52  

53  

54  U-Boot 2021.10 (Feb 28 2023 - 21:44:53 +0800), Build: jenkins-VF2_515_Branch_SDK_Release-31

55  

56  CPU:   rv64imacu

57  Model: StarFive VisionFive V2

58  DRAM:  4 GiB

59  MMC:   sdio0@16010000: 0, sdio1@16020000: 1

60  Loading Environment from SPIFlash... SF: Detected gd25lq128 with page size 256 Bytes, erase size 4 KiB, total 16 MiB

61  *** Warning - bad CRC, using default environment

62  

63  StarFive EEPROM format v2

64  

65  --------EEPROM INFO--------

66  Vendor : StarFive Technology Co., Ltd.

67  Product full SN: VF7110B1-2310-D004E000-00002400

68  data version: 0x2

69  PCB revision: 0xb2

70  BOM revision: A

71  Ethernet MAC0 address: 6c:cf:39:00:57:2e

72  Ethernet MAC1 address: 6c:cf:39:00:57:2f

73  --------EEPROM INFO--------

74  

75  In:    serial@10000000

76  Out:   serial@10000000

77  Err:   serial@10000000

78  Model: StarFive VisionFive V2

79  Net:   eth0: ethernet@16030000, eth1: ethernet@16040000

80  switch to partitions #0, OK

81  mmc1 is current device

82  found device 1

83  bootmode flash device 1

84  GUID Partition Table Entry Array CRC is wrong: 0xbc1dd373 != 0xab54d286

85  find_valid_gpt: *** ERROR: Invalid GPT ***

86  

87  find_valid_gpt: ***        Using Backup GPT ***

88  ** Invalid partition 3 **

89  Couldn't find partition mmc 1:3

90  Can't set block device

91  GUID Partition Table Entry Array CRC is wrong: 0xbc1dd373 != 0xab54d286

92  find_valid_gpt: *** ERROR: Invalid GPT ***

93  find_valid_gpt: ***        Using Backup GPT ***

94  ** Invalid partition 3 **

95  Couldn't find partition mmc 1:3

96  Can't set block device

97  Hit any key to stop autoboot:  2  1  0

98  GUID Partition Table Entry Array CRC is wrong: 0xbc1dd373 != 0xab54d286

99  find_valid_gpt: *** ERROR: Invalid GPT ***

100  find_valid_gpt: ***        Using Backup GPT ***

101  ** Invalid partition 3 **

102  Couldn't find partition mmc 1:3

103  Can't set block device

104  Importing environment from mmc1 ...

105  ## Info: input data size = 838 = 0x346

106  GUID Partition Table Entry Array CRC is wrong: 0xbc1dd373 != 0xab54d286

107  find_valid_gpt: *** ERROR: Invalid GPT ***

108  find_valid_gpt: ***        Using Backup GPT ***

109  ** Invalid partition 3 **

110  Couldn't find partition mmc 1:3

111  Can't set block device

112  ## Warning: defaulting to text format

113  ## Error: "boot2" not defined

114  switch to partitions #0, OK

115  mmc1 is current device

116  GUID Partition Table Entry Array CRC is wrong: 0xbc1dd373 != 0xab54d286

117  find_valid_gpt: *** ERROR: Invalid GPT ***

118  find_valid_gpt: ***        Using Backup GPT ***

119  GUID Partition Table Entry Array CRC is wrong: 0xbc1dd373 != 0xab54d286

120  find_valid_gpt: *** ERROR: Invalid GPT ***

121  find_valid_gpt: ***        Using Backup GPT ***

122  GUID Partition Table Entry Array CRC is wrong: 0xbc1dd373 != 0xab54d286

123  find_valid_gpt: *** ERROR: Invalid GPT ***

124  find_valid_gpt: ***        Using Backup GPT ***

125  GUID Partition Table Entry Array CRC is wrong: 0xbc1dd373 != 0xab54d286

126  find_valid_gpt: *** ERROR: Invalid GPT ***

127  find_valid_gpt: ***        Using Backup GPT ***

128  GUID Partition Table Entry Array CRC is wrong: 0xbc1dd373 != 0xab54d286

129  find_valid_gpt: *** ERROR: Invalid GPT ***

130  find_valid_gpt: ***        Using Backup GPT ***

131  GUID Partition Table Entry Array CRC is wrong: 0xbc1dd373 != 0xab54d286

132  find_valid_gpt: *** ERROR: Invalid GPT ***

133  find_valid_gpt: ***        Using

1  U-Boot SPL 2021.10 (May 09 2024 - 22:45:24 +0800)

2  LPDDR4: 4G version: g8ad50857.

3  Trying to boot from MMC2

4  

5  OpenSBI v1.2

6     ____                    _____ ____ _____

7    / __ \                  / ____|  _ \_   _|

8   | |  | |_ __   ___ _ __ | (___ | |_) || |

9   | |  | | '_ \ / _ \ '_ \ \___ \|  _ < | |

10   | |__| | |_) |  __/ | | |____) | |_) || |_

11    \____/| .__/ \___|_| |_|_____/|___/_____|

12          | |

13          |_|

14  

15  Platform Name             : StarFive VisionFive V2

16  Platform Features         : medeleg

17  Platform HART Count       : 5

18  Platform IPI Device       : aclint-mswi

19  Platform Timer Device     : aclint-mtimer @ 4000000Hz

20  Platform Console Device   : uart8250

21  Platform HSM Device       : ---

22  Platform PMU Device       : ---

23  Platform Reboot Device    : pm-reset

24  Platform Shutdown Device  : pm-reset

25  Platform Suspend Device   : ---

26  Firmware Base             : 0x40000000

27  Firmware Size             : 392 KB

28  Firmware RW Offset        : 0x40000

29  Runtime SBI Version       : 1.0

30  

31  Domain0 Name              : root

32  Domain0 Boot HART         : 1

33  Domain0 HARTs             : 0*,1*,2*,3*,4*

34  Domain0 Region00          : 0x0000000002000000-0x000000000200ffff M: (I,R,W) S/U: ()

35  Domain0 Region01          : 0x0000000040000000-0x000000004003ffff M: (R,X) S/U: ()

36  Domain0 Region02          : 0x0000000040040000-0x000000004007ffff M: (R,W) S/U: ()

37  Domain0 Region03          : 0x0000000000000000-0xffffffffffffffff M: (R,W,X) S/U: (R,W,X)

38  Domain0 Next Address      : 0x0000000040200000

39  Domain0 Next Arg1         : 0x0000000042200000

40  Domain0 Next Mode         : S-mode

41  Domain0 SysReset          : yes

42  Domain0 SysSuspend        : yes

43  

44  Boot HART ID              : 1

45  Boot HART Domain          : root

46  Boot HART Priv Version    : v1.11

47  Boot HART Base ISA        : rv64imafdcbx

48  Boot HART ISA Extensions  : none

49  Boot HART PMP Count       : 8

50  Boot HART PMP Granularity : 4096

51  Boot HART PMP Address Bits: 34

52  Boot HART MHPM Count      : 2

53  Boot HART MIDELEG         : 0x0000000000000222

54  Boot HART MEDELEG         : 0x000000000000b109

55  

56  

57  U-Boot 2021.10 (May 09 2024 - 22:45:24 +0800), Build: jenkins-github_visionfive2_6.6-1

58  

59  CPU:   rv64imacu_zba_zbb

60  Model: StarFive VisionFive V2

61  DRAM:  4 GiB

62  MMC:   sdio0@16010000: 0, sdio1@16020000: 1

63  Loading Environment from SPIFlash... SF: Detected gd25lq128 with page size 256 Bytes, erase size 4 KiB, total 16 MiB

64  OK

65  StarFive EEPROM format v2

66  

67  --------EEPROM INFO--------

68  Vendor : StarFive Technology Co., Ltd.

69  Product full SN: VF7110B1-2310-D004E000-00002400

70  data version: 0x2

71  PCB revision: 0xb2

72  BOM revision: A

73  Ethernet MAC0 address: 6c:cf:39:00:57:2e

74  Ethernet MAC1 address: 6c:cf:39:00:57:2f

75  --------EEPROM INFO--------

76  

77  In:    serial

78  Out:   serial

79  Err:   serial

80  Model: StarFive VisionFive V2

81  Net:   eth0: ethernet@16030000, eth1: ethernet@16040000

82  bootmode sd device 1

83  Card did not respond to voltage select! : -110

84  Hit any key to stop autoboot:  0

85  1235 bytes read in 10 ms (120.1 KiB/s)

86  Importing environment from mmc1 ...

87  Failed to load '/uEnv.txt'

88  ## Warning: defaulting to text format

89  Couldn't find partition 1:1:3 0xa0000000

90  Can't set block device

91  Wrong Image Format for bootm command

92  ERROR: can't get kernel image!

93  libfdt fdt_setprop(): FDT_ERR_NOSPACE

94     XIP Invalid Image

95  libfdt fdt_check_header(): FDT_ERR_BADMAGIC

96  libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND

97  Booting kernel in

98  Bad Linux RISCV Image magic!

99  switch to partitions #0, OK

100  mmc1 is current device

101  Scanning mmc 1:3...

102  Found /extlinux/extlinux.conf

103  Retrieving file: /extlinux/extlinux.conf

104  829 bytes read in 14 ms (57.6 KiB/s)

105  U-Boot menu

106  1:      openKylin 2.0 6.6.20

107  2:      openKylin 2.0 6.6.20 (rescue target)

108  Enter choice: 1:        openKylin 2.0 6.6.20

109  Retrieving file: /initrd.img-6.6.20

110  35774983 bytes read in 1685 ms (20.2 MiB/s)

111  Retrieving file: /vmlinuz-6.6.20

112  9322518 bytes read in 446 ms (19.9 MiB/s)

113  append: root=LABEL=rootfs root=/dev/mmcblk1p4 rw console=tty0 console=ttyS0,115200 earlycon rootwait stmmaceth=chain_mode:1 selinux=0

114  Retrieving file: /dtbs/starfive/jh7110-starfive-visionfive-2-v1.3b.dtb

115  54960 bytes read in 22 ms (2.4 MiB/s)

116  kernel_comp_addr_r or kernel_comp_size is not provided!

117  2:      openKylin 2.0 6.6.20 (rescue target)

118  Retrieving file: /initrd.img-6.6.20

119  35774983 bytes read in 1685 ms (20.2 MiB/s)

120  Retrieving file: /vmlinuz-6.6.20

121  9322518 bytes read in 447 ms (19.9 MiB/s)

122  append: root=LABEL=rootfs root=/dev/mmcblk1p4 rw console=tty0 console=ttyS0,115200 earlycon rootwait stmmaceth=chain_mode:1 selinux=0 single

123  Retrieving file: /dtbs/starfive/jh7110-starfive-visionfive-2-v1.3b.dtb

124  54960 bytes read in 22 ms (2.4 MiB/s)

125  kernel_comp_addr_r or kernel_comp_size is not provided!

126  SCRIPT FAILED: continuing...

127  Card did not respond to voltage select! : -110

128  No EFI system partition

129  ethernet@16030000 Waiting for PHY auto negotiation to complete......... TIMEOUT !

130  phy_startup() failed: -110FAILED: -110ethernet@16040000 Waiting for PHY auto negotiation

1  U-Boot SPL 2024.01+dfsg-1ubuntu5 (Apr 04 2024 - 16:22:45 +0000)

2  DDR version: dc2e84f0.

3  Trying to boot from MMC2

4  

5  

6  U-Boot 2024.01+dfsg-1ubuntu5 (Apr 04 2024 - 16:22:45 +0000)

7  

8  CPU:   rv64imafdc_zba_zbb

9  Model: StarFive VisionFive 2 v1.3B

10  DRAM:  4 GiB

11  Core:  135 devices, 26 uclasses, devicetree: board

12  WDT:   Not starting watchdog@13070000

13  MMC:   mmc@16010000: 0, mmc@16020000: 1

14  Loading Environment from SPIFlash... SF: Detected gd25lq128 with page size 256 B                                                                                                                     ytes, erase size 4 KiB, total 16 MiB

15  OK

16  StarFive EEPROM format v2

17  

18  --------EEPROM INFO--------

19  Vendor : StarFive Technology Co., Ltd.

20  Product full SN: VF7110B1-2310-D004E000-00002400

21  data version: 0x2

22  PCB revision: 0xb2

23  BOM revision: A

24  Ethernet MAC0 address: 6c:cf:39:00:57:2e

25  Ethernet MAC1 address: 6c:cf:39:00:57:2f

26  --------EEPROM INFO--------

27  

28  starfive_7110_pcie pcie@2b000000: Starfive PCIe bus probed.

29  starfive_7110_pcie pcie@2c000000: Starfive PCIe bus probed.

30  In:    serial@10000000

31  Out:   serial@10000000

32  Err:   serial@10000000

33  Net:   eth0: ethernet@16030000, eth1: ethernet@16040000

34  No FDT memory address condivd. Please condiv

35  the FDT address via "fdt addr <address>" command.

36  Aborting!

37  No FDT memory address condivd. Please condiv

38  the FDT address via "fdt addr <address>" command.

39  Aborting!

40  No FDT memory address condivd. Please condiv

41  the FDT address via "fdt addr <address>" command.

42  Aborting!

43  No FDT memory address condivd. Please condiv

44  the FDT address via "fdt addr <address>" command.

45  Aborting!

46  No FDT memory address condivd. Please condiv

47  the FDT address via "fdt addr <address>" command.

48  Aborting!

49  No FDT memory address condivd. Please condiv

50  the FDT address via "fdt addr <address>" command.

51  Aborting!

52  No FDT memory address condivd. Please condiv

53  the FDT address via "fdt addr <address>" command.

54  Aborting!

55  No FDT memory address condivd. Please condiv

56  the FDT address via "fdt addr <address>" command.

57  Aborting!

58  Card did not respond to voltage select! : -110

59  Card did not respond to voltage select! : -110

60  bootmode device 0

61  Card did not respond to voltage select! : -110

62  Hit any key to stop autoboot:  0

63  Card did not respond to voltage select! : -110

64  ** Bad device specification mmc 0 **

65  Couldn't find partition mmc 0:3

66  Can't set block device

67  Importing environment from mmc0 ...

68  ## Warning: Input data exceeds 1048576 bytes - truncated

69  ## Info: input data size = 1048578 = 0x100002

70  Card did not respond to voltage select! : -110

71  ** Bad device specification mmc 0 **

72  Couldn't find partition mmc 0:3

73  Can't set block device

74  ## Warning: defaulting to text format

75  ## Error: "boot2" not defined

76  Card did not respond to voltage select! : -110

77  ethernet@16030000 Waiting for PHY auto negotiation to complete......... TIMEOUT                                                                                                                      !

78  phy_startup() failed: -110FAILED: -110ethernet@16040000 Waiting for PHY auto neg                                                                                                                     otiation to complete......... TIMEOUT !

79  phy_startup() failed: -110FAILED: -110ethernet@16030000 Waiting for PHY auto neg                                                                                                                     otiation to complete......... TIMEOUT !

80  phy_startup() failed: -110FAILED: -110ethernet@16040000 Waiting for PHY auto neg                                                                                                                     otiation to complete......... TIMEOUT !

81  phy_startup() failed: -110FAILED: -110StarFive #

经历过N次失败后,终于在使用官方Debian镜像情况下,成功进入了系统!

扩展分区

1  root@starfive:~# df -h

2  Filesystem      Size  Used Avail Use% Mounted on

3  udev            1.7G     0  1.7G   0% /dev

4  tmpfs           388M  3.2M  385M   1% /run

5  /dev/mmcblk1p4  3.7G  3.0G  760M  80% /

6  tmpfs           1.9G     0  1.9G   0% /dev/shm

7  tmpfs           5.0M   12K  5.0M   1% /run/lock

8  tmpfs           388M   44K  388M   1% /run/user/110

9  tmpfs           388M   24K  388M   1% /run/user/0

10  root@starfive:~# fdisk /dev/mmcblk1

11  

12  Welcome to fdisk (util-linux 2.38.1).

13  Changes will remain in memory only, until you decide to write them.

14  Be careful before using the write command.

15  

16  GPT PMBR size mismatch (8191999 != 122138623) will be corrected by write.

17  The backup GPT table is not on the end of the device. This problem will be corrected by write.

18  This disk is currently in use - repartitioning is probably a bad idea.

19  It's recommended to umount all file systems, and swapoff all swap

20  partitions on this disk.

21  

22  

23  Command (m for help): d

24  Partition number (1-4, default 4): 4

25  

26  Partition 4 has been deleted.

27  

28  Command (m for help): n

29  Partition number (4-128, default 4): 4

30  First sector (34-122138590, default 221184):

31  Last sector, +/-sectors or +/-size{K,M,G,T,P} (221184-122138590, default 122136575):

32  

33  Created a new partition 4 of type 'Linux filesystem' and of size 58.1 GiB.

34  Partition #4 contains a ext4 signature.

35  

36  Do you want to remove the signature? [Y]es/[N]o: N

37  

38  Command (m for help): w

39  

40  The partition table has been altered.

41  Syncing disks.

42  

43  root@starfive:~# resize2fs /dev/mmcblk1p4

44  resize2fs 1.46.6-rc1 (12-Sep-2022)

45  Filesystem at /d[ 3149.655302] EXT4-fs (mmcblk1p4): resizing filesystem from 996091 to 15239424 blocks

46  ev/mmcblk1p4 is mounted on /; on-line resizing required

47  old_desc_blocks = 1, new_desc_blocks = 8

48  [ 3152.269607] EXT4-fs (mmcblk1p4): resized filesystem to 15239424

49  The filesystem on /dev/mmcblk1p4 is now 15239424 (4k) blocks long.

50  

51  root@starfive:~# df -h

52  Filesystem      Size  Used Avail Use% Mounted on

53  udev            1.7G     0  1.7G   0% /dev

54  tmpfs           388M  3.2M  385M   1% /run

55  /dev/mmcblk1p4   58G  3.0G   55G   6% /

56  tmpfs           1.9G     0  1.9G   0% /dev/shm

57  tmpfs           5.0M   12K  5.0M   1% /run/lock

58  tmpfs           388M   44K  388M   1% /run/user/110

59  tmpfs           388M   24K  388M   1% /run/user/0

60  root@starfive:~#

61  

使用命令查看磁盘挂载情况

df -h

根据上述提示完成SD卡的重新分区与扩展空间进行挂载,64G存储卡写完镜像后/dev/mmcblk1p4 只有3.7G,通过以上操作后,充分利用存储卡空间变为58G。

1  注意事项:

2  SD对应 fdisk /dev/mmcblk1         resize2fs /dev/mmcblk1p4  

3  eMMC对应 fdisk /dev/mmcblk0  resize2fs /dev/mmcblk0p4

软件安装

赛昉科技提供的软件仓库:https://github.com/starfive-tech/Debian/releases

最新版本:v0.13.0-engineering-release-wayland - 202405

What's New:

libcamera:

Fix start camera session failure issue on kernel 6.6

Linux :

Support kernel 5.15/6.6 switch at bootmenu

Current List of Packages Provided:

Chromium 103

Clutter-gst

codec (OpenMax)

cogl

FFmpeg

Firefox 105.0

gnome-shell

GStreamer

libcamera-apps

libcamera

Libreoffice 7.5

libsdl2

Mesa

multimedia

Node.js 18.0.0

NW.js

OpenCV

OpenPLC

Qt 5.15.2

v4l2test (CSI camera script)

v8 10.2.154.13

VLC

VF2_Components(5.15/6.6)

软件安装脚本如下:

1  wget https://github.com/starfive-tech/Debian/releases/download/v0.13.0-engineering-release-wayland/install_package_and_dependencies.sh

2  chmod +x install_package_and_dependencies.sh

3  sudo ./install_package_and_dependencies.sh

避免运行apt upgrade

在登录Debian后,在当前状态下,避免运行apt upgrade命令,因为它将覆盖掉赛昉科技提供的现有自定义包。

这里有点小疑问,编译内核是必须要这个版本吗还是最新版本也可以?另外这个编译脚本为啥不放到github,或者是为啥不能预编译好,给脚本安装呢?

1   sudo apt install docker.io

使用以上命令安装Docker后无法正常启动,官方提供的安装示例和脚本又很老和繁琐,建议官方可以参考https://github.com/ophub/amlogic-s9xxx-armbian 制作个一键安装脚本,上面罗列了常用的一些软件,如Docker、HomeAssistant、Openwrt、Qinglong、Jellyfin、Alist、Emby-Server等等。

更新SPL和U-Boot

1  wget https://github.com/starfive-tech/VisionFive2/releases/download/JH7110_VF2_515_v5.12.0/u-boot-spl.bin.normal.out

1  wget https://github.com/starfive-tech/VisionFive2/releases/download/JH7110_VF2_515_v5.12.0/visionfive2_fw_payload.img

1  dd if=u-boot-spl.bin.normal.out of=/dev/mmcblk1p1 conv=fsync

1  dd if=visionfive2_fw_payload.img of=/dev/mmcblk1p2 conv=fsync

后续编译安装Docker,进而尝试安装HomeAssistant或者CasaOS

另一个小疑问,什么情况下需要更新U-boot和SPL,烧录了最新版本的Debian镜像是否还需要更新?支持哪些系统,还有更加便捷的方式吗?这里更新U-boot有点类似路由器更新Breed,电脑更新Bios,在Windos系统下更新比较麻烦,搭建了TFTP服务器但是更新失败……

另外手头没有合适的显示器(没有HDMI接口),系统下预安装一个xrdp用来实现windows系统下访问Debian系统桌面,方便没有显示设备的情况下。后续继续尝试linuxdeepin。

还有就是Armbian镜像因该是基于balbes150大佬原来的脚本自动构建的( VisionFive-2 (jh7110) - RISC-V - Armbian Community Forums ),大佬退坑后现在自动构建的版本需要进行一些修改才能正常启动(方法参照: Vision Five 2上的Armbian Linux (2024.8.29) - 昉·星光 2(中文论坛) - RVspace Forum ),官方是否可以修正构建脚本。