Thursday, November 21, 2024

NVMe on Raspberry Pi 5

Raspberry Pi 5 introduced a PCIe connector (16-pin 0.5mm FFC) in the place of the under-utilized display connector.  Now it is possible to use an NVMe SSD.  It would require a PCIe to NVMe adapter, which can be purchased for about $7 and comes with a board to mount an M.2 M-key NVMe SSD for size 2230/2242/2280 and a flexible flat cable to connect to RPi 5.  
Download the OS image.  xzcat | dd to the disk.  Two partitions are created and take up about 14GB.

The default EEPROM `BOOT_ORDER=0xf416`, the boot order should be NVMe, SD Card, USB.  But it still boots the SD card first.  With the SD card out, the RPi 5 boots from the NVMe.  The root partition is near full.  Use parted and resize2fs to grow the root file system.

A sustained read/write speed is 390MB/s read and 440MB/s write, which is better than the USB NVMe adapter 260MB/s read and 380MB/s write, but not dramatically.

The RPi 5 PCIe is rated for Gen 2 one-lane; the maximum throughput is 500MB/s.  

In config.txt, add `dtparam=pciex1_gen=3` to enables PCIe Gen 3 (1GB/s).  The reliability of the Gen 3 operation is not guaranteed, but it appears to work well.  The read speed is increased to 850 MB/s; the write speed is largely unchanged.  The disk is rated at up to 1700MB/s for sequential read and up to 1000MB/s for sequential write.  So the read speed is close to the bus speed, but the write speed is under performing.

The board averages about 1.2A/5V during writing.  The average idle current is 0.7A (without SSD, 0.6A).  With the NVMe SSD, the Raspberry Pi 5 does not shut down completely, still drawing 170mA despite of setting POWER_OF_ON_HALT=1 and WAKE_ON_GPIO=0 (without SSD, 4mA).

The PCIe interface appears to have some interference on the WiFi signal.  This FFC has no ground plane, which probably radiates more. The on-board WiFi has trouble picking up relatively weak signals.  Other people have reported similar issue.  The WiFi does work when it is close to the router. 

No comments:

Post a Comment