Tutorial V2.0
Tutorial V2.0
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 █
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 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
[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:
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 █
█ [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 █
█ [email protected]
█ www.freenove.com [email protected] 5
Component List
Required Components(self-prepared)
Type-C USB Cable x1 Micro SD Card (TF Card) x1, Card Reader x1
[email protected] █
6 [email protected] www.freenove.com █
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.
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
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 █
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.
█ [email protected]
█ www.freenove.com [email protected] 9
Raspberry Pi OS
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/
[email protected] █
10 [email protected] www.freenove.com █
█ [email protected]
█ www.freenove.com [email protected] 11
[email protected] █
12 [email protected] www.freenove.com █
█ [email protected]
█ www.freenove.com [email protected] 13
Insert SD card
Then remove SD card from card reader and insert it into Raspberry Pi.
[email protected] █
14 [email protected] www.freenove.com █
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
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.
[email protected] █
16 [email protected] www.freenove.com █
█ [email protected]
█ www.freenove.com [email protected] 17
[email protected] █
18 [email protected] www.freenove.com █
█ [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,
█ [email protected]
█ www.freenove.com [email protected] 21
[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
Assemble the Freenove M.2 Adapter for Raspberry Pi and NVME SSD to your Raspberry Pi.
Required Components
Type-C USB Cable x1 Micro SD Card (TF Card) x1, Card Reader x1
[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.
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.
█ [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.
[email protected] █
26 [email protected] www.freenove.com █
█ [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.
[email protected] █
28 [email protected] www.freenove.com █
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.)
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
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.
[email protected] █
30 [email protected] www.freenove.com █
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.
█ [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
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.
█ [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
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
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 █
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.
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.
[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.
█ [email protected]
█ www.freenove.com [email protected] 41
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 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
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 █
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
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”.
█ [email protected]
█ www.freenove.com [email protected] 47
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
This is an additional chapter for those who wish to test the read and write speeds of their SSD.
[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 █
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.
█ [email protected]
█ www.freenove.com [email protected] 51
[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/