Author Topic: Using the PERST# signal to switch between two M.2 NVME SSDs  (Read 548 times)

0 Members and 1 Guest are viewing this topic.

Offline mrcy22Topic starter

  • Contributor
  • Posts: 14
  • Country: mc
I would like to use the PERST# signal to switch between two M.2 nvme SSDs Samsung 970 EVO on a board that does not allow it in any other way. I would use an adapter to access the PERST# signal and use the switch to keep one of the drives permanently in a reset state. The switching would of course only be done when the PC is switched off. Would there be any problem with this approach? If I keep the SSD in reset state for a long time.
 

Offline HwAoRrDk

  • Super Contributor
  • ***
  • Posts: 1539
  • Country: gb
Re: Using the PERST# signal to switch between two M.2 NVME SSDs
« Reply #1 on: June 16, 2024, 09:37:59 pm »
So, you plan to have two M.2 SSDs somehow connected to the same slot in parallel, and use a switch (presumably SPDT) intercepting the PERST# line to select which SSD will be active?

In theory, it should work - at least as far as keeping a drive powered but in reset for an indefinite period is concerned. You would need to make sure you put pull-down resistors on each drive side after the switch on the PERST# line. However, I think you may have complications with the actual PCIe connections. What you will effectively have is massive length stubs on the PCIe TX and RX pairs of each lane (and also REFCLK). This may adversely affect the signal integrity, such that it might not work at all, or it works intermittently, or works but not at the full transfer rate the drive is capable of (because the connection speed is downgraded).
 

Offline mrcy22Topic starter

  • Contributor
  • Posts: 14
  • Country: mc
Re: Using the PERST# signal to switch between two M.2 NVME SSDs
« Reply #2 on: June 17, 2024, 02:37:29 pm »
Each SSD will be plugged into its own slot via an adapter as shown in the picture which will provide the switching. The switching will be done using an SPDT switch, roughly as drawn in the schematic.

Unfortunately I can't find information anywhere on whether a long term reset will have any adverse effect on the SSD.
 

Offline HwAoRrDk

  • Super Contributor
  • ***
  • Posts: 1539
  • Country: gb
Re: Using the PERST# signal to switch between two M.2 NVME SSDs
« Reply #3 on: June 17, 2024, 06:24:40 pm »
Oh, I see. You actually have two slots, but only want to enable one drive or the other. It wasn't clear before. So you are going to use two of these adapters and on each cut the PERST trace between the edge fingers and the slot connector and patch in your switching circuit?

Your circuit as shown should work, but I am curious why you chose open drain output AND gates. If it were me I would use a push-pull '08 and a pull-down on the output to ensure default state of reset, just in case. It shouldn't need to be open-drain as there's only one device (the SSD) on the output, and there's no voltage translation needed.

If concerned about ESD from the switch (presumably mounted outside enclosure), diodes are good but I would also add a series resistor of a few hundred ohms (no more than 1k, otherwise logic low voltage level will be too high) between switch and diode for extra protection.

Where is the 3.3V sourced? Also from the slot? That would be preferable, as it ensures the switching logic is always powered up simultaneously with the drive, so there is no period of uncertain logic level on the output. You should make sure to have each AND gate (and pull-ups) powered only from its associated slot - i.e. not commoned - in case the system does something weird like switch power to slots individually.

I really don't think you need to worry about holding a drive in reset for lengthy indefinite periods. The drive won't know the difference between 2 seconds and 2 hours (or more). If it somehow does cause problems, then I would say the drive is badly designed.
 

Offline mrcy22Topic starter

  • Contributor
  • Posts: 14
  • Country: mc
Re: Using the PERST# signal to switch between two M.2 NVME SSDs
« Reply #4 on: June 17, 2024, 08:07:50 pm »
Oh, I see. You actually have two slots, but only want to enable one drive or the other. It wasn't clear before. So you are going to use two of these adapters and on each cut the PERST trace between the edge fingers and the slot connector and patch in your switching circuit?
Yes, that's exactly how it will be. I put the adapter here just as an example, I will have a custom PCB made with these circuits.

Your circuit as shown should work, but I am curious why you chose open drain output AND gates. If it were me I would use a push-pull '08 and a pull-down on the output to ensure default state of reset, just in case. It shouldn't need to be open-drain as there's only one device (the SSD) on the output, and there's no voltage translation needed.
I chose open drain because in the PCIE specification the PERST# signal is listed as open drain and I am not sure if there is some other reset circuit in the SSD that could cause a collision in case of push-pull output. It's just done that way to be sure, I won't mess anything up by wiring it that way.

If concerned about ESD from the switch (presumably mounted outside enclosure), diodes are good but I would also add a series resistor of a few hundred ohms (no more than 1k, otherwise logic low voltage level will be too high) between switch and diode for extra protection.
The ESD diode is there just in case, I put them everywhere, it doesn't cost any money. The wires to the switch will be no longer than 300mm.

Where is the 3.3V sourced? Also from the slot? That would be preferable, as it ensures the switching logic is always powered up simultaneously with the drive, so there is no period of uncertain logic level on the output. You should make sure to have each AND gate (and pull-ups) powered only from its associated slot - i.e. not commoned - in case the system does something weird like switch power to slots individually.
Yes, 3.3V will be taken directly in the MVME slot.

I really don't think you need to worry about holding a drive in reset for lengthy indefinite periods. The drive won't know the difference between 2 seconds and 2 hours (or more). If it somehow does cause problems, then I would say the drive is badly designed.
That's what I'm not sure about. I can think of another way to achieve what I want. By setting 1111 to ports Config_0 to 3, which means "No Add-in Card Present". Supposedly many motherboards do not support this setting and ignore it. I have no idea if this is true.
 

Offline HwAoRrDk

  • Super Contributor
  • ***
  • Posts: 1539
  • Country: gb
Re: Using the PERST# signal to switch between two M.2 NVME SSDs
« Reply #5 on: June 17, 2024, 09:14:14 pm »
I chose open drain because in the PCIE specification the PERST# signal is listed as open drain and I am not sure if there is some other reset circuit in the SSD that could cause a collision in case of push-pull output. It's just done that way to be sure, I won't mess anything up by wiring it that way.

I'm 99.9% sure that PERST# isn't specified as open-drain. That's why I queried the usage of an open-drain output. Are you sure you're not making an assumption because other control signals like CLKREQ# and WAKE# are open-drain? The SSD device should never be actively driving the PERST# line, because it is purely an input to the device, so it is safe to drive it with a push-pull output. The only reason why you'd need to make it open-drain is if you were connecting the output to an existing reset line in parallel with other open-drain devices that will drive it (e.g. system board) - i.e. so that multiple devices are capable of asserting reset. But that is not your situation - you are intercepting the reset line, and PERST# on other devices are probably not open-drain.
« Last Edit: June 18, 2024, 06:28:12 am by HwAoRrDk »
 

Offline mrcy22Topic starter

  • Contributor
  • Posts: 14
  • Country: mc
Re: Using the PERST# signal to switch between two M.2 NVME SSDs
« Reply #6 on: July 19, 2024, 03:17:42 pm »
I read somewhere that PERST# is also used to indicate hot-plug device connections, that's why it is open-drain. But I can't find it at the moment, so I don't know if it also applies to motherboard PCs
 

Offline HwAoRrDk

  • Super Contributor
  • ***
  • Posts: 1539
  • Country: gb
Re: Using the PERST# signal to switch between two M.2 NVME SSDs
« Reply #7 on: July 20, 2024, 09:14:04 pm »
The only pins I know of that have anything to do with hot-plug (and simply detection that a card is present in a slot) are PRSNT1# and PRSNT2#. And those are only open-drain in so far as the card passively bridges one pin to the other, with one being connected to ground host-side, and the other as an input with pull-up on the hot-swap controller.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf