0% found this document useful (0 votes)
40 views

Tutorial V2.0

The document provides a guide for using the Freenove M.2 NVMe Adapter with the Raspberry Pi 5, detailing safety precautions, product support, and instructions for flashing the operating system onto an NVMe SSD. It includes information on required components, optional accessories, and the steps necessary to boot from an SSD. Additionally, it emphasizes the importance of following the tutorial corresponding to the specific board version received.

Uploaded by

totolola
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views

Tutorial V2.0

The document provides a guide for using the Freenove M.2 NVMe Adapter with the Raspberry Pi 5, detailing safety precautions, product support, and instructions for flashing the operating system onto an NVMe SSD. It includes information on required components, optional accessories, and the steps necessary to boot from an SSD. Additionally, it emphasizes the importance of following the tutorial corresponding to the specific board version received.

Uploaded by

totolola
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 56

█ www.freenove.com  support@freenove.

com I

Welcome
Thank you for choosing Freenove products!

Please refer to the tutorial corresponding to the version of our board you received.

If you receive the board as shown in Figure 1, please follow the “Tutorial_V2.0.pdf” (this tutorial) to proceed.

Figure 1
If it is the one like Figure 2, please follow the “Tutorial_V1.0.pdf” under the same folder to operate.

Figure 2

[email protected]
II  [email protected] www.freenove.com █

Get Support and Offer Input

Freenove provides free and responsive product and technical support, including but not limited to:
 Product quality issues
 Product use and build issues
 Questions regarding the technology employed in our products for learning and education
 Your input and opinions are always welcome
 We also encourage your ideas and suggestions for new products and product improvements
For any of the above, you may send us an email to:

[email protected]
Safety and Precautions

Please follow the following safety precautions when using or storing this product:
 Keep this product out of the reach of children under 6 years old.
 This product should be used only when there is adult supervision present as young children lack
necessary judgment regarding safety and the consequences of product misuse.
 This product contains small parts and parts, which are sharp. This product contains electrically conductive
parts. Use caution with electrically conductive parts near or around power supplies, batteries and
powered (live) circuits.
 When the product is turned ON, activated or tested, some parts will move or rotate. To avoid injuries to
hands and fingers, keep them away from any moving parts!
 It is possible that an improperly connected or shorted circuit may cause overheating. Should this happen,
immediately disconnect the power supply or remove the batteries and do not touch anything until it
cools down! When everything is safe and cool, review the product tutorial to identify the cause.
 Only operate the product in accordance with the instructions and guidelines of this tutorial, otherwise
parts may be damaged or you could be injured.
 Store the product in a cool dry place and avoid exposing the product to direct sunlight.
 After use, always turn the power OFF and remove or unplug the batteries before storing.

[email protected]
█ www.freenove.com  [email protected] III

About Freenove

Freenove provides open source electronic products and services worldwide.

Freenove is committed to assist customers in their education of robotics, programming and electronic circuits
so that they may transform their creative ideas into prototypes and new and innovative products. To this end,
our services include but are not limited to:

 Educational and Entertaining Project Kits for Robots, Smart Cars and Drones
 Educational Kits to Learn Robotic Software Systems for Arduino, Raspberry Pi and micro: bit
 Electronic Component Assortments, Electronic Modules and Specialized Tools
 Product Development and Customization Services

You can find more about Freenove and get our latest news and updates through our website:

http://www.freenove.com

Copyright

All the files, materials and instructional guides provided are released under Creative Commons Attribution-
NonCommercial-ShareAlike 3.0 Unported License. A copy of this license can be found in the folder containing
the Tutorial and software files associated with this product.

This means you can use these resource in your own derived works, in part or completely, but NOT for the
intent or purpose of commercial use.

Freenove brand and logo are copyright of Freenove Creative Technology Co., Ltd. and cannot be used without
written permission.

R

Raspberry Pi® is a trademark of Raspberry Pi Foundation (https://www.raspberrypi.org/).

[email protected]
IV  [email protected] www.freenove.com █

Contents
Welcome .................................................................................................................................................................... I
Safety and Precautions............................................................................................................................................................ II
About Freenove ........................................................................................................................................................................ III
Copyright .................................................................................................................................................................................... III
Contents .................................................................................................................................................................. IV
Preface ....................................................................................................................................................................... 1
Overview ................................................................................................................................................................... 3
Caution: Incompatible SSDs ................................................................................................................................. 4
Video Tutorial: https://youtu.be/D8xOiRY3h0c .............................................................................................. 5
1. Flashing OS to SD Card or USB Drive ........................................................................................................ 5
Component List ......................................................................................................................................................................... 5
Optional Components ............................................................................................................................................................. 7
Raspberry Pi OS ......................................................................................................................................................................... 9
Getting Started with Raspberry Pi ..................................................................................................................................... 14
2. Flashing OS to NVME SSD .......................................................................................................................... 23
2.1 Assembly and Wiring ...................................................................................................................................................... 23
2.2 Flashing the RPi OS to NVME SSD ............................................................................................................................. 28
3. Booting from SSD ......................................................................................................................................... 43
3.1 Configuring the Boot Order ......................................................................................................................................... 44
4. Speed Test & PCIe Gen3.0 .......................................................................................................................... 47
4.1 Disk Speed Test ................................................................................................................................................................ 47
4.2 PCIe Gen 3.0 ...................................................................................................................................................................... 50
What's Next? .......................................................................................................................................................... 52

[email protected]
█ www.freenove.com  [email protected] 1

Preface

The Freenove M.2 NVMe Adapter for Raspberry Pi is a solid-state drives adapter designed specifically for the
Raspberry Pi 5. Here are its key features:

 Interface Type: M.2 with M-Key


 Supported Protocol: NVMe
 Compatible Sizes: 2230, 2242, 2260, 2280
 Power Supply: 3.3V, up to 3A (maximum)
 Indicator Lights: Includes both power and SSD status LEDs.

The Raspberry Pi 5 includes a PCIe x1 slot that is certified for PCIe Gen 2.0, providing a theoretical maximum
throughput of 5GT/sec, which roughly translates to 500MB/sec for read and write operations. Although this
slot is not officially certified for PCIe Gen 3.0, it is possible to force the use of Gen 3.0 for potentially higher
speeds.

The PCIe consortium states that the speed of PCIe Gen 3.0 x1 is up to 8GT/sec, which translates to
approximately 985MB/sec; however, Raspberry Pi claims that their implementation can achieve a speed of
10GT/sec, equivalent to around 1231MB/sec.
https://en.wikipedia.org/wiki/PCI_Express#Comparison_table
https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#pcie-gen-3-0

SSDs generally provide significantly faster read and write speeds compared to SD cards and USB drives, which
can notably elevate the user experience when operating the Raspberry Pi 5.

Welcome to the Freenove M.2 NVMe Adapter for Raspberry Pi. This guide will walk you through the steps to
effectively integrate and utilize this adapter on your Raspberry Pi 5.
Additionally, if you encounter any issues or have questions about this tutorial or the contents of kit, you can

[email protected]
2  [email protected] www.freenove.com █

always contact us for free technical support at:

[email protected]

[email protected]
█ www.freenove.com  [email protected] 3

Overview
To boot Raspberry Pi 5 from an NVMe SSD, two core tasks need to be accomplished:
1. Flash the Raspberry Pi's operating system image onto the NVMe SSD.
2. Configure the boot order of Raspberry Pi to give priority to SSD. (Optional)

Analysis

1. First of all, make sure you can enter the Raspberry Pi os via SD card or U drive.
2. After booting the Raspberry Pi, you can use it to flash the OS image directly onto the NVMe SSD.
Alternatively, you can purchase an NVMe SSD to USB adapter and flash the image using USB on Windows
or macOS, much like you would for an SD card or USB drive.
3. With this analysis in mind, we can systematically carry out the necessary steps.

Raspberry Pi models manufactured at different times might not boot up in the same way as described, but
that's okay; just follow our guide to proceed.
There are various ways to burn the Raspberry Pi OS to SSD, each requiring different hardware tools.
Ways Ways of burning Requirements
Use Raspberry Pi to burn the OS. This requires that you can
An SD card or a U disk that can
1 successfully boot up the Raspberry Pi via SD card or U disk.
access the Raspberry Pi OS.
(Recommended, described in this tutorial)
Purchase an NVMe SSD to USB adapter and flash the image NVME SSD to USB adapter (need
2
just like you would with an SD card or USB drive. to be bought separately)
If there are spare M.2 NVME interface on the motherboard of
3 PC with M.2 NVME interface
your PC, you can insert the SSD to it to flash the OS.

[email protected]
4  [email protected] www.freenove.com █

Caution: Incompatible SSDs


The recognition and reading/writing of the NVME SSD are handled by the drivers of the Raspberry Pi 5. The
Freenove M.2 NVMe Adapter for Raspberry Pi (hereinafter referred to as the Adapter) serves to connect and
power the SSD. If you find that your SSD is not recognized or readable/writeable by the Pi 5, please try to find
the drivers suitable for your SSD and install them on the Raspberry Pi, or replace the SSD, or purchase our
Adapter kit that comes with an SSD.

[email protected]
█ www.freenove.com  [email protected] 5

Video Tutorial: https://youtu.be/D8xOiRY3h0c

1. Flashing OS to SD Card or USB Drive


Based on the analysis above, our first step should be to install the Raspberry Pi operating system onto an SD
card or USB drive, with a capacity of at least 16GB. If you are already able to boot the Raspberry Pi using an
SD card or USB drive, you can skip this section and move on to the next chapter.

Component List

Required Components(self-prepared)

Raspberry Pi 5 5V/3A Power Adapter. Note: Different versions of


Raspberry Pi have different power requirements
(please check the power requirements for yours
on the chart in the following page.)

Type-C USB Cable x1 Micro SD Card (TF Card) x1, Card Reader x1

[email protected]
6  [email protected] www.freenove.com █

Power requirements of various versions of Raspberry Pi are shown in following table:


Product Recommended Maximum total USB Typical bare-board
PSU current peripheral current draw active current
capacity consumption
Raspberry Pi Model A 700mA 500mA 200mA
Raspberry Pi Model B 1.2A 500mA 500mA
Raspberry Pi Model A+ 700mA 500mA 180mA
Raspberry Pi Model B+ 1.8A 600mA/1.2A (switchable) 330mA
Raspberry Pi 2 Model B 1.8A 600mA/1.2A (switchable) 350mA
Raspberry Pi 3 Model B 2.5A 1.2A 400mA
Raspberry Pi 3 Model A+ 2.5A Limited by PSU, board, and 350mA
connector ratings only.
Raspberry Pi 3 Model B+ 2.5A 1.2A 500mA
Raspberry Pi 4 Model B 3.0A 1.2A 600mA
Raspberry Pi 5 Model B 5.0A 1.6A (600mA if using a 3A 800mA
power supply)
Raspberry Pi Zero W 1.2A Limited by PSU, board, and 150mA
connector ratings only.
Raspberry Pi Zero 1.2A Limited by PSU, board, and 100mA
connector ratings only
For more details, please refer to
https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#power-supply

In addition, RPi also needs an Ethernet network cable used to connect it to a WAN (Wide Area Network).

All these components are necessary for any of your projects to work. Among them, the power supply of at
least 5V/2.5A, because a lack of a sufficient power supply may lead to many functional issues and even
damage your RPi, we STRONGLY RECOMMEND a 5V/2.5A power supply. We also recommend using a SD
Micro Card with a capacity of 16GB or more (which, functions as the RPI’s “hard drive”) and is used to store
the operating system and necessary operational files.

[email protected]
█ www.freenove.com  [email protected] 7

Optional Components

Under normal circumstances, there are two ways to login to Raspberry Pi: 1) Using a stand-alone monitor. 2)
Using a remote desktop or laptop computer monitor “sharing” the PC monitor with your RPi.

Required Accessories for Monitor

If you choose to use an independent monitor, mouse and keyboard, you also need the following accessories:
1. A display with a HDMI interface
2. A Mouse and a Keyboard with an USB interface

As to Pi Zero and Pi Zero W, you also need the following accessories:


1. A Mini-HDMI to HDMI Adapter and Cable.
2. A Micro-USB to USB-A Adapter and Cable (Micro USB OTG Cable).
3. A USB HUB.
4. USB to Ethernet Interface or USB Wi-Fi receiver.

For different Raspberry Pi Modules, the optional items may vary slightly but they all aim to convert the
interfaces to Raspberry Pi standards.

Pi Zero Pi
Pi Zero Pi A+ Pi 3A+ Pi B+/2B Pi 4B/5B
W 3B/3B+
Monitor Yes (All)
Mouse Yes (All)
Keyboard Yes (All)
Micro-HDMI to HDMI
Yes No Yes No No No No
Adapter & Cable
Micro-HDMI to HDMI
No Yes
Adapter & Cable
Micro-USB to USB-A
Adapter & Cable
Yes No Yes No
(Micro USB OTG
Cable)
USB HUB Yes Yes Yes Yes No No
USB to Ethernet select one from Internal
optional
Interface two or select two Integration Internal Integration
USB Wi-Fi Receiver from two Internal Integration optional

[email protected]
8  [email protected] www.freenove.com █

Required Accessories for Remote Desktop

If you do not have an independent monitor, or if you want to use a remote desktop, you first need to login
to Raspberry Pi through SSH, and then open the VNC or RDP service. This requires the following accessories.

Pi Zero Pi Zero W Pi A+ Pi 3A+ Pi B+/2B Pi


3B/3B+/4B/5B
Micro-USB to USB-A Yes Yes No
Adapter & Cable
(Micro USB OTG
Cable) NO
USB to Ethernet Yes Yes Yes
interface

[email protected]
█ www.freenove.com  [email protected] 9

Raspberry Pi OS

Without Screen - Use Raspberry Pi - under Windows PC: https://youtu.be/XpiT_ezb_7c


With Screen - Use Raspberry Pi - under Windows PC: https://youtu.be/HEywFsFrj3I

Automatically Method

You can follow the official method to install the system for raspberry pi via visiting link below:
https://projects.raspberrypi.org/en/projects/raspberry-pi-setting-up/2
In this way, the system will be downloaded automatically via the application.

Manually Method

After installing the Imager Tool in the link above. You can also download the system manually first.

Visit https://www.raspberrypi.com/software/operating-systems/

Then the zip file is downloaded.

[email protected]
10  [email protected] www.freenove.com █

Write System to Micro SD Card


First, put your Micro SD card into card reader and connect it to USB port of PC.

Open Raspberry Pi Imager.


Choose Raspberry Pi 5 as the device.

Choose the system that you just downloaded in Use custom.

[email protected]
█ www.freenove.com  [email protected] 11

Choose the SD card and click on Next.

[email protected]
12  [email protected] www.freenove.com █

Enable ssh and configure WiFi

Click EDIT SETTINGS.

Configure wireless LAN, enable SSH and click Save.

[email protected]
█ www.freenove.com  [email protected] 13

Wait for it to finish writing and verifying.

Insert SD card

Then remove SD card from card reader and insert it into Raspberry Pi.

[email protected]
14  [email protected] www.freenove.com █

Getting Started with Raspberry Pi

Monitor desktop

If you do not have a spare monitor, please skip to next section Remote desktop & VNC. If you have a spare
monitor, please follow the steps in this section.
After the system is written successfully, take out Micro SD Card and put it into the SD card slot of RPi. Then
connect your RPi to the monitor through the HDMI port, attach your mouse and keyboard through the USB
ports, attach a network cable to the network port and finally, connect your power supply (making sure that it
meets the specifications required by your RPi Module Version. Your RPi should start (power up). Later, after
setup, you will need to enter your user name and password to login. The default user name: pi; password:
raspberry. After login, you should see the following screen.

Congratulations! You have successfully installed the RASPBERRY PI OS operating system on your RPi.

Raspberry Pi 4B, 3B+/3B integrates a Wi-Fi adaptor. You can use it to connect to your Wi-Fi. Then you can
use the wireless remote desktop to control your RPi. This will be helpful for the following work. Raspberry Pi
of other models can use wireless remote desktop through accessing an external USB wireless card.

Connect WiFi

[email protected]
█ www.freenove.com  [email protected] 15

Remote desktop & VNC

If you have logged in Raspberry Pi via display, you can skip to VNC Viewer.

If you don't have a spare display, mouse and keyboard for your RPi, you can use a remote desktop to share
a display, keyboard, and mouse with your PC. Below is how to use:
MAC OS remote desktop and Windows OS remote desktop.
MAC OS Remote Desktop
Open the terminal and type following command. If this command doesn’t work, please move to next page.
ssh [email protected]
The password is raspberry by default, case sensitive.

You may need to type yes during the process.

[email protected]
16  [email protected] www.freenove.com █

You can also use the IP address to log in Pi.


Enter router client to inquiry IP address named “raspberry pi”. For example, I have inquired to my RPi IP
address, and it is “192.168.1.131".

Open the terminal and type following command.


ssh [email protected]
When you see pi@raspberrypi:~ $, you have logged in Pi successfully. Then you can skip to next section.

Then you can skip to VNC Viewer.

[email protected]
█ www.freenove.com  [email protected] 17

Windows OS Remote Desktop


If you are using win10, you can use follow way to login Raspberry Pi without desktop.
Press Win+R. Enter cmd. Then use this command to check IP:
ping -4 raspberrypi.local

Then 192.168.1.147 is my Raspberry Pi IP.


Or enter router client to inquiry IP address named “raspberrypi”. For example, I have inquired to my RPi
IP address, and it is “192.168.1.147".
ssh pi@xxxxxxxxxxx(IP address)
Enter the following command:
ssh [email protected]

[email protected]
18  [email protected] www.freenove.com █

VNC Viewer & VNC


Enable VNC
Type the following command. Select Interface OptionsP3 VNC  EnterYesOK. Here Raspberry Pi may
need be restarted, and choose ok. Then open VNC interface.
sudo raspi-config

[email protected]
█ www.freenove.com  [email protected] 19

Set Resolution
You can also set other resolutions. If you don’t know what to set, you can set it as 1280x720 first.

[email protected]
20  [email protected] www.freenove.com █

Then download and install VNC Viewer according to your computer system by click following link:
https://www.realvnc.com/en/connect/download/viewer/
After installation is completed, open VNC Viewer. Click File  New Connection. Then the interface is shown
below.

Enter ip address of your Raspberry Pi and fill in a name. Then click OK.
Then on the VNC Viewer panel, double-click new connection you just created,

and the following dialog box pops up.

[email protected]
█ www.freenove.com  [email protected] 21

Enter username: pi and Password: raspberry. Click OK.

Here, you have logged in to Raspberry Pi successfully by using VNC Viewer.


If there is black window, please set another resolution.

[email protected]
22  [email protected] www.freenove.com █

In addition, your VNC Viewer window may zoom your Raspberry Pi desktop. You can change it. On your
VNC View control panel, click right key. Select Properties->Options label->Scaling. Then set proper scaling.

Here, you have logged in to Raspberry Pi successfully by using VNC Viewer and operated proper setting.

Raspberry Pi 4B/3B+/3B integrates a Wi-Fi adaptor.If you did not connect Pi to WiFi. You can connect it to
wirelessly control the robot.

[email protected]
█ www.freenove.com  [email protected] 23

2. Flashing OS to NVME SSD

2.1 Assembly and Wiring

Assemble the Freenove M.2 Adapter for Raspberry Pi and NVME SSD to your Raspberry Pi.

Required Components

Raspberry Pi 5 Power Adapter.

Type-C USB Cable x1 Micro SD Card (TF Card) x1, Card Reader x1

Freenove M.2 Adapter for Raspberry Pi NVME SSD

M2.5x3 Screws x5 M2.5*8+3 single-pass brass Cable


standoffs x8

[email protected]
24  [email protected] www.freenove.com █

The Freenove M.2 NVMe Adapter for Raspberry Pi can be assembled either above or below the Raspberry Pi
5. You can install it in the way you prefer.

Assembling above the Raspberry Pi 5

1. Connect the cable to Raspberry Pi 5.

2. Combine two M2.5×8+3 single-pass brass standoffs into a stacked pair, prepare four such assemblies,
and install them onto each mounting holes on the rear side of the expansion board.

3. Connect the other end of the cable to adapter board.

[email protected]
█ www.freenove.com  [email protected] 25

4. Install the adapter board on top of the Raspberry Pi 5, and secure it from below the Raspberry Pi 5
using M2.5x3 screws.

5. Insert the SSD to the adapter board. Please tilt it to insert.

6. Fix the SSD with a M2.5 screw.

[email protected]
26  [email protected] www.freenove.com █

Assembling below the Raspberry Pi 5

1. Connect the cable to Raspberry Pi 5.

2. Insert the SSD to the adapter board. Please tilt it to insert.

3. Fix the SSD with a M2.5 screw.

[email protected]
█ www.freenove.com  [email protected] 27

4. Install one M2.5*8+3 single-pass brass standoffs onto each mounting holes on the front side of the
adapter board.

5. Assemble the adapter board below the Raspberry Pi 5, and secure it with M2.5x3 screws.

6. Connect the other end of the cable to the adapter board.

[email protected]
28  [email protected] www.freenove.com █

2.2 Flashing the RPi OS to NVME SSD

Once everything is set up, power on the Raspberry Pi and boot into the system. (In this case, we are using a
brand new SSD with a 512GBits capacity that has not been partitioned yet.)

2.2.1 SSD Detection

( Note: Not all SSDs are supported by Pi5. )


Run the following command in the Terminal to check whether SSD is detected.
Note that different SSDs display different content.
lspci

lsblk

As shown in the figure above, the device ‘nvme0n1’ with a capacity of 476.9GBytes shows up, indicating that
the SSD has been correctly recognized. The detected capacity will depend on the size of your SSD. If your
drive has been previously partitioned, you may also see some partition information displayed.

Please note: Installing the system will format the SSD, erasing all data. If necessary, please back up any
data on your SSD before proceeding.

[email protected]
█ www.freenove.com  [email protected] 29

2.2.2 Enable PCIE3.0 (on OS written into SD card)

If the SSD you received is with Phison controller, you may need to enable PCIE 3.0 .(This step is strongly
recommended; without this step, the later process may fail.)
If it is not with Phison controller, you do not need to enable PCIE 3.0. You may skip this section.
Run the command lspci to check the controller.

(The above screenshot is the result of a 128GB SSD with Phison as main controller.)
Enable PCIe Gen3.0
Add the line dtparam=pciex1_gen=3 to /boot/firmware/config.txt to enable PCIe Gen3.0.
As shown below, enter the command to open the file.
sudo nano /boot/firmware/config.txt
Add the line dtparam=pciex1_gen=3 to the end of the file, as shown below:

Press Ctrl-O to save the file, Enter to confirm, and Ctrl-X to exit.

Reboot your Raspberry Pi.


sudo reboot

[email protected]
30  [email protected] www.freenove.com █

2.2.3 SSD Partitioning and Formatting

This step is not a must-do, but it can further test whether the SSD perform normally on Raspberry Pi to
ensure smooth performance in later steps.
At this point, the hard drive cannot be seen in the file manager, as the disk has not been partitioned yet.

Install a disk management tool with the following command:


sudo apt-get install gparted

Open gparted with the command:


sudo gparted

[email protected]
█ www.freenove.com  [email protected] 31

Click on the dropdown menu in the upper right corner and switch to NVME SSD.

[email protected]
32  [email protected] www.freenove.com █

Click Device on the menu bar and select Create Partition Table.

You will see the prompt that data will be erased. It is recommended to select gpt for partition table type. Click
Apply.

[email protected]
█ www.freenove.com  [email protected] 33

Click Partition on the menu bar, choose New.

As shown in the figure below, the size of partition can be adjusted by dragging the mouse left and right, or
by entering the size directly. The other options can be left as default setting. Here, we allocate all the capacity
to a single partition. Click on Add.

[email protected]
34  [email protected] www.freenove.com █

Click the check icon to save the partition just built, as illustrated below.

Click on Apply.

Wait for it to complete and click on Close.

[email protected]
█ www.freenove.com  [email protected] 35

[email protected]
36  [email protected] www.freenove.com █

At this point, you can mount the disk using the mount command and then access the disk space through the
file manager. Use the following command to mount the SSD:
mkdir pi
sudo mount /dev/nvme0n1p1 /media/pi

Open the file manager, as shown below.

If you plan to use the SSD as a standard storage device, you can conclude the process here. However, if you
want to further proceed with installing an operating system on the SSD, please read on.

[email protected]
█ www.freenove.com  [email protected] 37

2.2.4 Flashing the OS

Install the OS to SSD with the method similar to that in the previous section on installing a system onto an SD
card. This time, operate on the Raspberry Pi.
Install rpi-imager with the following command:
sudo apt install rpi-imager

Open rpi-imager:
sudo rpi-imager

[email protected]
38  [email protected] www.freenove.com █

By this point, you should be quite familiar with the process.

Select the Raspberry Pi 5 as your device and choose either an online download or an offline file for the
operating system; in this case, an offline file is selected. (It is recommended to use a 64-bit Raspberry Pi
system with recommended software). Choose your NVME SSD as the storage device. Click NEXT.

Click on EDIT SETTINGS.

Wireless LAN Country must be correctly set; otherwise, it may fail to search the WiFi.
Enable SSH and click Save.

[email protected]
█ www.freenove.com  [email protected] 39

Click on YES.

Click on YES.

Wait for it to finish.

[email protected]
40  [email protected] www.freenove.com █

Congratulations! You have done the trickiest and the time-consuming part. Now that you have successfully
installed the operating system onto the NVMe SSD, you are very close to achieving a triumph.

Next, boot into the system from SSD.

[email protected]
█ www.freenove.com  [email protected] 41

2.2.5 Enable PCIE3.0 (on system written into SSD)

If you have confirmed that SSD is with Phison controller in step 2, then you also need to enable PCIE3.0 on the
system written into SSD.
If the controller of your SSD is not from Phison, you can skip this section.

The operation is as below:


1. Run the command lsblk to check the partitions of the SSD with Raspberry Pi OS written, as shown below:

(The above screenshot is the result of a 128GB SSD with Phison as main controller.)

Run the following commands one by one to mount partition 1 of the SSD to the directory of /media/pi.
sudo mkdir /media/pi
sudo mount /dev/nvme0n1p1 /media/pi

If it mounts successfully, you’ll see the following disk icon on the desktop.

Open and modify the config.txt file with the following command.
sudo nano /media/pi/config.txt

Add the line dtparam=pciex1_gen=3 to the end of the file, as shown below:

[email protected]
42  [email protected] www.freenove.com █

Press Ctrl-O to save the file, Enter to confirm, and Ctrl-X to exit.

[email protected]
█ www.freenove.com  [email protected] 43

3. Booting from SSD


After finishing flashing the OS to SSD, shutdown Raspberry Pi, remove the power supply, and remove the SD
card. Then connect the power, the Raspberry Pi will boot from SSD.

The default boot order of Raspberry Pi is SD card  SSD  USB, Therefore, when the SD card is removed,
the Raspberry Pi cannot detect the SD card, it will boot from SSD. By far, the Raspberry Pi can boot successfully
from NVME SSD.

If you want the Raspberry Pi to boot from the SSD first, please continue with the following steps to modify
the boot order. The boot order is saved in the Pi’s EEPROM, so it does not matter whether you modify the
boot order on SD card system or SSD system.

If you do not want to change the boot order, please skip this chapter.

[email protected]
44  [email protected] www.freenove.com █

3.1 Configuring the Boot Order

Type the following command in the Terminal.


sudo raspi-config

Using the keyboard's arrow keys and the Enter key, select the options in sequence.
”6 Advanced Options” ”A4 Boot Order””B2 NVME/USB Boot …”

[email protected]
█ www.freenove.com  [email protected] 45

Select “OK””Finish””Yes”, and reboot your Raspberry Pi.

At this point, upon restarting, the Raspberry Pi will boot from the NVME SSD first. If you are using an external
monitor, you will see that the Raspberry Pi has booted up correctly. If your SD card is still inserted, you will
also see an icon on the desktop as shown below.
With this, the process of booting the Raspberry Pi from the NVME SSD has been fully completed.

[email protected]
46  [email protected] www.freenove.com █

If you use VNC viewer, you will need to repeat the previous steps to activate the VNC service, as it is not yet
enabled in the new system on the SSD. Here, we take Windows as an example.
Run the following command:
ssh [email protected]

Once successfully ssh into Raspberry Pi, run the following command to open the configuration and enable
VNC.
sudo raspi-config
Select “3 Interface Options””I2 VNC””Yes””Finish”.

Now you should be able to access Raspberry Pi via VNC.

[email protected]
█ www.freenove.com  [email protected] 47

4. Speed Test & PCIe Gen3.0


The Raspberry Pi 5 includes a PCIe x1 slot that is certified for PCIe Gen 2.0, providing a theoretical maximum
throughput of 5GT/sec, which roughly translates to 500MB/sec for read and write operations. Although this
slot is not officially certified for PCIe Gen 3.0, it is possible to force the use of Gen 3.0 for potentially higher
speeds.

In actual tests, it is found that most SSDs can work stably at PCIE2.0, but are slightly unstable at PCIE3.0, while
others are just the opposite. Therefore, please choose PCIE2.0 or PCIE3.0 according to your actual situation.

The PCIe consortium states that the speed of PCIe Gen 3.0 x1 is up to 8GT/sec, which translates to
approximately 985MB/sec; however, Raspberry Pi claims that their implementation can achieve a speed of
10GT/sec, equivalent to around 1231MB/sec.
https://en.wikipedia.org/wiki/PCI_Express#Comparison_table
https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#pcie-gen-3-0

4.1 Disk Speed Test

This is an additional chapter for those who wish to test the read and write speeds of their SSD.

Open the terminal and enter the following command:


git clone https://github.com/TheRemote/PiBenchmarks

Enter the directory:


cd PiBenchmarks/
Grant executable permissions to the script:
chmod +x Storage.sh

[email protected]
48  [email protected] www.freenove.com █

Start the speed test. Please be aware that the first execution will involve downloading the required
dependencies, so the process could take a relatively long time.
sudo ./Storage.sh ~/

After the speed test is completed, follow the prompts to enter a description and a name for your SSD (you
can use any arbitrary characters).

Test result:

[email protected]
█ www.freenove.com  [email protected] 49

The performance varies among different SSDs, and each test may have certain error, which is normal. The
following image shows the speed test results for another SSD:

This is a speed test result for a TF (microSD) card, and it shows a significant difference in speed compared to
an SSD.

[email protected]
50  [email protected] www.freenove.com █

4.2 PCIe Gen 3.0

In the Preface, it is mentioned that the Raspberry Pi's PCIe Gen 3.0 has not been officially certified. While it is
functional, its performance is not as reliable as desired. This chapter is presented as an exploratory section for
assessing the speed capabilities of SSDs when used with PCIe Gen 3.0. For practical applications, it is advised
to opt for PCIe Gen 2.0 to ensure greater stability and dependability.
EnablePCIe Gen3.0
Add the line dtparam=pciex1_gen=3 to /boot/firmware/config.txt to enable PCIe Gen3.0.
As shown below, enter the command to open the file.
sudo nano /boot/firmware/config.txt
Add the line dtparam=pciex1_gen=3 to the end of the file, as shown below:

Press Ctrl-O to save the file, Enter to confirm, and Ctrl-X to exit.

Reboot your Raspberry Pi.


sudo reboot

After rebooting, test the speed again.

The speed of another SSD.

[email protected]
█ www.freenove.com  [email protected] 51

Disable PCIe Gen3.0


Delete the line added with the previous step to disable PCIe Gen3.0.
Delete the line dtparam=pciex1_gen=3 in the boot/firmware/config.txt file.
After the line is removed, it will change to PCIe Gen2.0.

[email protected]
52  [email protected] www.freenove.com █

What's Next?
THANK YOU for participating in this learning experience! If you have completed all of the projects successfully,
you can consider yourself a Raspberry Pi Master.

We have reached the end of this Tutorial. If you find errors, omissions or you have suggestions and/or
questions about the Tutorial or component contents of this Kit, please feel free to contact us:
[email protected]
We will make every effort to make changes and correct errors as soon as feasibly possible and publish a
revised version.

If you are interesting in processing, you can study the Processing.pdf in the unzipped folder.

If you want to learn more about Arduino, Raspberry Pi, Smart Cars, Robotics and other interesting products
in science and technology, please continue to visit our website. We will continue to launch fun, cost-effective,
innovative and exciting products.
http://www.freenove.com/

Thank you again for choosing Freenove products.

[email protected]

You might also like