{"id":4461,"date":"2022-08-22T17:56:36","date_gmt":"2022-08-22T22:56:36","guid":{"rendered":"https:\/\/dev.iachieved.it\/iachievedit\/?p=4461"},"modified":"2024-09-02T13:01:36","modified_gmt":"2024-09-02T18:01:36","slug":"getting-started-with-starfive-visionfive","status":"publish","type":"post","link":"https:\/\/dev.iachieved.it\/iachievedit\/getting-started-with-starfive-visionfive\/","title":{"rendered":"Getting Started with StarFive VisionFive"},"content":{"rendered":"<p>I&#8217;ve been excited to get my hands on a <a href=\"https:\/\/ameridroid.com\/products\/visionfive-starfive\">StarFive VisionFive<\/a> and it finally arrived last week after being on backorder since late March of 2022.  Unlike the <a href=\"https:\/\/dev.iachieved.it\/iachievedit\/an-introduction-to-the-hifive-rev-b-and-risc-v\/\">HiFive<\/a> which runs OSes suitable for a microcontroller, the VisionFive will boot into a fully functional <a href=\"https:\/\/getfedora.org\/\">Fedora<\/a> distribution with the <a href=\"https:\/\/www.xfce.org\/\">Xfce<\/a> desktop environment.<\/p>\n<p><a href=\"https:\/\/dev.iachieved.it\/iachievedit\/wp-content\/uploads\/2022\/08\/visionfive.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/dev.iachieved.it\/iachievedit\/wp-content\/uploads\/2022\/08\/visionfive.png\" alt=\"\" width=\"640\" height=\"392\" class=\"aligncenter size-full wp-image-4473\" srcset=\"https:\/\/dev.iachieved.it\/iachievedit\/wp-content\/uploads\/2022\/08\/visionfive.png 640w, https:\/\/dev.iachieved.it\/iachievedit\/wp-content\/uploads\/2022\/08\/visionfive-300x184.png 300w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>To get started with the VisionFive you&#8217;ll need<\/p>\n<ul>\n<li>a microSD Card (at least 16GB, preferably a lot more)\n<li>USB-C Power Supply (like one used for a Raspberry Pi 4)\n<li>Keyboard and Mouse\n<li>Monitor\n<li>HDMI cable\n<\/ul>\n<p>If you&#8217;ve never booted up a BeagleBone or Raspberry Pi &#8220;from scratch&#8221;, head on over to the <a href=\"https:\/\/rvspace.org\/en\/Product\/VisionFive\/Technical_Documents\/VisionFive_Single_Board_Computer_Quick_Start_Guide\">VisionFive Quick Start Guide<\/a> for a gentler introduction.<\/p>\n<p>The Fedora image for the VisionFive can be found on <a href=\"https:\/\/github.com\/starfive-tech\/Fedora_on_StarFive\">Github<\/a>.  For whatever reason the download of the image kept stalling in Safari, so I resorted to using <code>curl<\/code>:<\/p>\n<pre class=\"lang:default decode:true \" >\r\ncurl https:\/\/fedora.starfivetech.com\/pub\/downloads\/VisionFive-release\/Fedora-riscv64-jh7100-developer-xfce-Rawhide-20211226-214100.n.0-sda.raw.zst -O\r\n<\/pre>\n<p>The image is compressed with <a href=\"https:\/\/en.wikipedia.org\/wiki\/Zstd\">Zstandard<\/a>.  Compressed it is around 3.5 gigabytes. Uncompressed it is around 13G.  Once you&#8217;ve downloaded the file, go ahead and verify its integrity with <code>sha256sum<\/code>:<\/p>\n<pre class=\"lang:default decode:true \" >\r\nsha256sum Fedora-riscv64-jh7100-developer-xfce-Rawhide-20211226-214100.n.0-sda.raw.zst\r\n94c73c967e12c80192d7bf25147badd9f0ee1738dc9800d1c502f376df5d5e2f  Fedora-riscv64-jh7100-developer-xfce-Rawhide-20211226-214100.n.0-sda.raw.zst\r\n<\/pre>\n<p>The checksum for the 20211226 image is <code>94c73c967e12c80192d7bf25147badd9f0ee1738dc9800d1c502f376df5d5e2f<\/code>.  Now, decompress it:<\/p>\n<pre class=\"lang:default decode:true \" >\r\nzstd -d Fedora-riscv64-jh7100-developer-xfce-Rawhide-20211226-214100.n.0-sda.raw.zst\r\n<\/pre>\n<p>On macOS we&#8217;ll use <code>diskutil<\/code> and <code>dd<\/code> to write the image.  If the microSD is mounted after inserting it, unmount it with <code>diskutil unmountDisk<\/code>.  On my machine the SD card is presented as disk4.  <b>Always<\/b> verify where your disk is mounted before using <code>dd<\/code>!<\/p>\n<pre class=\"lang:default decode:true \" >\r\n\/dev\/disk4 (external, physical):\r\n   #:                       TYPE NAME                    SIZE       IDENTIFIER\r\n   0:     FDisk_partition_scheme                        *16.0 GB    disk4\r\n   1:             Windows_FAT_32 boot                    58.7 MB    disk4s1\r\n   2:                      Linux                         16.0 GB    disk4s2\r\n\r\ndiskutil unmountDisk \/dev\/disk4\r\n<\/pre>\n<p>Now, let&#8217;s write the image to the disk.  Take note here that we&#8217;re using <code>\/dev\/rdisk4<\/code>, i.e., the &#8220;raw&#8221; disk.<\/p>\n<pre class=\"lang:default decode:true \" >\r\nsudo time dd if=Fedora-riscv64-jh7100-developer-xfce-Rawhide-20211226-214100.n.0-sda.raw of=\/dev\/rdisk4 bs=1g \r\n<\/pre>\n<p>Once your disk is written insert it into the VisionFive and boot it up!  I found that having all of the peripherals (keyboard, mouse, monitor, and Ethernet cable) is the best way to go.  Be patient, this board is not as snappy as a Pi 4.  But, in a few minutes you&#8217;ll be presented with a login screen.  The default user is <code>riscv<\/code> and the password is <code>starfive<\/code>.<\/p>\n<p><a href=\"https:\/\/dev.iachieved.it\/iachievedit\/wp-content\/uploads\/2022\/08\/visionfive-1.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/dev.iachieved.it\/iachievedit\/wp-content\/uploads\/2022\/08\/visionfive-1.png\" alt=\"\" width=\"640\" height=\"360\" class=\"aligncenter size-full wp-image-4483\" srcset=\"https:\/\/dev.iachieved.it\/iachievedit\/wp-content\/uploads\/2022\/08\/visionfive-1.png 640w, https:\/\/dev.iachieved.it\/iachievedit\/wp-content\/uploads\/2022\/08\/visionfive-1-300x169.png 300w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<h2>Setting Your Timezone<\/h2>\n<p>After booting Fedora I noticed the date was in the future.  Typing <code>date<\/code> at the command line resulted in <code>Mon Aug 22 04:52:18 AM CST 2022<\/code>.  Well, I&#8217;m in <code>America\/Chicago<\/code> but why is that still ahead?  Big dummy.  <code>CST<\/code> in this context is <code>Asia\/Shanghai<\/code>.<\/p>\n<p>Easily fixed with:<\/p>\n<pre class=\"lang:default decode:true \" >\r\ntimedatectl set-timezone &quot;America\/Chicago&quot;\r\n<\/pre>\n<h2>Resize Your Root Partition<\/h2>\n<p>After booting your VisionFive you might notice that the root partition is smaller than the actual microSD size.  In this example we&#8217;re using a 16GB microSD, but the root partition is only 11.4G.  We can fix that!  Using these <a href=\"https:\/\/dev.iachieved.it\/iachievedit\/expanding-your-beaglebone-microsd-filesystem\/\">general instructions<\/a> we can resize the root partition without rebooting.<\/p>\n<pre class=\"lang:default decode:true \" >\r\n[riscv@fedora-starfive ~]$ sudo fdisk -l\r\nDisk \/dev\/mmcblk0: 14.92 GiB, 16022241280 bytes, 31293440 sectors\r\nUnits: sectors of 1 * 512 = 512 bytes\r\nSector size (logical\/physical): 512 bytes \/ 512 bytes\r\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\r\nDisklabel type: dos\r\nDisk identifier: 0xae0e1c91\r\n\r\nDevice         Boot   Start      End  Sectors  Size Id Type\r\n\/dev\/mmcblk0p2        69632   319487   249856  122M  c W95 FAT32 (LBA)\r\n\/dev\/mmcblk0p3 *     319488  1320959  1001472  489M 83 Linux\r\n\/dev\/mmcblk0p4      1320960 25319423 23998464 11.4G 83 Linux\r\n<\/pre>\n<pre class=\"lang:default decode:true \" >\r\n[riscv@fedora-starfive ~]$ sudo fdisk \/dev\/mmcblk0\r\n\r\nWelcome to fdisk (util-linux 2.36.1).\r\nChanges will remain in memory only, until you decide to write them.\r\nBe careful before using the write command.\r\n\r\nCommand (m for help): p\r\nDisk \/dev\/mmcblk0: 14.92 GiB, 16022241280 bytes, 31293440 sectors\r\nUnits: sectors of 1 * 512 = 512 bytes\r\nSector size (logical\/physical): 512 bytes \/ 512 bytes\r\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\r\nDisklabel type: dos\r\nDisk identifier: 0xae0e1c91\r\n\r\nDevice         Boot   Start      End  Sectors  Size Id Type\r\n\/dev\/mmcblk0p2        69632   319487   249856  122M  c W95 FAT32 (LBA)\r\n\/dev\/mmcblk0p3 *     319488  1320959  1001472  489M 83 Linux\r\n\/dev\/mmcblk0p4      1320960 25319423 23998464 11.4G 83 Linux\r\n\r\nCommand (m for help): d\r\nPartition number (2-4, default 4): 4\r\n\r\nPartition 4 has been deleted.\r\n\r\nCommand (m for help): n\r\nPartition type\r\n   p   primary (2 primary, 0 extended, 2 free)\r\n   e   extended (container for logical partitions)\r\nSelect (default p): p\r\nPartition number (1,4, default 1): 4\r\nFirst sector (2048-31293439, default 2048): 1320960\r\nLast sector, +\/-sectors or +\/-size{K,M,G,T,P} (1320960-31293439, default 31293439):\r\n\r\nCreated a new partition 4 of type &#039;Linux&#039; and of size 14.3 GiB.\r\nPartition #4 contains a ext4 signature.\r\n\r\nDo you want to remove the signature? [Y]es\/[N]o: N\r\n\r\nCommand (m for help): w\r\n\r\nThe partition table has been altered.\r\nSyncing disks.\r\n<\/pre>\n<p>Now use <code>resize2fs<\/code> on <code>\/dev\/mmcblk0p4<\/code>:<\/p>\n<pre class=\"lang:default decode:true \" >\r\n[riscv@fedora-starfive ~]$ sudo resize2fs \/dev\/mmcblk0p4\r\nresize2fs 1.45.6 (20-Mar-2020)\r\nFilesystem at \/dev\/mmcblk0p4 is mounted on \/; on-line resizing required\r\nold_desc_blocks = 2, new_desc_blocks = 2\r\nThe filesystem on \/dev\/mmcblk0p4 is now 3746560 (4k) blocks long.\r\n<\/pre>\n<h2>Impressions<\/h2>\n<p>The StarFive VisionFive is <i>really<\/i> cool.  While not exactly usable as a daily driver and a bit sluggish compared to the Raspberry Pi, it is a fully-functional desktop computer with a dual-core RISC-V chip on it.  I continue to be excited about the future of RISC-V as an open alternative to x86 or ARM.  Two years ago I was tinkering with RISC-V with the equivalent of an Arduino Duo.  Today there are RISC-V-based SBCs running full-featured Linux. The Fedora distribution for the VisionFive has a lot of packages installed, including the <code>gcc<\/code> and <code>g++<\/code> compilers, Perl, Python, Ruby, Lua, and even Go.  Indeed, it is only a matter of time before one begins seeing other languages like NodeJS (we know, it&#8217;s not a language), Swift, Rust, and Racket.  Exciting times!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been excited to get my hands on a StarFive VisionFive and it finally arrived last week after being on backorder since late March of 2022. Unlike the HiFive which runs OSes suitable for a microcontroller, the VisionFive will boot into a fully functional Fedora distribution with the Xfce desktop environment. To get started with [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":4483,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[112],"class_list":["post-4461","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-risc-v","tag-risc-v-linux"],"_links":{"self":[{"href":"https:\/\/dev.iachieved.it\/iachievedit\/wp-json\/wp\/v2\/posts\/4461"}],"collection":[{"href":"https:\/\/dev.iachieved.it\/iachievedit\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dev.iachieved.it\/iachievedit\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dev.iachieved.it\/iachievedit\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dev.iachieved.it\/iachievedit\/wp-json\/wp\/v2\/comments?post=4461"}],"version-history":[{"count":25,"href":"https:\/\/dev.iachieved.it\/iachievedit\/wp-json\/wp\/v2\/posts\/4461\/revisions"}],"predecessor-version":[{"id":5087,"href":"https:\/\/dev.iachieved.it\/iachievedit\/wp-json\/wp\/v2\/posts\/4461\/revisions\/5087"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dev.iachieved.it\/iachievedit\/wp-json\/wp\/v2\/media\/4483"}],"wp:attachment":[{"href":"https:\/\/dev.iachieved.it\/iachievedit\/wp-json\/wp\/v2\/media?parent=4461"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dev.iachieved.it\/iachievedit\/wp-json\/wp\/v2\/categories?post=4461"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dev.iachieved.it\/iachievedit\/wp-json\/wp\/v2\/tags?post=4461"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}