Difference between revisions of "IoTGateway/Features/Linux/Module"
Weichih.lin (talk | contribs) |
(→AIW-W154) |
||
(84 intermediate revisions by 7 users not shown) | |||
Line 1: | Line 1: | ||
− | |||
== 3G == | == 3G == | ||
=== EWM-C106FT01E === | === EWM-C106FT01E === | ||
+ | |||
+ | pppd connect 'chat -v -s -t 10 "" "AT" "" "ATDT*99#" "CONNECT" ""' user username password password /dev/ttyUSB2 460800 nodetach crtscts debug usepeerdns defaultroute & | ||
+ | |||
+ | === EWM-C109FT01E === | ||
+ | |||
+ | pppd connect 'chat -v -s -t 10 "" "AT" "" "ATDT*99#" "CONNECT" ""' user username password password /dev/ttyUSB3 460800 nodetach crtscts debug usepeerdns defaultroute & | ||
=== Sierra AirPrime MC8090 === | === Sierra AirPrime MC8090 === | ||
Line 38: | Line 43: | ||
# ifconfig | # ifconfig | ||
</syntaxhighlight> [[File:Sierra AirPrime MC8090 ifconfig.png|600px|Sierra AirPrime MC8090 ifconfig.png]]<syntaxhighlight lang="text"> | </syntaxhighlight> [[File:Sierra AirPrime MC8090 ifconfig.png|600px|Sierra AirPrime MC8090 ifconfig.png]]<syntaxhighlight lang="text"> | ||
− | # | + | # ping -c5 8.8.8.8 |
</syntaxhighlight> [[File:Sierra AirPrime MC8090 ping.png|500px|Sierra AirPrime MC8090 ping.png]]</div> | </syntaxhighlight> [[File:Sierra AirPrime MC8090 ping.png|500px|Sierra AirPrime MC8090 ping.png]]</div> | ||
=== Telit HE910-D === | === Telit HE910-D === | ||
Line 160: | Line 165: | ||
</pre> | </pre> | ||
− | ==4G== | + | == 4G == |
− | ===AM Telecom AMM561KT=== | + | |
+ | === Telit LE910C4 === | ||
+ | |||
+ | ;For Yocto 2.5 and later | ||
+ | |||
+ | We have to enable '''CONFIG_USB_SERIAL_OPTION=y''' | ||
+ | |||
+ | ;Using command as below to connect | ||
+ | : | ||
+ | |||
+ | Setup APN | ||
+ | |||
+ | echo -e "AT+CGDCONT=2,\"ip\",\"internet\"\r\n" >/dev/ttyUSB2 | ||
+ | |||
+ | Connect | ||
+ | |||
+ | pppd connect 'chat -v -s -t 10 "" "AT" "" "ATDT*99***2#" "CONNECT" ""' user username password password /dev/ttyUSB2 460800 nodetach crtscts debug usepeerdns defaultroute & | ||
+ | |||
+ | ==== For EPC-R7200 ==== | ||
+ | |||
+ | [[:File:Telit_le910c4_on_EPCR7200.pdf|File:Telit_le910c4_on_EPCR7200.pdf]] | ||
+ | |||
+ | === Sierra AirPrime MC7304 === | ||
+ | |||
+ | ;For Yocto 1.8 | ||
+ | |||
+ | We have to enable '''CONFIG_USB_SERIAL_QUALCOMM=m''' | ||
+ | |||
+ | ;For Yocto 2.0 and later | ||
+ | |||
+ | We have to enable '''CONFIG_USB_SERIAL_OPTION=y''' | ||
+ | |||
+ | |||
+ | |||
+ | ;Using command as below to connect | ||
+ | : | ||
+ | |||
+ | pppd connect 'chat -v -s -t 10 "" "AT" "" "ATDT*99#" "CONNECT" ""' user username password password /dev/ttyUSB2 460800 nodetach crtscts debug usepeerdns defaultroute & | ||
+ | |||
+ | === Sierra AirPrime MC7430 === | ||
+ | |||
+ | Modify drivers/usb/serial/option.c | ||
+ | |||
+ | --- a/drivers/usb/serial/option.c | ||
+ | +++ b/drivers/usb/serial/option.c | ||
+ | @@ -1123,6 +1123,8 @@ static const struct usb_device_id option_ids[] = { | ||
+ | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9000)}, /* SIMCom SIM5218 */ | ||
+ | { USB_DEVICE_INTERFACE_CLASS(SIERRA_VENDOR_ID, 0x68c0, 0xff), | ||
+ | .driver_info = (kernel_ulong_t)&sierra_mc73xx_blacklist }, /* MC73xx */ | ||
+ | + { USB_DEVICE_INTERFACE_CLASS(SIERRA_VENDOR_ID, 0x9071, 0xff), | ||
+ | + .driver_info = (kernel_ulong_t)&sierra_mc73xx_blacklist }, /* MC7430 */ | ||
+ | { USB_DEVICE_INTERFACE_CLASS(SIERRA_VENDOR_ID, 0x9041, 0xff), | ||
+ | .driver_info = (kernel_ulong_[[:File:4G_rndis.zip]])&sierra_mc73xx_blacklist }, /* MC7305/MC7355 */ | ||
+ | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6001) }, | ||
+ | |||
+ | === Sierra AirPrime EM7565 === | ||
+ | |||
+ | Verified on RSB-4760 (Qualcomm db410c) | ||
+ | |||
+ | [https://github.com/ADVANTECH-Corp/meta-advantech/tree/krogoth/meta-qcom-410c/recipes-devtools Drivers in Yocto 2.1] | ||
+ | |||
+ | [https://github.com/ADVANTECH-Corp/meta-advantech/blob/krogoth/meta-tools/recipes-test/3g-script/files/sierra-em7565.sh Script for data connection] | ||
+ | |||
+ | === AM Telecom AMM561KT === | ||
+ | |||
The following operations are performed with UBC-222(U222LBV2011). | The following operations are performed with UBC-222(U222LBV2011). | ||
− | * linux kernel config | + | |
− | <tt><small> | + | *linux kernel config |
− | + | ||
− | :::[*] USB support | + | |
− | ::::<span style="color:red">''' | + | |
− | :::[*] Network device support | + | ::<tt><small>Device Drivers ---></small></tt> |
− | ::::USB Network Adapters | + | :::<tt><small>[*] USB support ---></small></tt> |
− | :::::<M | + | ::::<tt><small><span style="color:red">'''<M> Support for Host-side USB'''</span></small></tt> |
− | :::::<M | + | :::<tt><small>[*] Network device support ---></small></tt> |
− | </small> | + | ::::<tt><small>USB Network Adapters ---></small></tt> |
− | </tt> | + | :::::<tt><small><M> Multi-purpose USB Networking Framework</small></tt> |
− | * load drivers | + | :::::<tt><small><M> Host for RNDIS and ActiveSync devices (EXPERIMENTAL)</small></tt> |
− | <div style="margin-left: 2em | + | |
+ | |||
+ | |||
+ | *load drivers | ||
+ | <div style="margin-left: 2em"> | ||
# rmmod usbserial | # rmmod usbserial | ||
# modprobe rndis_host | # modprobe rndis_host | ||
# modprobe usbserial vendor=0x1ECB product=0x0205 | # modprobe usbserial vendor=0x1ECB product=0x0205 | ||
− | e.g. put the 3 lines to /etc/rc.local<br> | + | e.g. put the 3 lines to /etc/rc.local<br/>[[File:AMM561KT load drivers.png|720px|AMM561KT load drivers.png]] |
− | [[File: | ||
</div> | </div> | ||
− | * list usb devices | + | *list usb devices |
− | <div style="margin-left: 2em | + | <div style="margin-left: 2em"> |
# lsusb | # lsusb | ||
# ll /dev/ttyUSB[012] | # ll /dev/ttyUSB[012] | ||
− | [[File: | + | [[File:AMM561KT list usb devices.png|600px|AMM561KT list usb devices.png]] |
</div> | </div> | ||
+ | === Fibocom NL668 === | ||
+ | |||
+ | *[[:File:Fibocom_NL668.docx|Fibocom_NL668]] | ||
+ | |||
+ | === EWM-C145 === | ||
+ | |||
+ | *[[:File:EWM-4G_porting_guide_on_DS100_new.docx|EWM-4G_Porting_Guide_On_DS100]] | ||
+ | |||
+ | === EWM-C117 === | ||
+ | |||
+ | Default RNDIS Mode | ||
+ | |||
+ | Use the script to connect to internet | ||
+ | |||
+ | [[:File:4G_rndis.zip]] | ||
+ | |||
+ | Change to normal mode | ||
+ | |||
+ | [[:File:module-ewm-117-for-ppp.zip]] | ||
+ | |||
+ | Connect to internet by pppd demand | ||
+ | |||
+ | [[:File:4G_ppp.zip]] | ||
+ | |||
+ | ==== Reference from AE Phill ==== | ||
+ | |||
+ | [[:File:RSB-4220_EWM-C117.docx]] | ||
+ | |||
+ | [[:File:EWM-C117_RSB-4760_internaluse.docx|:File:EWM-C117 RSB-4760 internaluse.docx]] | ||
+ | |||
+ | ==== Made from RD ==== | ||
+ | |||
+ | [[:File:EWM-C117_for_RK3399_ds100.docx|File:EWM-C117_for_RK3399_ds100.docx]] | ||
== Bluetooth == | == Bluetooth == | ||
Line 198: | Line 303: | ||
=== AW-CB178NF === | === AW-CB178NF === | ||
+ | |||
+ | ==== Porting AzureWave Wifi BT module ==== | ||
1. Add compile option ins arch/arm/configs/imx_v7_adv_deconfig | 1. Add compile option ins arch/arm/configs/imx_v7_adv_deconfig | ||
− | <pre> | + | <pre>… |
CONFIG_BT_HIDP=y | CONFIG_BT_HIDP=y | ||
CONFIG_BT_HCIBTUSB=y | CONFIG_BT_HCIBTUSB=y | ||
Line 229: | Line 336: | ||
2. Modify in arch/arm/boot/dts/imx6qdl-advantech.dtsi | 2. Modify in arch/arm/boot/dts/imx6qdl-advantech.dtsi | ||
− | <pre> usdhc1 { | + | <pre>... |
+ | usdhc1 { | ||
pinctrl_usdhc1_1: usdhc1grp-1 { | pinctrl_usdhc1_1: usdhc1grp-1 { | ||
fsl,pins = < | fsl,pins = < | ||
Line 241: | Line 349: | ||
}; | }; | ||
}; | }; | ||
+ | ... | ||
</pre> | </pre> | ||
Line 264: | Line 373: | ||
</pre> | </pre> | ||
− | ==WiFi== | + | ==== Testing Operations ==== |
− | ===EWM-W142F01E=== | + | <pre>hciconfig hci0 up |
− | ===EWM-W151H01E=== | + | hcitool dev | grep hci |
− | ===EWM-W155H01E=== | + | hcitool scan |
+ | </pre> | ||
+ | |||
+ | [[File:BT.JPG|RTENOTITLE]] | ||
+ | |||
+ | == WiFi == | ||
+ | |||
+ | === EWM-W142F01E === | ||
+ | |||
+ | For Yocto 1.8 | ||
+ | |||
+ | Check wlan0 existing or not<br/> # ifconfig wlan0 up | ||
+ | |||
+ | #ifconfig<br/># wpa_passphrase "ASUS_RISC_SOM_ESBC_2.4" 1qaz2wsx > /tmp/wpa.conf<br/>#wpa_supplicant -BDwext -iwlan0 -c/tmp/wpa.conf<br/># cat /tmp/wpa.conf<br/># udhcpc -b -i wlan0 | ||
+ | |||
+ | Check wlan0 working or not<br/># ifconfig wlan0<br/># ping 8.8.8.8 | ||
+ | |||
+ | ==== For Debian 8 ==== | ||
+ | |||
+ | # apt-get update <br/> # apt-get install network-manager-gnome | ||
+ | |||
+ | Check wlan0 existing or not<br/> # ifconfig wlan0 up | ||
+ | |||
+ | #ifconfig<br/># wpa_passphrase "ASUS_RISC_SOM_ESBC_2.4" 1qaz2wsx > /tmp/wpa.conf<br/>#wpa_supplicant -BDwext -iwlan0 -c/tmp/wpa.conf<br/># cat /tmp/wpa.conf<br/># dhclient wlan0 | ||
+ | |||
+ | ==== ==== | ||
+ | |||
+ | === EWM-W151H01E === | ||
+ | |||
+ | === EWM-W155H01E === | ||
+ | |||
+ | === EWM-W157H01E === | ||
+ | |||
+ | Support WiFi and BT function on Yocto 2.1. | ||
+ | |||
+ | For Yocto 2.1 | ||
+ | |||
+ | Check wlan0 existing or not<br/> # ifconfig wlan0 up | ||
+ | |||
+ | #ifconfig<br/># wpa_passphrase "ASUS_RISC_SOM_ESBC_2.4" 1qaz2wsx > /tmp/wpa.conf<br/>#wpa_supplicant -BDwext -iwlan0 -c/tmp/wpa.conf<br/># cat /tmp/wpa.conf<br/># udhcpc -b -i wlan0 | ||
+ | |||
+ | Check wlan0 working or not<br/># ifconfig wlan0<br/># ping 8.8.8.8 | ||
+ | |||
+ | === EWM-W163M201E === | ||
+ | |||
+ | [[:File:EWM-W163M201E_porting_guide_on_DS100.docx|EWM-W163M201E_porting_guide_on_DS100.docx]] | ||
+ | |||
+ | === EWM-W168 === | ||
+ | |||
+ | [[:File:EWM-W168_rsb4411.pptx|EWM-W168_rsb4411.pptx]] | ||
+ | |||
+ | === EWM-W170 === | ||
+ | |||
+ | [[:File:EWM-W170_WIFI_porting_guide_for_imx6_Yocto2.5.docx|EWM-W170_WIFI_porting_guide_for_imx6.docx]] | ||
+ | |||
+ | [[:File:Qcacld-2.0-SparkLAN-4.5.25.33.tar.xz|EWM-W170_WIFI_Sparklan_Driver]] | ||
+ | |||
+ | === EWM-W188 === | ||
+ | |||
+ | [[:File:EWM-W188_Bluetooth_porting_guide_for_ds100-debian.docx|File:EWM-W188_Bluetooth_porting_guide_for_ds100-debian.docx]] | ||
+ | |||
+ | [[:File:EWM-W188_RSB4710_Android10.docx|File:EWM-W188_RSB4710_Android10.docx]] | ||
+ | |||
+ | === AIW-W154 === | ||
+ | Yocto 3.0 | ||
+ | |||
+ | [[:File:AIW154_WIFIBT_v2.docx|AIW154_WIFIBT_v2.docx]] | ||
+ | |||
+ | Yocto 3.3 | ||
+ | |||
+ | [[:File:AIW154_WIFIBT_kernel_5_10.docx|AIW154_WIFIBT_kernel_5_10.docx]] | ||
+ | |||
+ | === AIW-W165 === | ||
+ | |||
+ | The AIW-W165 (Support OS is Yocto3.3) | ||
+ | |||
+ | WIFI Test Command | ||
+ | |||
+ | #modprobe moal mod_para=nxp/wifi_mod_para.conf | ||
+ | |||
+ | #iwconfig | ||
+ | |||
+ | #ifconfig mlan0 up | ||
+ | #wpa_passphrase "XX" yy >/tmp/wpa.conf (XX is WIFI ESSID , yy is password) | ||
+ | #ifconfig eth0 down | ||
+ | #wpa_supplicant -d -B -imlan0 -c /tmp/wpa.conf -Dnl80211 | ||
+ | #udhcpc -imlan0 | ||
+ | |||
+ | BT Test Command | ||
+ | |||
+ | #modprobe moal mod_para=nxp/wifi_mod_para.conf | ||
+ | #hciattach /dev/ttymxc2 any 3000000 3000000 flow | ||
+ | #hciconfig hci0 up | ||
+ | #hcitool scan | ||
+ | |||
+ | == TOUCH == | ||
+ | |||
+ | === EETI_eGTouch === | ||
+ | |||
+ | [[:File:EETI_Touch_porting_guide_on_Android_10.docx|File:EETI_Touch_porting_guide_on_Android_10.docx]] | ||
+ | |||
+ | == USB == | ||
+ | |||
+ | === EMIO-200U3 === | ||
− | |||
− | |||
Set CONFIG_USB_XHCI_HCD=y in kernel config | Set CONFIG_USB_XHCI_HCD=y in kernel config | ||
+ | |||
+ | == ADC == | ||
+ | |||
+ | === USB-4702/4704 & USB-4761 === | ||
+ | |||
+ | ==== Driver Confirmation ==== | ||
+ | |||
+ | 1. Make sure the DAQ device driver has been loaded by the kernel | ||
+ | |||
+ | [[File:Lsmod 4704 1.png|400x500px|lsmod_4704_1.png]] | ||
+ | |||
+ | 2. If login by normal user (not root user), you have to place '''drivers\driver_base\src\lnx_ko\71-bionic-daq.rules''' | ||
+ | |||
+ | to '''/etc/udev/rules.d/''' in Root File System | ||
+ | |||
+ | 3. Make sure the DAQ driver has been successfully matched with the DAQ device. | ||
+ | |||
+ | [[File:Daq device.png|300x400px|daq_device.png]] | ||
+ | |||
+ | ==== Change Device Description ==== | ||
+ | |||
+ | To check deviceDescription | ||
+ | |||
+ | cat /sys/class/daq/daq0/desc | ||
+ | |||
+ | and change deviceDescription of your device in sample codes | ||
+ | |||
+ | example: | ||
+ | |||
+ | #define deviceDescription L"USB-4704,BID#0" | ||
+ | |||
+ | ==== Compile sample code ==== | ||
+ | |||
+ | First, download the package for specific platform, e.g. arm64-oecore or TI am335x. | ||
+ | |||
+ | [[:File:Linux_driver_source_3.2.10.6_arm64-oecore.zip|ZIP for arm64-oecore]] | ||
+ | |||
+ | [[:File:linux_driver_source_3.2.10.7_poky_2.1.1.tar.gz|ZIP for Poky2.1.1]] | ||
+ | |||
+ | [[:File:Linux_driver_source_3.2.13.1_-armv7ahf.zip|ZIP for TI am335x]] | ||
+ | |||
+ | These libraries in '''./libs''' are only for specific platform and have to be copied into '''/usr/lib/''' in Root File System | ||
+ | |||
+ | If you want to support on other platforms (ex: i.MX6 ...), please contact with Advantech. | ||
+ | |||
+ | *'''[RSB-4760]''' | ||
+ | |||
+ | Set-up arm64-oecore environment | ||
+ | |||
+ | source <span style="color:purple">'''[your cross-compiler path]'''</span>/environment-setup-aarch64-oe-linux | ||
+ | |||
+ | Compile sample code | ||
+ | |||
+ | <span style="color:purple">'''[your cross-compiler path]'''</span>/sysroots/x86_64-oesdk-linux/usr/bin/aarch64-oe-linux/aarch64-oe-linux-g++ -o <span style="color:purple">'''$Example_NAME'''</span> <span style="color:purple">'''$Example_NAME'''</span>.cpp \ | ||
+ | --sysroot=<span style="color:purple">'''[your cross-compiler path]'''</span>/sysroots/aarch64-oe-linux/ \ | ||
+ | -I <span style="color:purple">'''[your cross-compiler path]'''</span>/sysroots/aarch64-oe-linux/usr/include/ \ | ||
+ | -L <span style="color:purple">'''[your cross-compiler path]'''</span>/sysroots/aarch64-oe-linux/usr/lib/ \ | ||
+ | -L '''<span style="color:purple">[USB-4704 driver source path]</span>'''/libs \ | ||
+ | -lbiodaq | ||
+ | |||
+ | *'''[RSB-4220 / UBC-330]''' | ||
+ | |||
+ | Compile sample code | ||
+ | |||
+ | <span style="color:purple">'''[your cross-compiler path]'''</span>/sysroots/x86_64-arago-linux/usr/bin/arm-linux-gnueabihf-g++ -o <span style="color:purple">'''$Example_NAME'''</span> <span style="color:purple">'''$Example_NAME'''</span>.cpp \ | ||
+ | --sysroot=<span style="color:purple">'''[your cross-compiler path]'''</span>/sysroots/armv7ahf-neon-linux-gnueabi/ \ | ||
+ | -I <span style="color:purple">'''[your cross-compiler path]'''</span>/sysroots/armv7ahf-neon-linux-gnueabi/usr/include/ \ | ||
+ | -L <span style="color:purple">'''[your cross-compiler path]'''</span>/sysroots/armv7ahf-neon-linux-gnueabi/usr/lib/ \ | ||
+ | -L '''<span style="color:purple">[USB-4704 driver source path]</span>'''/libs \ | ||
+ | -lbiodaq | ||
+ | |||
+ | ==== Example List ==== | ||
+ | |||
+ | For simple test, you can use AO_StaticAO to see if the output voltage of AO0 changes automatically. | ||
+ | |||
+ | *'''For USB-4702/4704''' | ||
+ | |||
+ | [[File:Usb-4704.png|800x1000px|usb-4704_1.png]] | ||
+ | |||
+ | *'''For USB-4761''' | ||
+ | |||
+ | [[File:Usb-4761.png|800x1000px|usb-4761_1.png]] | ||
+ | <div id="gtx-trans" style="position: absolute; left: 732px; top: 12061px;"><div class="gtx-trans-icon"></div></div> |
Latest revision as of 10:21, 13 June 2023
3G
EWM-C106FT01E
pppd connect 'chat -v -s -t 10 "" "AT" "" "ATDT*99#" "CONNECT" ""' user username password password /dev/ttyUSB2 460800 nodetach crtscts debug usepeerdns defaultroute &
EWM-C109FT01E
pppd connect 'chat -v -s -t 10 "" "AT" "" "ATDT*99#" "CONNECT" ""' user username password password /dev/ttyUSB3 460800 nodetach crtscts debug usepeerdns defaultroute &
Sierra AirPrime MC8090
The following operations are performed with UBC-221 using U221LBV1050.
- linux kernel config
- set the following lines to meta-advantech/recipes-kernel/linux/linux-yocto-clanton/advantech.cfg
CONFIG_USB_SERIAL_FTDI_SIO=m
CONFIG_USB_SERIAL_SIERRAWIRELESS=m
- add the following line to meta-advantech/recipes-kernel/advantech-init/files/advantech.conf
sierra
- execute the following command
$ bitbake advantech-init
- rebuild the kernel
$ bitbake linux-yocto-clanton
- rebuild the full image
$ bitbake image-full
- practical test on target board
# pppd connect 'chat -v -s -t 10 "" "AT" "" "ATDT*99#" "CONNECT" ""' \
user username password password /dev/ttyUSB3 460800 nodetach crtscts debug usepeerdns defaultroute &
# ifconfig
# ping -c5 8.8.8.8
Telit HE910-D
The following operations are performed with UBC-221 using U221LBV1050.
- practical test on target board
# modprobe cdc-acm
# dmesg | grep ttyACM
# pppd connect 'chat -v -s -t 10 "" "AT" "" "ATDT*99#" "CONNECT" ""' \
user username password password /dev/ttyACM0 460800 nodetach crtscts debug usepeerdns defaultroute &
# pinc -c5 8.8.8.8
Quectel UC20
3G module Porting (QUECTEL UC20)
In linux kernel
1. You need to add the mechanism for processing zero packets during transmission of “usb_wwan.c” file under “[KERNEL]/drivers/usb/serial”.
You need to add the following statements to the “usb_wwan_write” and “usb_wwan_setup_urb” function, as shown below:
… #include "usb-wwan.h" + #ifdef CONFIG_ARCH_ADVANTECH + #define HW_bcdUSB 0x0110 + #define HUAWEI_VENDOR_ID 0x12d1 + #endif void usb_wwan_dtr_rts(struct usb_serial_port *port, int on) … … … int usb_wwan_write(struct tty_struct *tty, struct usb_serial_port *port, const unsigned char *buf, int count) { … … int left, todo; struct urb *this_urb = NULL; /* spurious */ + #ifdef CONFIG_ARCH_ADVANTECH + struct usb_host_endpoint *ep=NULL; + #endif int err; unsigned long flags; … … … /* send the data */ memcpy(this_urb->transfer_buffer, buf, todo); this_urb->transfer_buffer_length = todo; + #ifdef CONFIG_ARCH_ADVANTECH + if (IS_RSB_6410) + { + if((HUAWEI_VENDOR_ID == port->serial->dev->descriptor.idVendor) + && (HW_bcdUSB != port->serial->dev->descriptor.bcdUSB)){ + ep = usb_pipe_endpoint(this_urb->dev, this_urb->pipe); + if(ep && (0 != this_urb->transfer_buffer_length) + && (0 == this_urb->transfer_buffer_length % + ep->desc.wMaxPacketSize)){ + this_urb->transfer_flags |= URB_ZERO_PACKET; + } + } + } + #endif spin_lock_irqsave(&intfdata->susp_lock, flags); if (intfdata->suspended) { usb_anchor_urb(this_urb, &portdata->delayed); … … … } … … … /* Helper functions used by usb_wwan_setup_urbs */ static struct urb *usb_wwan_setup_urb(struct usb_serial_port *port, int endpoint, int dir, void *ctx, char *buf, int len, void (*callback) (struct urb *)) { struct usb_serial *serial = port->serial; struct urb *urb; urb = usb_alloc_urb(0, GFP_KERNEL); /* No ISO */ if (!urb) return NULL; /* Fill URB using supplied data. */ usb_fill_bulk_urb(urb, serial->dev, usb_sndbulkpipe(serial->dev, endpoint) | dir, buf, len, callback, ctx); + #ifdef CONFIG_ARCH_ADVANTECH + if (dir == USB_DIR_OUT) { + struct usb_device_descriptor *desc = &serial->dev->descriptor; + if (desc->idVendor == 0x05C6 && (desc->idProduct == 0x9003 || desc->idProduct == + 0x9090 || desc->idProduct == 0x9215)) + urb->transfer_flags |= URB_ZERO_PACKET; + } + #endif return urb; }
2. Add UC15/UC20/EC20's Vendor ID and Product ID in "option_ids[]" in the file "drivers/usb/serial/option.c":
static const struct usb_device_id option_ids[] = { … + { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9090) }, //for Quectel UC15 + { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9003) }, //for Quectel UC20 + { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9215) }, //for Quectel EC20 … }
4G
Telit LE910C4
- For Yocto 2.5 and later
We have to enable CONFIG_USB_SERIAL_OPTION=y
- Using command as below to connect
Setup APN
echo -e "AT+CGDCONT=2,\"ip\",\"internet\"\r\n" >/dev/ttyUSB2
Connect
pppd connect 'chat -v -s -t 10 "" "AT" "" "ATDT*99***2#" "CONNECT" ""' user username password password /dev/ttyUSB2 460800 nodetach crtscts debug usepeerdns defaultroute &
For EPC-R7200
File:Telit_le910c4_on_EPCR7200.pdf
Sierra AirPrime MC7304
- For Yocto 1.8
We have to enable CONFIG_USB_SERIAL_QUALCOMM=m
- For Yocto 2.0 and later
We have to enable CONFIG_USB_SERIAL_OPTION=y
- Using command as below to connect
pppd connect 'chat -v -s -t 10 "" "AT" "" "ATDT*99#" "CONNECT" ""' user username password password /dev/ttyUSB2 460800 nodetach crtscts debug usepeerdns defaultroute &
Sierra AirPrime MC7430
Modify drivers/usb/serial/option.c
--- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c @@ -1123,6 +1123,8 @@ static const struct usb_device_id option_ids[] = { { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9000)}, /* SIMCom SIM5218 */ { USB_DEVICE_INTERFACE_CLASS(SIERRA_VENDOR_ID, 0x68c0, 0xff), .driver_info = (kernel_ulong_t)&sierra_mc73xx_blacklist }, /* MC73xx */ + { USB_DEVICE_INTERFACE_CLASS(SIERRA_VENDOR_ID, 0x9071, 0xff), + .driver_info = (kernel_ulong_t)&sierra_mc73xx_blacklist }, /* MC7430 */ { USB_DEVICE_INTERFACE_CLASS(SIERRA_VENDOR_ID, 0x9041, 0xff), .driver_info = (kernel_ulong_File:4G_rndis.zip)&sierra_mc73xx_blacklist }, /* MC7305/MC7355 */ { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6001) },
Sierra AirPrime EM7565
Verified on RSB-4760 (Qualcomm db410c)
AM Telecom AMM561KT
The following operations are performed with UBC-222(U222LBV2011).
- linux kernel config
- Device Drivers --->
- [*] USB support --->
- <M> Support for Host-side USB
- [*] Network device support --->
- USB Network Adapters --->
- <M> Multi-purpose USB Networking Framework
- <M> Host for RNDIS and ActiveSync devices (EXPERIMENTAL)
- USB Network Adapters --->
- [*] USB support --->
- Device Drivers --->
- load drivers
# rmmod usbserial # modprobe rndis_host # modprobe usbserial vendor=0x1ECB product=0x0205
- list usb devices
Fibocom NL668
EWM-C145
EWM-C117
Default RNDIS Mode
Use the script to connect to internet
Change to normal mode
File:module-ewm-117-for-ppp.zip
Connect to internet by pppd demand
Reference from AE Phill
:File:EWM-C117 RSB-4760 internaluse.docx
Made from RD
File:EWM-C117_for_RK3399_ds100.docx
Bluetooth
EWM-W155H01E
Please refer to Bluetooth Testing Guide for Quark Platform for all operations performed using UBC-222 with U222LBV2011.
AW-CB178NF
Porting AzureWave Wifi BT module
1. Add compile option ins arch/arm/configs/imx_v7_adv_deconfig
… CONFIG_BT_HIDP=y CONFIG_BT_HCIBTUSB=y CONFIG_BT_HCIVHCI=y + CONFIG_BT_MRVL=m + CONFIG_BT_MRVL_SDIO=m CONFIG_BT_ATH3K=m CONFIG_CFG80211=m CONFIG_CFG80211_WEXT=y … … CONFIG_USB_NET_RNDIS_HOST=y CONFIG_USB_NET_CDC_SUBSET=m CONFIG_USB_NET_ZAURUS=m + CONFIG_LIBERTAS_THINFIRM=m CONFIG_ATH_CARDS=m CONFIG_ATH9K=m CONFIG_ATH9K_LEGACY_RATE_CONTROL=y … CONFIG_RT2800USB_RT55XX=y CONFIG_RT2800USB_UNKNOWN=y CONFIG_RTL8188EE=m + CONFIG_MWIFIEX=m + CONFIG_MWIFIEX_SDIO=m CONFIG_INPUT_POLLDEV=y #CONFIG_INPUT_MOUSEDEV_PSAUX is not set CONFIG_INPUT_EVDEV=y …
2. Modify in arch/arm/boot/dts/imx6qdl-advantech.dtsi
... usdhc1 { pinctrl_usdhc1_1: usdhc1grp-1 { fsl,pins = < MX6QDL_PAD_SD1_CMD__SD1_CMD 0x17059 MX6QDL_PAD_SD1_CLK__SD1_CLK 0x10059 MX6QDL_PAD_SD1_DAT0__SD1_DATA0 0x17059 MX6QDL_PAD_SD1_DAT1__SD1_DATA1 0x17059 MX6QDL_PAD_SD1_DAT2__SD1_DATA2 0x17059 MX6QDL_PAD_SD1_DAT3__SD1_DATA3 0x17059 >; }; }; ...
3. add in arch/arm/boot/dts/imx6q-[board].dts
... &iomuxc { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_hog_1 &pinctrl_hog_2>; hog { pinctrl_hog_1: hoggrp-1 { fsl,pins = < MX6QDL_PAD_SD3_DAT4__GPIO7_IO01 0x80000000 /* SD3_CD */ MX6QDL_PAD_SD3_DAT5__GPIO7_IO00 0x80000000 /* SD3_WP */ MX6QDL_PAD_SD2_CMD__GPIO1_IO11 0x80000000 /* SDIO RST */ MX6QDL_PAD_SD2_CLK__GPIO1_IO10 0x80000000 /* SDIO WAKE */ + MX6QDL_PAD_NANDF_D7__GPIO2_IO07 0x80000000 /* M.2 WLAN OFF */ + MX6QDL_PAD_NANDF_D1__GPIO2_IO01 0x80000000 /* M.2 BT OFF */ MX6QDL_PAD_GPIO_0__CCM_CLKO1 0x130b0 /* AUDIO CLK */ >; }; ...
Testing Operations
hciconfig hci0 up hcitool dev | grep hci hcitool scan
WiFi
EWM-W142F01E
For Yocto 1.8
Check wlan0 existing or not
# ifconfig wlan0 up
- ifconfig
# wpa_passphrase "ASUS_RISC_SOM_ESBC_2.4" 1qaz2wsx > /tmp/wpa.conf
#wpa_supplicant -BDwext -iwlan0 -c/tmp/wpa.conf
# cat /tmp/wpa.conf
# udhcpc -b -i wlan0
Check wlan0 working or not
# ifconfig wlan0
# ping 8.8.8.8
For Debian 8
# apt-get update
# apt-get install network-manager-gnome
Check wlan0 existing or not
# ifconfig wlan0 up
- ifconfig
# wpa_passphrase "ASUS_RISC_SOM_ESBC_2.4" 1qaz2wsx > /tmp/wpa.conf
#wpa_supplicant -BDwext -iwlan0 -c/tmp/wpa.conf
# cat /tmp/wpa.conf
# dhclient wlan0
EWM-W151H01E
EWM-W155H01E
EWM-W157H01E
Support WiFi and BT function on Yocto 2.1.
For Yocto 2.1
Check wlan0 existing or not
# ifconfig wlan0 up
- ifconfig
# wpa_passphrase "ASUS_RISC_SOM_ESBC_2.4" 1qaz2wsx > /tmp/wpa.conf
#wpa_supplicant -BDwext -iwlan0 -c/tmp/wpa.conf
# cat /tmp/wpa.conf
# udhcpc -b -i wlan0
Check wlan0 working or not
# ifconfig wlan0
# ping 8.8.8.8
EWM-W163M201E
EWM-W163M201E_porting_guide_on_DS100.docx
EWM-W168
EWM-W170
EWM-W170_WIFI_porting_guide_for_imx6.docx
EWM-W188
File:EWM-W188_Bluetooth_porting_guide_for_ds100-debian.docx
File:EWM-W188_RSB4710_Android10.docx
AIW-W154
Yocto 3.0
Yocto 3.3
AIW154_WIFIBT_kernel_5_10.docx
AIW-W165
The AIW-W165 (Support OS is Yocto3.3)
WIFI Test Command
- modprobe moal mod_para=nxp/wifi_mod_para.conf
- iwconfig
- ifconfig mlan0 up
- wpa_passphrase "XX" yy >/tmp/wpa.conf (XX is WIFI ESSID , yy is password)
- ifconfig eth0 down
- wpa_supplicant -d -B -imlan0 -c /tmp/wpa.conf -Dnl80211
- udhcpc -imlan0
BT Test Command
- modprobe moal mod_para=nxp/wifi_mod_para.conf
- hciattach /dev/ttymxc2 any 3000000 3000000 flow
- hciconfig hci0 up
- hcitool scan
TOUCH
EETI_eGTouch
File:EETI_Touch_porting_guide_on_Android_10.docx
USB
EMIO-200U3
Set CONFIG_USB_XHCI_HCD=y in kernel config
ADC
USB-4702/4704 & USB-4761
Driver Confirmation
1. Make sure the DAQ device driver has been loaded by the kernel
2. If login by normal user (not root user), you have to place drivers\driver_base\src\lnx_ko\71-bionic-daq.rules
to /etc/udev/rules.d/ in Root File System
3. Make sure the DAQ driver has been successfully matched with the DAQ device.
Change Device Description
To check deviceDescription
cat /sys/class/daq/daq0/desc
and change deviceDescription of your device in sample codes
example:
#define deviceDescription L"USB-4704,BID#0"
Compile sample code
First, download the package for specific platform, e.g. arm64-oecore or TI am335x.
These libraries in ./libs are only for specific platform and have to be copied into /usr/lib/ in Root File System
If you want to support on other platforms (ex: i.MX6 ...), please contact with Advantech.
- [RSB-4760]
Set-up arm64-oecore environment
source [your cross-compiler path]/environment-setup-aarch64-oe-linux
Compile sample code
[your cross-compiler path]/sysroots/x86_64-oesdk-linux/usr/bin/aarch64-oe-linux/aarch64-oe-linux-g++ -o $Example_NAME $Example_NAME.cpp \ --sysroot=[your cross-compiler path]/sysroots/aarch64-oe-linux/ \ -I [your cross-compiler path]/sysroots/aarch64-oe-linux/usr/include/ \ -L [your cross-compiler path]/sysroots/aarch64-oe-linux/usr/lib/ \ -L [USB-4704 driver source path]/libs \ -lbiodaq
- [RSB-4220 / UBC-330]
Compile sample code
[your cross-compiler path]/sysroots/x86_64-arago-linux/usr/bin/arm-linux-gnueabihf-g++ -o $Example_NAME $Example_NAME.cpp \ --sysroot=[your cross-compiler path]/sysroots/armv7ahf-neon-linux-gnueabi/ \ -I [your cross-compiler path]/sysroots/armv7ahf-neon-linux-gnueabi/usr/include/ \ -L [your cross-compiler path]/sysroots/armv7ahf-neon-linux-gnueabi/usr/lib/ \ -L [USB-4704 driver source path]/libs \ -lbiodaq
Example List
For simple test, you can use AO_StaticAO to see if the output voltage of AO0 changes automatically.
- For USB-4702/4704
- For USB-4761