简体   繁体   English

使用三星设备在Android上运行avrdude

[英]Run avrdude on Android with Samsung devices

Hi members of stackoverflow.com! 您好stackoverflow.com的成员!

I try to build an app in Android that can upload HEX file generated by avr-gcc. 我尝试在Android中构建一个可以上传由avr-gcc生成的HEX文件的应用程序。 I installed the AndAVR this chaintool http://code.google.com/p/andavr/ 我安装了这个链工具AndAVR http://code.google.com/p/andavr/

to run avrdude (in root devices with USB-OTG cable) I use this command in mobile terminal: 运行avrdude(在具有USB-OTG电缆的根设备中)我在移动终端中使用以下命令:

/data/data/jackpal.androidterm/local/bin/avrdude -F -V -c arduino -p m2560 -P /dev/bus/usb/002/001  -b 115200 -C /data/data/jackpal.androidterm/local/etc/avrdude.conf -U flash:w:/sdcard/megademo/Blink1.cpp.hex

and after Read this post Android cannot talk to Arduino using AVRDUDE I try the solution and change the /dev/bus/usb/002/002 by /dev/ttyACM0. 在阅读了这篇文章之后, Android无法使用AVRDUDE与Arduino对话,我尝试了解决方案,并通过/ dev / ttyACM0更改了/ dev / bus / usb / 002/002。

/data/data/jackpal.androidterm/local/bin/avrdude -F -V -c arduino -p m2560 -P /dev/ttyACM0  -b 115200 -C /data/data/jackpal.androidterm/local/etc/avrdude.conf -U flash:w:/sdcard/megademo/Blink1.cpp.hex

But avrdude answer me with: 但是avrdude回答我:

avrdude: ser_open(): can't open device "unkown". No such file or directory. 

I have a Arduino Mega 2560 and Mega ADK 2560 R3, both boards have a ATmega2560 microcontollers and I have a: 我有一个Arduino Mega 2560和Mega ADK 2560 R3,这两块板都有一个ATmega2560微控制器,我有:

  • Samsumg Galaxy S2 run Android 4.1.2 stock with root Samsumg Galaxy S2使用root运行Android 4.1.2股票
  • Samsumg Galaxy S3 run Android 4.1.2 stock with root Samsumg Galaxy S3以root运行Android 4.1.2股票
  • Samsumg Galaxy Tab Note 10.1 run Android 4.1.2 stock without root Samsumg Galaxy Tab Note 10.1在没有root的情况下运行Android 4.1.2股票
  • Asus Transfomer Pad TF700T run Android 4.2.1 stock without root 华硕Transfomer Pad TF700T无根运行Android 4.2.1股票

the problem is that Samsung devices doesn't enumerate the Arduino board and the Asus tab yes. 问题是三星设备无法枚举Arduino开发板,而华硕标签是。

In all devices I run the command in mobile terminal: 在所有设备中,我在移动终端中运行命令:

cat /proc/tty/drivers

and Asus present the specific driver: 华硕提供了具体的驱动程序:

ACM /dev/ttyACM 166 0-31 serial

this driver doesn't show in Samsung devices, well this driver is essential to upload the hex file to Arduino board, so How can I install this driver in Samsung devices? 该驱动程序未在Samsung设备中显示,那么该驱动程序对于将hex文件上传到Arduino板是必不可少的,那么如何在三星设备中安装该驱动程序? or how can I upload the hex file? 或如何上传十六进制文件?

Android in all devices create a file in /dev/bus/USB/002/xxx where xxx is the Arduino board or other USB device. 所有设备中的Android在/ dev / bus / USB / 002 / xxx中创建一个文件,其中xxx是Arduino开发板或其他USB设备。

Best regards! 最好的祝福!

If you want to use this method, you need to load the cdc_acm kernel module - which probably was not supplied with your device, so you will have to build it. 如果要使用此方法,则需要加载cdc_acm内核模块-可能不是设备随附的,因此必须对其进行构建。 And then create the corresponding /dev/ttyACM0 device node, since the daemon that would do that on a desktop linux probably isn't there. 然后创建相应的/ dev / ttyACM0设备节点,因为在台式机Linux上可能不存在的守护进程不存在。 You will need root to do these things, and moderately close kernel sources to compile from. 您将需要root来执行这些操作,并适度关闭内核源以进行编译。

Another approach might be to implement CDC_ACM type communication in user mode from an Android app using the Android USB Host APIs if those are supported on your device. 如果您的设备支持Android USB Host API,则另一种方法可能是使用Android USB Host API在Android应用程序中以用户模式实现CDC_ACM类型的通信。 This would be a more "android style" solution, but would require some changes to avrdude, since it will have to do communication via an Android-aware backend service packaged in an app. 这将是一个更具“ android风格”的解决方案,但将需要对avrdude进行一些更改,因为它必须通过打包在应用中的可识别Android的后端服务进行通信。

Also note that CDC_ACM is used by the recent arduinos (Uno, etc) and a minority of clones; 还要注意,最近的arduinos(Uno等)和少数克隆都使用CDC_ACM。 older Arduino boards and the majority of clones use FTDI USB-serial converters and require ftdi driver modules or protocols. 较旧的Arduino开发板和大多数克隆使用FTDI USB串行转换器,并且需要ftdi驱动程序模块或协议。

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

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