Possibility of mimicking an SD card?

Posted on
  • Some of you might be already playing with Raspberry Pis, like, a lot of them.

    I have been done so many flashes at one point that I just want something to simulate that interface from a device.

    Do you think it is possible to do that with an Espruino?

  • Hi Vicary,

    I doubt you'd be able to simulate an SD card without quite a lot of changes to the Espruino interpreter itself.

    I'm not quite sure what you want to do, but you may be able to 'switch' an SD card away from the Raspberry Pi, so it can be accessed by the Espruino, then switch it back.

  • My idea is to use Espruino as a simulator by wiring the pins into the SD card slot, and have the Espruino pretends itself as an SD card. Just like how the HID code pretending to be an input device.

    I know the internal storage of Espruino is very limited, it might very well end up to be piping data from another storage. I don't know yet.

    Just imagining the possibility of interfacing with one or more "card slots".

  • I'm afraid that's not going to be possible right now - to do it, Espruino would have to act as an SPI (or possibly SDIO) slave, which just isn't possible right now.

    In the future it might be possible for Espruino to emulate a USB Mass Storage device though, but I'm afraid that's quite far down the priority list.

  • Hi @Vicary, this is a lot more difficult than it sounds. I investigated emulating a SD card (not with Espruino) and it was a lot of work. I found a solution for my needs (security testing) by getting a SD->USB Mass Storage adapter, and then emulating USB mass storage with a microcontroller. So it went Microcontroller(emulating USB MS)->adapter->MicroSD->Device

    It was pretty slow, and the adapters were hard to find and now discontinued:

    http://www.saelig.com/product/mio001.htm­

    Only other option I saw at the time was an expensive industrial SD card testing unit. I might have another look because it would be so useful.

    An easier solution for you might be to use a USB drive to hold your root file system. Emulating a mass storage device is much easier, and I believe there might be devices that allow you to do it (I have one which selects ISOs and emulates a DVD drive).

    See https://samhobbs.co.uk/2013/10/speed-up-­your-pi-by-booting-to-a-usb-flash-drive

  • @thomc Sorry was not checking in lately, thanks for the reply and info in depth.

    Sadly Pi wouldn't boot without a proper boot partition from SD slot. File systems are already mounting to a NAS via NFS, guess I am stuck at the boot stage.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Possibility of mimicking an SD card?

Posted by Avatar for Vicary @Vicary

Actions