简体   繁体   English

通过spi的Android sdcard通信

[英]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. 我需要在非常基本的级别上与android手机中的修改后的sdcard通信,只需返回几个命令和响应即可。 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. 最初,通信是通过文件系统处理的,但是当android 4.4拒绝访问大多数sdcard时,这必须通过SPI来完成,我希望它可以工作。 I have a experience with Android, but not so much in SPI. 我有使用Android的经验,但没有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. 任何人都可以提供有关如何解决此问题的简短教程,或者向我指出一些资源,但是我找不到任何可以与Android中的sdcard通信的内容。

Thanks 谢谢

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. 在不安全(工程,遭到根攻击等)的设备上,如果您获得以root身份运行的帮助程序可执行文件,则可能会像android 4.4之前一样与文件系统或原始块设备进行交互,可能是在关闭了任何官方计算机后,与之交谈的Android组件。

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. 即使在不安全的设备上,您也将需要获取难以获得的SOC特定外设寄存器编程信息,以在SPI模式下(或者可能通过在GPIO模式下对引脚进行位撞)与卡进行通信,而不是通过更快的4-几乎肯定会使用的位协议。

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. 如果您想要受保护的设备支持的解决方法,则如果该设备支持USB主机模式,则可以获取适配器电缆和USB SD阅读器,并使用Android USB Host API谈论原始大容量存储命令。 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. 或者,如果USB大容量存储不能为您提供足够的细粒度控制,则可以使用FTDI USB串行芯片的SPI模式,或使用支持USB的微控制器进行自定义设置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM