❶ 为什么tiny4412在用sd卡烧写android时,串口终端没有显示进度
1. Build uboot
a) 安装好toolchain (arm-linux-gcc-4.5.1-v6-vfp-20120301.tgz)并设置好
环境变量PATH,保证可以正常使用。
b) 解压 uboot_tiny4412-20130729.tgz 并进入相应的目录
tar xzf uboot_tiny4412-20130729.tgz
c) 配置 uboot 并编译
cd uboot_tiny4412
make tiny4412_config
make
d) 编译 用于生成bl2 的工具
make -C sd_fuse
或者
cd sd_fuse; make
-----------------------------------------------------
2. 制作启动 Tiny4412 的SD卡
a) 先准备一张4G或以上的SDHC卡
注意:该卡的已有数据将会被破坏,因此请先对SD卡上的数据进行备份。
b) fusing SD card
假设SD卡已被PC Linux识别为/dev/sdb, 以root用户运行以下命令即可:
cd sd_fuse/tiny4412
./sd_fusing.sh /dev/sdb
-----------------------------------------------------
3. 使用SD卡启动 Tiny4412 并烧写Android
a) 将已经制作好的SD卡插到 Tiny4412 板上,拨动S2切换到SDBOOT,同时连接
串口线到PC且假设已经准备好。
b) 开发板加电,然后在串口控制台(如minicom),按任意键进入uboot 命令行模式
c) 对SD卡进行分区
输入以下uboot命令即可对SD卡进行分区:
fdisk -c 0 320 806 518
重新分区后,可重新格式化FAT分区
fatformat mmc 0:1
d) 进入fastboot模式以烧写Android
使用USB线连接Tiny4412的MICRO_USB口到PC,然后输入以下uboot命令:
fastboot
e) 烧写 Android 到SD卡
首先请准备好Android image,包括: zImage, ramdisk-u.img, system.img
在PC端输入以下命令进行烧写:
fastboot flash kernel zImage (烧写kernel)
fastboot -w (格式化userdata和cache)
fastboot flash ramdisk ramdisk-u.img (烧写ramdisk)
fastboot flash system system.img (烧写system)
f) 也可以在PC端通过fastboot烧写uboot到SD卡
先手动生成bl2.bin
cd sd_fuse/tiny4412
../mkbl2 ../../u-boot.bin bl2.bin 14336
然后输入以下命令:
fastboot flash fwbl1 E4412_N.bl1.bin
fastboot flash bl2 bl2.bin
fastboot flash bootloader ../../u-boot.bin
fastboot flash tzsw E4412_tzsw.bin
-----------------------------------------------------
4. 使用SD卡启动 Android
a) 如果是使用HD700,则烧写完成后直接重启Tiny4412 即可自动启动 Android
b) 如果是使用S700,则需要在uboot上设置kernel命令行参数:
setenv bootargs console=ttySAC0,115200n8 androidboot.console=ttySAC0 lcd=S700
saveenv
然后重启Tiny4412即可。
❷ android串口消息
android串口消息连接的方法为:
1.模拟器可以使用PC的串口。
启动模拟器并加载PC串口 命令如下。
运行 emulator @模拟器名称 -qmu -serial COM1。
2.查看串口是否被加载。
启动后使用 adb shell 命令打开命令行
cd dev 查看会发现ttyS0 ttyS1 ttyS2,其他ttyS2 就是我们加载上来的串口COM1
3.修改权限
chmod 777 ttyS2
现在我们可以开发串口程序了。
4.串口程序实例
下载libserial_port.so ,放入libs/armeabi 目录,可以自己创建此目录
libserial_port.so 下载地址:
http://code.google.com/p/android-serialport-api/
import java.io.File;
import java.io.FileDescriptor;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import android.util.Log;
public class SerialPort {
private static final String TAG = "SerialPort";
private FileDescriptor mFd;
private FileInputStream mFileInputStream;
private FileOutputStream mFileOutputStream;
public SerialPort(File device, int baudrate) throws SecurityException, IOException {
if (!device.canRead() || !device.canWrite()) {
try {
Process su;
su = Runtime.getRuntime().exec("/system/bin/su");
String cmd = "chmod 666 " + device.getAbsolutePath() + "n"
+ "exitn";
su.getOutputStream().write(cmd.getBytes());
if ((su.waitFor() != 0) || !device.canRead()
|| !device.canWrite()) {
throw new SecurityException();
}
} catch (Exception e) {
e.printStackTrace();
throw new SecurityException();
}
}
mFd = open(device.getAbsolutePath(), baudrate);
if (mFd == null) {
Log.e(TAG, "native open returns null");
throw new IOException();
}
mFileInputStream = new FileInputStream(mFd);
mFileOutputStream = new FileOutputStream(mFd);
}
public InputStream getInputStream() {
return mFileInputStream;
}
public OutputStream getOutputStream() {
return mFileOutputStream;
}
//JNI
private native static FileDescriptor open(String path, int baudrate);
public native void close();
static {
System.loadLibrary("serial_port");
}
}
####################################
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
public class PrintClass {
//输入流
private static InputStream in;
//输出流
private static OutputStream out;
private static final String PORT = "/dev/ttyS2";//串口
private SerialPort serialPort;
private void Connect()
{
try {
serialPort = new SerialPort(new File(PORT), 38400);
in = serialPort.getInputStream();
out = serialPort.getOutputStream();
} catch (SecurityException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
public void CloseSerialPort()
{
try {
out.close();
in.close();
serialPort.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
❸ android开启usb转串口如何配置kernel
1. 如果是linux,不需要单独安装什么串口驱动 2. 但需要使用ls /dev/tty * 查看usb 串口设备是否被检测到 2. 然后使用linux下的MINICOM进行串口信息打印,具体配置和用法可以一下
❹ 通过minicom怎么运行android设备上的monkey测试工具
连好minicom之后,minicom应该会进入device的shell,在那下面直接用monkey命令就可以的。如果需要保存logcat的话,打个logcat就可以了。
❺ 怎么查看android 设备的串口
1. 如果是linux,不需要单独安装什么串口驱动
2. 但需要使用ls /dev/tty * 查看usb 串口设备是否被检测到
2. 然后使用linux下的MINICOM进行串口信息打印,具体配置和用法可以一下
❻ 求串口调试软件,可以用手机或平板连串口线配置交换机、路由器、UPS等,linux有MINICOM,
串口?手机或者平板应该是没这个功能了吧?
而且貌似也没有那个平板或者手机能支持 USB 转串口的硬件。
只能是试试买个支持 USB Host 的平板,之后自己尝试装上 ubuntu 一类的通用系统的 arm 版,再自己编译内核打开 USB 串口转换器的驱动。从而实现支持。