Fabien F
Fabien F

Reputation: 33

Android sdcard communication through spi

I need to communicate with an modified sdcard in an android phone on very basic level just few commands and responses back. Originally the communication was handled through file system, but when android 4.4 denied access to most of the sdcard this has to be done through SPI, which I hope will work. I have a experience with Android, but not so much in SPI. Could anyone provide a brief tutorial on how to tackle this, or point me to some resources, I couldn't find anything that would deal with how to communicate with sdcard in Android.

Thanks

Upvotes: 1

Views: 831

Answers (1)

Chris Stratton
Chris Stratton

Reputation: 40337

Direct access to the physical storage device is not permitted on a secured device, as it would be an obvious end-run around the restrictions that are now part of the security model.

On an unsecured (engineering, root hacked, etc) device, if you get a helper executable running as root, you can probably interact with the file system or raw block device just as you were before android 4.4, possibly after shutting down any official-Android components that were talking to it.

Even on an unsecured device, you would need hard-to-obtain SOC-specific peripheral-register programming information to talk to the card in SPI mode (or perhaps by bit-banging the pins in GPIO mode) rather than by the faster 4-bit protocol it is almost certainly using.

If you want a workaround supported by a secured device, then if that device supports USB host mode, you can get an adapter cable and a USB SD reader and talk raw mass storage commands using the Android USB Host APIs. Or if USB mass storage does not give you sufficiently fine-grained control, you can use the SPI mode of an FTDI USB-serial chip, or make something custom with a USB-enabled microconctroller.

Upvotes: 1

Related Questions