1

我有一个 3G 调制解调器 (ZTE MF-210) 作为迷你 pci 子板插入我的平板电脑。

我正在尝试将其集成为我的开源 Android JB 移植项目的一部分:

https://groups.google.com/forum/?fromgroups=#!forum/renesas-emev-osp

因此,我通过添加以下配置选项修改了内核以包含 USB 串行 GSM 调制解调器支持:

CONFIG_USB_SERIAL=y
CONFIG_USB_SERIAL_WWAN=y
CONFIG_USB_SERIAL_OPTION=y

我已经包含了启用 3G 模块电源的代码(由 SoC GPIO 引脚控制)。至少据我所知,这部分看起来很有效。当调制解调器通电时,我在 dmesg 中得到这些日志:

6>usb 1-1.1: new high speed USB device using emxx-ehci-driver and address 9
<6>option 1-1.1:1.0: GSM modem (1-port) converter detected
<7>drivers/usb/serial/usb_wwan.c: usb_wwan_startup
<7>drivers/usb/serial/usb_wwan.c: usb_wwan_setup_urbs
<6>usb 1-1.1: GSM modem (1-port) converter now attached to ttyUSB0
<6>option 1-1.1:1.1: GSM modem (1-port) converter detected
<7>drivers/usb/serial/usb_wwan.c: usb_wwan_startup
<7>drivers/usb/serial/usb_wwan.c: usb_wwan_setup_urbs
<6>usb 1-1.1: GSM modem (1-port) converter now attached to ttyUSB1
<6>option 1-1.1:1.2: GSM modem (1-port) converter detected
<7>drivers/usb/serial/usb_wwan.c: usb_wwan_startup
<7>drivers/usb/serial/usb_wwan.c: usb_wwan_setup_urbs
<6>usb 1-1.1: GSM modem (1-port) converter now attached to ttyUSB2
<6>option 1-1.1:1.3: GSM modem (1-port) converter detected
<7>drivers/usb/serial/usb_wwan.c: usb_wwan_startup
<7>drivers/usb/serial/usb_wwan.c: usb_wwan_setup_urbs
<6>usb 1-1.1: GSM modem (1-port) converter now attached to ttyUSB3
<7>drivers/usb/serial/usb_wwan.c: usb_wwan_open
<7>drivers/usb/serial/usb_wwan.c: usb_wwan_dtr_rts
<7>drivers/usb/serial/usb_wwan.c: usb_wwan_set_termios
<7>drivers/usb/serial/usb_wwan.c: usb_wwan_write_room: 16384
<7>drivers/usb/serial/usb_wwan.c: usb_wwan_write: write (8 chars)
<7>drivers/usb/serial/usb_wwan.c: usb_wwan_write: endpoint 2 buf 0
<7>drivers/usb/serial/usb_wwan.c: usb_wwan_write: wrote (did 8)
<7>drivers/usb/serial/usb_wwan.c: usb_wwan_write_room: 12288
<7>drivers/usb/serial/usb_wwan.c: usb_wwan_write: write (1 chars)
<7>drivers/usb/serial/usb_wwan.c: usb_wwan_write: endpoint 2 buf 1
<7>drivers/usb/serial/usb_wwan.c: usb_wwan_outdat_callback
<7>drivers/usb/serial/usb_wwan.c: usb_wwan_write: wrote (did 1)
<7>drivers/usb/serial/usb_wwan.c: usb_wwan_outdat_callback
<7>drivers/usb/serial/usb_wwan.c: usb_wwan_indat_callback: c78f9640
<7>drivers/usb/serial/usb_wwan.c: usb_wwan_indat_callback: c78f9140
<7>drivers/usb/serial/usb_wwan.c: usb_wwan_indat_callback: c78f90c0
<7>drivers/usb/serial/usb_wwan.c: usb_wwan_write_room: 16384
<7>drivers/usb/serial/usb_wwan.c: usb_wwan_write: write (8 chars)
<7>drivers/usb/serial/usb_wwan.c: usb_wwan_write: endpoint 2 buf 0
<7>drivers/usb/serial/usb_wwan.c: usb_wwan_write: wrote (did 8)
...

请注意,我在 usb_wwan.c 中启用了调试

我在文件系统上得到以下信息:

# ls -l /dev/ttyUSB*                                          
crw-rw---- radio    radio    188,   0 2013-05-22 15:50 ttyUSB0
crw-rw---- radio    radio    188,   1 2013-05-22 15:51 ttyUSB1
crw-rw---- radio    radio    188,   2 2013-05-22 15:50 ttyUSB2
crw------- root     root     188,   3 2013-05-22 15:50 ttyUSB3

# cat /proc/tty/driver/usbserial                                
usbserinfo:1.0 driver:2.0
0: name:"GSM modem (1-port)" vendor:19d2 product:2003 num_ports:1 port:1 path:usb-emxx_ehci-1.1
1: name:"GSM modem (1-port)" vendor:19d2 product:2003 num_ports:1 port:1 path:usb-emxx_ehci-1.1
2: name:"GSM modem (1-port)" vendor:19d2 product:2003 num_ports:1 port:1 path:usb-emxx_ehci-1.1
3: name:"GSM modem (1-port)" vendor:19d2 product:2003 num_ports:1 port:1 path:usb-emxx_ehci-1.1

根据我在网上找到的一些信息(例如http://blog.csdn.net/vishtvro/article/details/7505915;我不确定如何直接验证,因为我没有 'lsusb -v ' 在 Android 操作系统上,busybox 没有帮助),四个端口对应于:

ttyUSB3: Modem
ttyUSB1: AT
ttyUSB0: Debug
ttyUSB2: VoUSB

问题是我无法使用“picocom”或“busybox microcom”与这些端口通信。我可以连接到它,但不能发送或接收命令:

# picocom /dev/ttyUSB1 -b 115200
picocom v1.6

port is        : /dev/ttyUSB1
flowcontrol    : none
baudrate is    : 115200
parity is      : none
databits are   : 8
escape is      : C-a
local echo is  : no
noinit is      : no
noreset is     : no
nolock is      : no
send_cmd is    : sz -vv
receive_cmd is : rz -vv
imap is        : 
omap is        : 
emap is        : crcrlf,delbs,

Terminal ready
<blinking cursor here>

在 usb_wwan.c 调试日志中报告键入字符,例如

<7>drivers/usb/serial/usb_wwan.c: usb_wwan_chars_in_buffer: 0
<7>drivers/usb/serial/usb_wwan.c: usb_wwan_write_room: 16384
<7>drivers/usb/serial/usb_wwan.c: usb_wwan_chars_in_buffer: 0
<7>drivers/usb/serial/usb_wwan.c: usb_wwan_write_room: 16384
<7>drivers/usb/serial/usb_wwan.c: usb_wwan_write: write (1 chars)
<7>drivers/usb/serial/usb_wwan.c: usb_wwan_write: endpoint 1 buf 0
<7>drivers/usb/serial/usb_wwan.c: usb_wwan_write: wrote (did 1)
<7>drivers/usb/serial/usb_wwan.c: usb_wwan_chars_in_buffer: 1
<7>drivers/usb/serial/usb_wwan.c: usb_wwan_write_room: 12288
<7>drivers/usb/serial/usb_wwan.c: usb_wwan_outdat_callback

但它不会在控制台上回显,如果我键入任何 AT 命令,我也不会得到任何结果。'AT' 应该返回 'OK' - 这是我的基本期望,但我什么也没看到。

我在网上和 stackexchange 上搜索了很长时间,但直到现在都找不到任何有用的提示。

有关如何调试此问题的任何建议?

注意 - 在库存 GB Android 固件上,调制解调器按预期工作 - 不幸的是我没有那个 GB 代码......

提前致谢!

4

0 回答 0