PCIe TO ETH M.2 HAT+

From Waveshare Wiki
Jump to: navigation, search
PCIe TO ETH M.2 HAT+
RPi Touch Keypad
{{{name2}}}

{{{name3}}}

{{{name4}}}

{{{name5}}}

{{{name6}}}

Overview

Introduction

PCIe to Gigabit Ethernet and M.2 adapter board is specifically designed for Raspberry Pi 5, expands M.2 hard drives and Gigabit Ethernet ports in 2230 / 2242 / 2260 / 2280 sizes. It supports Gen2 mode only, and supports booting PI5 from SSD

Features

  • Supports NVMe protocol M.2 interface hard drives, featuring high-speed read and write, and high work efficiency
  • Only supports PCI-E×1 Gen2 mode
  • Only supports PI5B
  • Compatible with M.2 hard drives of 2230 / 2242 / 2260 / 2280 sizes
  • Onboard operational indicator lights, the PWR is continuously lit when powered on, and the ACT blinks during read and write operations, making the operational status easily visible
  • Network port working indicator, green light blinks if using Gigabit network port, yellow light blinks if using 100 Gigabit network port.

Note

  • Raspberry Pi does not support NVME boot by default, and the boot needs to be modified

Instructions for Use

Hardware connection

Pay attention to the direction of the cable, and the connection is shown in the figure:
PCIe-TO-ETH-M.2-HAT-Plus-details-3 (1).jpg

Mount

1. Enable PCIE interface

PI5B defaults to not having the PCIE interface enabled. Add to /boot/firmware/config.txt:
dtparam=pciex1

2. The module only supports PCIE gen2 x1

3. After the modification, restart the PI5, and the device can be recognized.

As shown in the figure, two SN580s were identified as my SSD solid-state drives, and the other PI5 is an RPI chip
PCIe-TO-2-CH-M.2-HAT-Plus-1-1.png

4. Partition, skip this step if you have partitioned and formatted on other platforms (Note: partitioning will delete all data on the SSD, proceed with caution)

Lsblk     This command is executed to view the disk (if you want to see the details, run the sudo fdisk -l command)
PCIe TO M.2 HAT+ W 2.png
Partition: 
sudo fdisk /dev/nvme0n1    The device number is the total device number, do not add p1, that is just a partition
How to use the partitioning tool fdisk:
N New partition
q Quit without saving
p Print the partition table
m Print the selection menu
D Delete the partition
w Save and exit
t Modify the ID number
Add the partition and execute n, then save and exit with w

5. Format

sudo mkfs.     Execute the command and press Tab key, you will see a lot of different suffixes, and the different suffixes are the format you need to format
PCIe TO M.2 HAT+ W 3.png
If I want to format it in ext4 file format, then execute the command:
sudo mkfs.ext4 /dev/nvme0n1p1
Wait a moment, once all “done” appear as below, it indicates that the formatting is completed
PCIe TO M.2 HAT+ W 4.png

6. Mount

Create a mount directory
sudo mkdir toshiba
Mount the device
sudo mount /dev/nvme0n1p1 ./toshiba
Check the disk status
df -h

Read/Write test

Enter the directory where the disk is mounted

cd toshiba
  • Free up the memory
sudo sh -c "sync && echo 3 > /proc/sys/vm/drop_caches"
  • Copy Raspberry Pi memory content to the hard disk (write)
sudo dd if=/dev/zero of=./test_write count=2000 bs=1024k

PCIe TO M.2 HAT+ W 5.png

  • Copy the hard drive content to the Raspberry Pi memory (/etc/fstab read )
 sudo dd if=./test_write of=/dev/null count=2000 bs=1024k

Pcie-m2-6new.png

  • Note: The test results vary for different cards and environments. The Raspberry Pi is significantly affected. If you want to test accurate performance, use a PC for the test

Auto mount

Test shows there's no issue. If it's not required to be used as a system disk, but only for expanding the disk, set it to auto-mount

sudo nano /etc/fstab

#Add at the end
/dev/nvme0n1p1  /home/pi/toshiba  ext4  defaults  0  0
#/dev/nvme0n1p1 is the device name, /home/pi/toshiba refers to mounting to a directory, ext4 is the file system type, defaults uses the default mount option
#Make the changes take effect (reboot only after testing, otherwise it will fail to mount and boot)
sudo mount -a

#Then reboot
Check the device with lsblk

NVMe SSD boot

Boot the Raspberry Pi with a TF card first, mount and test it, and make sure the hardware can work properly

1. Modify the BOOT_ORDER in the Raspberry Pi boot loader configuration:

sudo rpi-eeprom-config --edit 

Add:

NVME_CONTROLLER=1

Modify:

BOOT_ORDER=0xf41  改为  BOOT_ORDER=0xf416
PCIe TO M.2 HAT+ W 6.png
For more information, please refer to BOOT_ORDER 

2. Reboot Raspberry Pi

If you find you can't modify it multiple times, please reconnect to the network and then try to modify it (wait for the network to self-calibrate), or modify the file after setting the correct time

3. Flash the system to NVME, then connect the NVME to the expansion board, remove the TF card and power it on again


PCIe network card

1. Execute ifconfig to check if the network card is recognized

PCIe-TO-Gigabit-ETH-Board-C-1-2.png

2. Use the ping command to test

ping baidu.com -I eth1
#-I Specify the network port
PCIe-TO-Gigabit-ETH-Board-C-1-3.png


Other systems

If you do not use the Raspberry Pi OS and use other Raspberry Pi supported systems, you may have the problem that PCIE can be recognized, but the corresponding network card will not appear

The kernel needs to be recompiled

Device Drivers
 > Network device support
   > Ethernet driver support
     > Realtek devices
       > Realtek 8169/8168/8101/8125 ethernet support

You can also download the driver directly and install it (the probability of failure is high, so it is not recommended)

NVME power monitoring

The onboard INA219 chip can detect voltage and current, making it convenient for monitoring device status. It monitors the input 5V voltage status (not 3.3V)

Default I2C1 address is 0x40, which can be modified by adjusting the backside resistor to support the stacking of different expansion boards

Enable I2C

sudo nano /boot/firmware/config.txt 
Add
dtparam=i2c_arm=on

Or

sudo raspi-config
Find Interface Options -> I2C -> Yes

Demo

wget https://files.waveshare.com/wiki/common/PCIe_INA219.zip
unzip -o PCIe_INA219.zip -d ./PCIe_INA219
cd PCIe_INA219
sudo python INA219.py
PCIe TO M.2 HAT+ W 8.png

Support




Technical Support

If you need technical support or have any feedback/review, please click the Submit Now button to submit a ticket, Our support team will check and reply to you within 1 to 2 working days. Please be patient as we make every effort to help you to resolve the issue.
Working Time: 9 AM - 6 PM GMT+8 (Monday to Friday)