Electronic – M.2 PCIe x2 and SATA connections and key/notch with SATA/PCIe x4 SSDs

m.2pciesatassd

For my current project I am adding an M.2 slot for additional storage. Even though SATA data throughput is more than sufficient I would like to support both SATA and PCIe based SSDs, as I dont know what will be more/less available and affordable in future.

M.2 Keys

The M.2 connectors use keying notches in different positions, depending on the provided interfaces. Each key position is identified by a letter.

  • Key B: SATA + PCIe x2 (+ others)
  • Key M: SATA + PCIe x4

A quick search for M.2 SSDs on amazon showed that most NVMe/PCIe based SSDs use Key M, while SATA SSDs use a combined Key B and M. Therefore, for maximum compatibility, I need to use Key M.

Available System Interfaces

My system has one SATA and 2 PCIe lanes that may be connected to the M.2 receptacle, what is the requirement for Key B. I am missing 2 PCIe lanes for key M.

Plan

I plan to use the M key for maximum mechanical compatibility and would like to provide one SATA and 2 PCIe-Lanes on the M.2 connector.

Questions

  1. Do all NVMe/PCIe based SSDs work with 2 instead of 4 PCIe lanes?
  2. Is there a requirement on which PCIe lanes need to be used in this case?
  3. How may the two PCIe lanes that are not used be terminated?

Best Answer

A card that has B and M notches is generally SATA, although it could be NVMe x 2 if the CONFIGx pins are set to that mode.

An M-notch card as a practical matter is strictly NVMe, and can be x1, x2 or x4.

There’s no issue with leaving PCIe lanes unconnected. The root complex will sense which ones are and power down the ones that aren’t.

The PCIe lane width negotiation starts from the max number of lanes and works its way down. Lane counts are always a power of 2. So a x4 M.2 card would be lanes 3-2-1-0. x2 would be lanes 1-0. x1 would be lane 0.

PCIe / NVMe can work over 1, 2 or 4 lanes. So if the host only has 1 lane, you can use that to connect an M.2 card.