d0k3 / GodMode9

GodMode9 Explorer - A full access file browser for the Nintendo 3DS console :godmode:
GNU General Public License v3.0
2.15k stars 194 forks source link

Unable to Mount Samsung Adapter/MicroSD Card #49

Closed Linden10 closed 7 years ago

Linden10 commented 7 years ago

Ello, I'm here to report on a particular problem that I've been having over some weeks.

First off, I'm a fairly new user 3DS hacking but no stranger to the hacking scene for I've been following it since the days of Wii hacking.

As for the issue I'm having, I have an official Samsung Micro SD-Card (128gb Evo+) with an official Samsung SD Card Adapter that works with my 3DS.

This SD Card Adapter/Micro SD Card works with every homebrew that I've been using (Luma, FBi, Homebrew Launcher, etc) but for some reason GodMode9 won't mount the SD Card, saying

Initialising SD card failed! Retry? (Hmm...Is the "Initialsing spelled right?" Just noticed but whateves)

It's strange because even if GodMode9 is unable to mount the SD Card, it's still loads and works fine from the SD Card! =/

This Micro-SD Card has been formatted with guiformat, using FAT32 and 32kb Clusters as it's default settings suggested by those using SDXC cards on a 3DS.

I don't know what's the code behind mounting a SD Card in GodMode9, but I like to request help on this issue on why it doesn't work?

Luckily have my original 3DS 2GB SD Card which works fine with GodMode9 but... What is the problem with my SD Card Adapter/MicroSD card formatting that's preventing it from working?

I want to help in anyway in resolving this issue, without resorting to formatting the card, to see if there's someway that can make GodMode9 work on mounting the SD Card Adapter/MicroSD Card.

Feel free to ask me any questions, any data you need about the card and I'll try to help!

d0k3 commented 7 years ago

Normally I'd recommend formatting the card in GM9. One other thing you could try is, try older releases of GM9, see if one works. Also, try Horglass9 and Decrypt9 and see if the SD card works in that.

Linden10 commented 7 years ago

Hmm...I have tried an older release of GodMode9, 1.0.0 and it didn't work on that one, I may try other releases to see if it works.

Oh and I haven't tried Decrypt9 yet but as you recommended, I just tried the newest version of Hourglass9 and it successfully initialized my SD Card, actually everything worked perfectly well.

Maybe the older releases, maybe... I'll report my findings to you d0k3!

As for formatting...I have a question if I may ask. What default format does GodMode9 use to format cards?

That is all and thanks for responding!

EDIT: I just tested the newest version of Decrypt9 (WIP) and it also sucessfully initialized my SD Card, loading up with no issues at all!

Interesting indeed, now I'll go check the older versions of GodMode9 and see if one of them can load up the SD Card if at all! I'll report back on the first version that loads it up or not at all!

d0k3 commented 7 years ago

Okay, here's something else you can try, a GodMode9 test build: https://transfer.sh/FZzQp/GodMode9-20170420-105119.zip

Can you run this and tell me what additional output you get?

Linden10 commented 7 years ago

Ah a test build, how interesting!

Okay I just put it and loaded up GM9 as usual through Luma and... I got this as out:

"SD init fail: 13"

I wonder what kind of debugging code this will need. Anyways here ya go, that's all I got and hope this helps!

I'm here when you need anything!

d0k3 commented 7 years ago

Yeah, that's a FATFS error code and it means no filesystem found. No good, but at least it's a start. Can you maybe show me the MBR of your SD card? That's the first 512 byte, HxD can extract it, but make sure you look at the physical (= not logical) drive. FAT header helps, too, that's the first 512 byte of the logical drive.

EDIT: there haven't been any additional messages besides this one, right?

Linden10 commented 7 years ago

Ah the MBR, sure I'll get it for ya! I actually know how to use HxD as I use it a lot myself. Oh yeah no other messages besides that one popped up. Yup!

Interesting that GM9 didn't detect the FS, indeed a start! BRB with the bytes.

EDIT:

I attached this comment with two files containing the first 512-bytes of the MBR physical drive and FAT header of the logical drive. Hope this helps!

[Hmm...both seem to look the same, oh way here ya go!]

Samsung-mSD-Logical-512Bytes.txt Samsung-mSD-Physical-512Bytes.txt

d0k3 commented 7 years ago

None of these two is the MBR. Can you doublecheck? There actually IS a possibility your SD card does not contain an MBR, and that may be the reason behind all trouble.

Here's something new to try.

GodMode9 with FATFS updated to R0.12c (most recent release): https://transfer.sh/UXoZa/GodMode9-20170421-101120.zip

Last GodMode9 release using the same FATFS library as D9: https://github.com/d0k3/GodMode9/releases/tag/v0.5.1

EDIT: Also, you say Luma 3DS works? In the most recent version? (that's v7.0.1). Does the chainloader work? Note: Luma 3DS uses FATFS R0.12c also.

EDIT2: Doublechecking means, check you actually used the physical drive to extract that sector.

d0k3 commented 7 years ago

Okay... third time's the charm. You may want to try this first, before the other two. https://transfer.sh/SrNK0/GodMode9-20170421-103329.zip

This may, or may not fix your problem. If it does, we're not finished, cause it breaks other stuff, and I will still need your help testing.

Linden10 commented 7 years ago

I attached a gif I made showing that the sectors on both the physical [Removable Disk 1] and logical [3DS (H:)] disks to prove that sector 0 are the same.

3ds samsung sectors

To answer your question about Luma, yes the newest version of Luma v7.0.1 works and so does the chainloader as that's what I used to load Decrypt9, Hourglass9 and GodMode9.

I thank your for helping and for your concerns on this, I'll attempt those builds you suggested and reply with the results on them. I'll do the one you recommend first before the others.

See ya until then friend.

Linden10 commented 7 years ago

...Ah i'm back! Just less then 10 mins and I'm done hehe! Peri

Here are the results d03k!

GodMode9 Build 20170421-103329 [Third one you suggested] - SD Init Failed: 13

GodMode9 Build 20170421-101120 - SD Init Failed: 13

GodMode9 v0.5.1 - Successfully Initializes SD-Card and able to explore it. Shows the correct storage amount of the SD Card and everything.

Interesting results indeed! Hopefully this helps ya out d0k3!

I'll be here when you need anything.

d0k3 commented 7 years ago

Okay, dammit. I hoped it would be easier... Can you work your way up from that working release? Just try all releases until you find the one where it stops working. Might be the next one, but I doubt so.

d0k3 commented 7 years ago

Okay, two more testbuilds that you can try:

https://transfer.sh/ar1Oc/SafeCTRTransfer-20170422-105347.zip This is SafeCTRTransfer, but the actual transfer is stubbed. Nothing will be installed to your system, and it should even stop once A9LH is detected. Run it and pay attention to the bottom screen.

https://transfer.sh/fRRkB/GodMode9-20170422-105800.zip This is GodMode9 with parts of its source code replaced by Luma 3DS source code (which apparently has working file system functions).

Might make most sense to try the new GM9 test build first, then the SafeCTRTransfer one, then work your way up from releases. If any of these work, we're, again, not finished. And thanks for help with this!

Linden10 commented 7 years ago

Alright, back and ready to go!

I've tested the builds past v0.5.1 and just finished trying out your newest build you posted above and your safectrtransfer build.

I'll start with the builds starting from v0.5.1... Unfortunately, all the builds past v0.5.1 have failed to init the SD Card.

I tested builds v0.6.6 thru v1.0.6. All of them gave the same message.

(Just know that v1.0.7 was the first time I used GM9, the errors exist on that as well as v1.1.2)

As for your test build version 20170422-105800...it also gave me the same message. But SafeCTRTransfer...it worked!

It successfully seen my SD Card and was able to display the amount of free space and total space! As you said, it didn't transfer anything hehe but it's good news that it works!

It also detected A9LH of course. Anyways there's still a lot of work ahead to getting GM9 to work with my SD.

I again thank you for helping, tell me anything you like to do next! See ya for now. =D

d0k3 commented 7 years ago

Okay, here's a test build with a possible fix (this one has a high chance of success): https://transfer.sh/f09i4/GodMode9-20170423-113856.zip This will most likely break SD formatting, so more work is ahead even if that one should work.

Also try this D9WIP test build - the expected result for this is a SD init failure: https://transfer.sh/cy99A/Decrypt9WIP-20170423-115034.zip

d0k3 commented 7 years ago

Okay, one more... this might be our solution to all the SD mount issues, on top breaking nothing at all. Please try it and give me feedback: https://transfer.sh/dmWWR/GodMode9-20170423-234949.zip

Linden10 commented 7 years ago

Okay here again, thanks! Here are the results!

GM9-Build 20170423-113856 - My SD-Card is successfully initialized and am able to explore too! It took sometime for GM9 to load but still it works! (It's loading time being due to the size of my SD-Card hehe)

Now for your Decrypt9-WIP Build 20170423-115034 - As you expected, the SD-Card initialization failed. Indeed it has.

Now for the last GM9 build you posted above - Hehehe...nyhahaha it WORKS!!! It's works! The SD-Card Initialized successfully! I'm able to explore it and everything too! GM9 takes sometime to load like before due to my SDCard size but still it works!

Peridot is Happy

Looks like we're making a breakthrough to the problem! Still if there's more work to be done, I'm ready to help ya! Just tell me whatever you need, anyways see ya for now!

d0k3 commented 7 years ago

Fixed in https://github.com/d0k3/GodMode9/commit/a8bf80ee2a29a9a5e0a5aae97eebdb538252c8dd

Nothing more to test here, thanks @Linden10 !