PS2 [MX4SIO/SIO2SD] SD Card Adapter and SD-driver for the PS2 SIO2 interface

I just want to thank everyone involved in this project. Growing up with a PS2 I would never imagine one day I would be able to run games from my memory card, it's just so funny to me. I've been using it a lot and it really ressurected my interest in my PS2. I hope we can get Retroarch and uLaunchelf to read the SD sometime, that would be all I ever need for my PS2. Thank you guys so much!
 
Hi all, after playing around with mx4sio and a logic analyzer over the weekend I've managed to get my 128GB SanDisk SDXC and 16GB no brand SDHC working. I haven't done much testing beyond loading up Half-Life with OPL though. I submitted a PR to the ps2sdk repo a moment ago with the fix. For those of you who would like to test it out without compiling everything, I'll link the binaries down below.

PR: github.com/ps2dev/ps2sdk/pull/402

Build of OPL main with fix: dropbox.com/s/07jllt88jp25h1x/OPNPS2LD.ELF?dl=0
mx4sio_bd IRX files: dropbox.com/s/1x5s9cnrvemg3vq/mx4sio_bd_irx.zip?dl=0

Update:
Here are the test_bdm results on a SCPH-750001.
128GB SanDisk SDXC:
Code:
Read 1024KiB, in 5149ms, blocksize=64, speed=203KB/s
Read 1024KiB, in 2970ms, blocksize=128, speed=353KB/s
Read 1024KiB, in 1845ms, blocksize=256, speed=568KB/s
Read 1024KiB, in 1414ms, blocksize=512, speed=741KB/s
Read 1024KiB, in 1184ms, blocksize=1024, speed=885KB/s
Read 1024KiB, in 1085ms, blocksize=2048, speed=966KB/s
Read 1024KiB, in 1059ms, blocksize=4096, speed=990KB/s
Read 1024KiB, in 1049ms, blocksize=8192, speed=999KB/s
Read 1024KiB, in 1040ms, blocksize=16384, speed=1008KB/s
Read 1024KiB, in 1039ms, blocksize=32768, speed=1009KB/s

16GB no brand SDHC:
Code:
Read 1024KiB, in 5104ms, blocksize=64, speed=205KB/s
Read 1024KiB, in 2947ms, blocksize=128, speed=355KB/s
Read 1024KiB, in 1837ms, blocksize=256, speed=570KB/s
Read 1024KiB, in 1408ms, blocksize=512, speed=744KB/s
Read 1024KiB, in 1164ms, blocksize=1024, speed=900KB/s
Read 1024KiB, in 1023ms, blocksize=2048, speed=1025KB/s
Read 1024KiB, in 983ms, blocksize=4096, speed=1066KB/s
Read 1024KiB, in 955ms, blocksize=8192, speed=1097KB/s
Read 1024KiB, in 940ms, blocksize=16384, speed=1115KB/s
Read 1024KiB, in 941ms, blocksize=32768, speed=1114KB/s

I'm curious to know if this fix would cause any performance regression on cards that are already supported. Unfortunately, I don't have any other cards at my disposal to test.
 
The report came from "@Sorer#1637" on the PS2-Scene-Discord in the MX4SIO-channel. :)

He also mentioned some random Chinese card working (now?).
 
Tested the following cards with original 1.2.0 BETA 1968-1b8efe and the custom new version. I checked each of these twice to see if they would boot a game.

Kingston 128GB microSD EXFAT - works with original, not with custom
SanDisk 200gb microSD EXFAT - doesn't work with original, works with custom
Sony 16GB SD FAT32 - works with neither
SanDisk 16GB SD FAT32 - doesn't work with original, works with custom
Samsung 4GB SD FAT32 - works with original, doesn't work with custom

I have a huge SanDisk card I'd love to use, so thanks for working on this!
 
Tested the following cards with original 1.2.0 BETA 1968-1b8efe and the custom new version. I checked each of these twice to see if they would boot a game.

Kingston 128GB microSD EXFAT - works with original, not with custom
SanDisk 200gb microSD EXFAT - doesn't work with original, works with custom
Sony 16GB SD FAT32 - works with neither
SanDisk 16GB SD FAT32 - doesn't work with original, works with custom
Samsung 4GB SD FAT32 - works with original, doesn't work with custom

I have a huge SanDisk card I'd love to use, so thanks for working on this!

Thank you for testing it out! I've made some additional fixes since my first post. Here's the latest build if you want to test it out: https://www.dropbox.com/s/x62dxd02z2katt4/OPNPS2LD_TEST_BUILD.ELF?dl=0

Additionally here is a modified version of test_bdm which provides verbose output through every step of the sd card initialization. If you have a problematic card and ps2client please give this a run and post the output. https://www.dropbox.com/s/zifytok0to7uqqt/test_bdm_debug.elf?dl=0

For those of you in the PS2 Scene Discord server, these are the same versions that are pinned in the MX4SIO channel.

EDIT: Forgot to ask, is the huge SanDisk card you mentioned a SDUC card? I don't believe those support SPI Mode
 
To clarify all these results, when I say "doesn't work" I mean it fails to load the list of games at all. When I say it "works," I mean it cam boot a game to gameplay.

Test build results:
Kingston 128GB microSD EXFAT - doesn't work (no change)
SanDisk 200gb microSD EXFAT - works (no change)
Sony 16GB SD FAT32 - doesn't work (no change)
SanDisk 16GB SD FAT32 - works (no change)
Samsung 4GB SD FAT32 - doesn't work (no change)

The modified test_bdm failed to boot at all for me off my memory card. After about 15 seconds of black screen it kicks back to the memory card screen.

And no, my card is not SDUC. To me, huge is still 256GB, haha.
 
Thank you all for working on this.

I don't know when or if I'll go back to working on mx4sio (though basically I have mostly no involvement in the currently used code if I remember correctly).

I checked the first driver I wrote and the new one (in 2020) and both are missing the R1 (and the rest) responses CRC byte after the data bytes. Thank you for finding this, qnox32, in the driver Maximus32 made (used in PS2SDK, OPL).

Additionally, according to spec, one more byte needs to be transferred before stopping the clock, but I could be wrong about that.
I am not sure if that is the purpose of this line from the original code:
https://github.com/ps2dev/ps2sdk/blob/master/iop/sio/mx4sio_bd/src/spi_sdcard_driver.c#L83
But sending this is disabled in the PS2 code anyway.

Additional problems might be caused by not doing the command + response transfer as a single transfer on SIO2, which causes /SS going inactive for some time (but I am not sure about this).
 
To clarify all these results, when I say "doesn't work" I mean it fails to load the list of games at all. When I say it "works," I mean it cam boot a game to gameplay.

Test build results:
Kingston 128GB microSD EXFAT - doesn't work (no change)
SanDisk 200gb microSD EXFAT - works (no change)
Sony 16GB SD FAT32 - doesn't work (no change)
SanDisk 16GB SD FAT32 - works (no change)
Samsung 4GB SD FAT32 - doesn't work (no change)

The modified test_bdm failed to boot at all for me off my memory card. After about 15 seconds of black screen it kicks back to the memory card screen.

And no, my card is not SDUC. To me, huge is still 256GB, haha.

Did you launch ps2link on the ps2 and send test_bdm over the network with ps2client? Unfortunately, it doesn't print to the screen, it prints the info over the network.

Thank you all for working on this.

I don't know when or if I'll go back to working on mx4sio (though basically I have mostly no involvement in the currently used code if I remember correctly).

I checked the first driver I wrote and the new one (in 2020) and both are missing the R1 (and the rest) responses CRC byte after the data bytes. Thank you for finding this, qnox32, in the driver Maximus32 made (used in PS2SDK, OPL).

Additionally, according to spec, one more byte needs to be transferred before stopping the clock, but I could be wrong about that.
I am not sure if that is the purpose of this line from the original code:
https://github.com/ps2dev/ps2sdk/blob/master/iop/sio/mx4sio_bd/src/spi_sdcard_driver.c#L83
But sending this is disabled in the PS2 code anyway.

Additional problems might be caused by not doing the command + response transfer as a single transfer on SIO2, which causes /SS going inactive for some time (but I am not sure about this).

Thank you for the info! I'll take another look
 
  • Like
Reactions: TnA
I got the results on discord but I will post them here too for ps2link:
For the Kingston 64GB canvas card I got:
Code:
1 00100000 000443b4 .....
Loaded, host:test_bdm.elf
start address 0x100000
gp address 00000000
open name rom0:ROMVER flag 1 data 41378
open fd = 2
BDM (Block Device Manager) test application
Loading iomanX and fileXio IOP modules
IOX/File_Manager_Rpc: fileXio: fileXio RPC Server v1.00
Copyright (c) 2003 adresd
Loading BDM IOP modules
Block Device Manager (BDM) v1.1
BDM: connecting fs MBR
BDM: BDM event thread running
FreeUsbd v.0.1.2
USBMASS: USB MASS Driver v1.1
MX4SIO: mx4sio v1.1
MX4SIO: Starting module
MX4SIO:  - argv[0] = LBbyEE
MX4SIO: sio2man_hook_init
MX4SIO: Installing sio2man hooks for version 0x102
MX4SIO: Loaded succesfully!
MX4SIO: modload 0x101 detected
MX4SIO: card detection thread running
BDM VFAT driver (FAT12/16/32) v1.1
BDM: connecting fs vfat
Waiting 30s
USBMASS: connect: devId=2
USBMASS: Vendor: SanDisk
USBMASS: Product: Cruzer Blade  
USBMASS: Revision: 1.26
USBMASS: 7821311 512-byte logical blocks: (4004MB / 3818MiB)
BDM: connecting device usb0p0 id=0x0
BDM: connecting device usb0p1 id=0xc
BDM: usb0p0 mounted to MBR
VFAT: Fat type 32 Id FAT32  
BDM: usb0p1 mounted to vfat
MX4SIO: Attempting card init
MX4SIO: Writing 74 dummy clks
MX4SIO: Sending CMD0
MX4SIO: CMD0 Response 0x1, OKAY!
MX4SIO: Sending CMD8
MX4SIO: CMD8 Response 0x1, OKAY!
MX4SIO: Sending CMD55/ACMD41
MX4SIO: CMD55/ACMD41 correct response 0x0 after 0x3 tries
MX4SIO: Sending CMD58
MX4SIO: CMD58 Response 0x0, card type: SDV2HC
MX4SIO: ps2_spi_set_speed(25000000)
MX4SIO: Card inserted and init'd properly
MX4SIO: Getting card info!
MX4SIO: Sending CMD9
MX4SIO: CMD9 Response 0x0, OKAY!
MX4SIO: Reading CSD
MX4SIO: CSD Read successful
MX4SIO: Sending CMD10
MX4SIO: CMD10 Response 0x0, OKAY!
MX4SIO: Reading CID
MX4SIO: CID Read failed 0x1
MX4SIO: Failed getting card info, returning

For another chinese MicroData 64GB card:
Code:
Input ELF format filename = host:test_bdm.elf
1 00100000 000443b4 .....
Loaded, host:test_bdm.elf
start address 0x100000
gp address 00000000
open name rom0:ROMVER flag 1 data 41378
open fd = 2
BDM (Block Device Manager) test application
Loading iomanX and fileXio IOP modules
IOX/File_Manager_Rpc: fileXio: fileXio RPC Server v1.00
Copyright (c) 2003 adresd
Loading BDM IOP modules
Block Device Manager (BDM) v1.1
BDM: connecting fs MBR
BDM: BDM event thread running
FreeUsbd v.0.1.2
USBMASS: USB MASS Driver v1.1
MX4SIO: mx4sio v1.1
MX4SIO: Starting module
MX4SIO:  - argv[0] = LBbyEE
MX4SIO: sio2man_hook_init
MX4SIO: Installing sio2man hooks for version 0x102
MX4SIO: Loaded succesfully!
MX4SIO: modload 0x101 detected
MX4SIO: card detection thread running
BDM VFAT driver (FAT12/16/32) v1.1
BDM: connecting fs vfat
Waiting 30s
USBMASS: connect: devId=2
USBMASS: Vendor: SanDisk
USBMASS: Product: Cruzer Blade  
USBMASS: Revision: 1.26
USBMASS: 7821311 512-byte logical blocks: (4004MB / 3818MiB)
BDM: connecting device usb0p0 id=0x0
BDM: connecting device usb0p1 id=0xc
BDM: usb0p0 mounted to MBR
VFAT: Fat type 32 Id FAT32  
BDM: usb0p1 mounted to vfat
MX4SIO: Attempting card init
MX4SIO: Writing 74 dummy clks
MX4SIO: Sending CMD0
MX4SIO: CMD0 Response 0x1, OKAY!
MX4SIO: Sending CMD8
MX4SIO: CMD8 Response 0x1, OKAY!
MX4SIO: Sending CMD55/ACMD41
MX4SIO: CMD55/ACMD41 correct response 0x0 after 0x2 tries
MX4SIO: Sending CMD58
MX4SIO: CMD58 Response 0x0, card type: SDV2HC
MX4SIO: ps2_spi_set_speed(25000000)
MX4SIO: Card inserted and init'd properly
MX4SIO: Getting card info!
MX4SIO: Sending CMD9
MX4SIO: CMD9 Response 0x0, OKAY!
MX4SIO: Reading CSD
MX4SIO: CSD Read successful
MX4SIO: Sending CMD10
MX4SIO: CMD10 Response 0x0, OKAY!
MX4SIO: Reading CID
MX4SIO: CID Read successful
MX4SIO: 122168320 512-byte logical blocks: (62554MB / 59652MiB)
BDM: connecting device sdc0p0 id=0x0
BDM: connecting device sdc0p1 id=0x7
BDM: sdc0p0 mounted to MBR

The above card works fine on both builds.
 
  • Like
Reactions: TnA
Unfortnately I dont have time to figure this out and set it up.
No worries, thanks for testing out OPL though.

I've made several changes since the last build posted here. A user in the PS2 Scene server has reported that their cards are now working again.

For those wanting to give it a try:
OPL: https://www.dropbox.com/s/lpvge0ca13jevhr/OPNPS2LD_R4.ELF?dl=0
For anyone who's having issues and has ps2link and ps2client setup, please run this. It will provide a very detailed log of everything that's happening
test_bdm: https://www.dropbox.com/s/a0c2aqpdxfm2m8x/test_bdm_R4.elf?dl=0
 
  • Like
Reactions: TnA
No worries, thanks for testing out OPL though.

I've made several changes since the last build posted here. A user in the PS2 Scene server has reported that their cards are now working again.

For those wanting to give it a try:
OPL: https://www.dropbox.com/s/lpvge0ca13jevhr/OPNPS2LD_R4.ELF?dl=0
For anyone who's having issues and has ps2link and ps2client setup, please run this. It will provide a very detailed log of everything that's happening
test_bdm: https://www.dropbox.com/s/a0c2aqpdxfm2m8x/test_bdm_R4.elf?dl=0

RD4 results:

Kingston 128GB microSD EXFAT - works (change!)
SanDisk 200gb microSD EXFAT - works (no change)
Sony 16GB SD FAT32 - doesn't work (no change)
SanDisk 16GB SD FAT32 - works (no change)
Samsung 4GB SD FAT32 - works (change!)

Thanks.
 
Thank you for the tests!

Wow! The compatibility seems to become quite high!

Beside the card-compatibility I am most interested in cards which worked before but had issues with games, like I had with FF XII on a Samsung Evo 256GB vs. A TOSHIBA EXCERIA 8GB.
 
Put this together last night. It will log the entire SD card init process to a text file on a USB flash drive. To use it all you need to do is connect a FAT32 formatted flash drive and load the ELF with uLaunchELF. Once it's complete it will automatically exit and there should be a new file on the flash drive called "sdcard_log.txt".

sdcard_debugger: https://www.dropbox.com/s/fnffuptnqf78orx/sdcard_debugger.elf?dl=0

I encourage anyone who's having compatibility issues to run this and submit the logs.
 

Similar threads

Back
Top