Using the PERST# signal to switch between two M.2 NVME SSDs - Page 1
Forum section: electronics / projects

author: mrcy22
author_rank: Contributor
timestamp: June 15, 2024, 08:26:25 pm
content: 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.

author: HwAoRrDk
author_rank: Super Contributor
timestamp: June 16, 2024, 09:37:59 pm
content: 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).

author: mrcy22
author_rank: Contributor
timestamp: June 17, 2024, 02:37:29 pm
content: 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.

author: HwAoRrDk
author_rank: Super Contributor
timestamp: June 17, 2024, 06:24:40 pm
content: 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.

author: mrcy22
author_rank: Contributor
timestamp: June 17, 2024, 08:07:50 pm
content: Quote from: HwAoRrDk on June 17, 2024, 06:24:40 pmYes, 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.Quote from: HwAoRrDk on June 17, 2024, 06:24:40 pmI 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.Quote from: HwAoRrDk on June 17, 2024, 06:24:40 pmThe 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.Quote from: HwAoRrDk on June 17, 2024, 06:24:40 pmYes, 3.3V will be taken directly in the MVME slot.Quote from: HwAoRrDk on June 17, 2024, 06:24:40 pmThat'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.

author: HwAoRrDk
author_rank: Super Contributor
timestamp: June 17, 2024, 09:14:14 pm
content: Quote from: mrcy22 on June 17, 2024, 08:07:50 pmI'm 99.9% sure that PERST#isn'tspecified 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.

author: mrcy22
author_rank: Contributor
timestamp: July 19, 2024, 03:17:42 pm
content: 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

author: HwAoRrDk
author_rank: Super Contributor
timestamp: July 20, 2024, 09:14:04 pm
content: 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.

author: mrcy22
author_rank: Contributor
timestamp: August 12, 2024, 03:56:04 pm
content: I used SN74LVC1G08 because I couldn't find 09 at home and everything works as expected. The discs can be easily switched with a toggle switch. I didn't bother much with the construction, the low labor of building was more important :-)