Forum > Windows

SD card low level read

<< < (2/5) > >>

MarkMLl:

--- Quote from: dseligo on August 26, 2021, 12:15:38 am ---Cards are not damaged. They are used in microcontroller operated devices and probably has some custom memory organization.
I hoped I could read them from Windows when some of this devices stop working.

I will try with Linux and if that doesn't work I'll try it with Arduino.

--- End quote ---

My experience is that when they go wrong, they go wrong badly. Getting the "physical damage" side out of the way first, the narrowest line across the card runs straight through the die so if they crack- and I've done this twice due to a badly-designed Raspberry Pi case- they're beyond even a dissolve-card-and-rebond solution.

Electrically, they're known to be very susceptible to poor voltage control and power interruption at critical times. IIRC, the low-level metadata blocks are R/O so won't be damaged by this sort of thing, but it's still very easy to get to a situation where the card doesn't respond normally and you have to go in using SPI: hence Arduino although in principle at least any SPI controller e.g. a Raspberry Pi would work.

Logically, since they don't have load balancing they're extremely susceptible to having their FAT-style directory screwed by repeated write operations. Now at least some cards are specially designed on the assumption that they'll be partitioned in a way that puts the FATs in a specially-designed resistant area, but there's always a risk that any derangement to this will get the card into a state that a standard reader will reject it: and there's neither BIOS support nor something that looks like a (S)ATA controller to get in at a lower level. And of course most readers are "smart" with either a USB interface or a controller chip with a special Windows driver... and I've had no success at all getting the latter to work on Linux.

Oh, and if in doubt always check with a different (newer) reader: there's an arms race as capacities are pushed up by consumer equipment with PCs rather struggling to keep up.

HTH, MarkMLl

geraldholdsworth:

--- Quote from: dseligo on August 25, 2021, 12:47:03 pm ---How could SD card be read if there isn't drive letter assigned to it and it doesn't show in Disk Management?
--- End quote ---

I've been told that an SD card appears as a file on Linux, macOS and Windows. But, I have no clue what this is or how to access it.

I have the same query as you, about accessing an SD card that the OS doesn't recognise the format but is not broken.

MarkMLl:

--- Quote from: geraldholdsworth on June 19, 2022, 11:39:47 am ---
--- Quote from: dseligo on August 25, 2021, 12:47:03 pm ---How could SD card be read if there isn't drive letter assigned to it and it doesn't show in Disk Management?
--- End quote ---

I've been told that an SD card appears as a file on Linux, macOS and Windows. But, I have no clue what this is or how to access it.

--- End quote ---

I can speak for Linux and the same probably applies to the Mac.

Whether an SD-Card appears as a named device, to which fdisk may optionally be applied, and with the result mountable as a filesystem hence able to support files, depends on what comes between the card and the host computer.

If you have a USB-connected reader, there will be a chip or a "black blob" inside it. In either case that will be a microcontroller which presents itself as a USB storage device at one side, and on the other side talks either SPI or the MMC protocol (see Wp page).

If the OS doesn't recognise the card as a storage device, then you need to break in at the engineering level using either SPI or MMC. A PC is not well-suited for that since you need something like a CH341A chip to generate SPI to a (dumb) card adapter, a Raspberry Pi is somewhat better since it supports SPI directly.

However there are /far/ more people doing this sort of thing using hardware comparable with an Arduino, I have in the past used Arduino code in an attempt to see if there was any life at all left in a card that was physically damaged.

I'd also note that over the last couple of weeks I've been using an SD-Card attached to an RP2040: once I sorted out the non-standard pinning used by the prototyping board I'd got talking to the card using SPI was no real problem.


--- Quote ---I have the same query as you, about accessing an SD card that the OS doesn't recognise the format but is not broken.

--- End quote ---

This is the second or third time I've said this in this thread: look at it using something like an Arduino since you're likely to need to get at it at a lower level than off-the-shelf PC interfaces support. Or at the very least use an RPi rather than a PC, but at that point expect to have to port Arduino code onto it since that's where all the work is being done.

MarkMLl

geraldholdsworth:

--- Quote from: MarkMLl on June 19, 2022, 12:10:18 pm ---This is the second or third time I've said this in this thread: look at it using something like an Arduino since you're likely to need to get at it at a lower level than off-the-shelf PC interfaces support. Or at the very least use an RPi rather than a PC, but at that point expect to have to port Arduino code onto it since that's where all the work is being done.
--- End quote ---
Unfortunately, people have requested a feature on my application that allows them to access the files on this filing system (which isn't recognised by Windows or macOS, but apparently there is a driver built into Linux...interestingly). The partition they want to access is a RISC OS partition. Majority of the time, this SD card would have come from a RaspberryPi, but sometimes a RiscPC (or older).

MarkMLl:

--- Quote from: geraldholdsworth on June 20, 2022, 11:18:12 am ---
--- Quote from: MarkMLl on June 19, 2022, 12:10:18 pm ---This is the second or third time I've said this in this thread: look at it using something like an Arduino since you're likely to need to get at it at a lower level than off-the-shelf PC interfaces support. Or at the very least use an RPi rather than a PC, but at that point expect to have to port Arduino code onto it since that's where all the work is being done.
--- End quote ---
Unfortunately, people have requested a feature on my application that allows them to access the files on this filing system (which isn't recognised by Windows or macOS, but apparently there is a driver built into Linux...interestingly). The partition they want to access is a RISC OS partition. Majority of the time, this SD card would have come from a RaspberryPi, but sometimes a RiscPC (or older).

--- End quote ---

Does the /device/ appear as e.g. /dev/sdb when plugged in? Note that I'm not talking about the /filesystem/ here, or about individual /files/ on the filesystem.

If it does, then it's a standard Linux question of (a) whether any form of partitioning is involved (which might or might not be directly supported) and (b) whether the kernel supports RISCOS filesystems.

This is /very/ different from having a card which the OS doesn't recognise, Google for something like 'mount RISCOS on Linux'.

MarkMLl

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version