FTDI公司的FT2232系列芯片可实现USB与异步串行口RS232/RS485、同步串行总线IIC/SPI/JTAG相互通信,市场占有率,使用普遍。

FTDI芯片有两种类型的驱动:virtual COM port driver (VCP)和D2xx。VCP就是常用的U转串COM驱动,实现USB到虚拟串口功能,应用于异步RS232/RS485与USB间通信,linux设备文件为/dev/ttyUSBx;D2XX应用于同步串行总线IIC/SPI/JTAG与USB间通信,整个驱动框架都有FTDI公司提供。

COM驱动

linux支持FTDI公司的VCP驱动需配置内核:

Device Drivers --->

       [*] USB support --->

       <M> USB Serial Converter support --->

                            <M> USB Prolific  Single Port Serial Driver

                            <M> USB FTDI Single Port Serial Driver

Prolific和FTDI是常用的USB转串口芯片厂商。通用模块usbserial.ko,prolific公司的模块pl2303.ko,ftdi公司的模块ftdi_sio.ko

[    1.771996] usbcore: registered new interface driver usbfs

[    1.777600] usbcore: registered new interface driver hub

[    1.782975] usbcore: registered new device driver usb

[    3.227325] usbcore: registered new interface driver usb-storage

[    3.331190] usbcore: registered new interface driver bcm203x

[    3.336872] usbcore: registered new interface driver bfusb

[    3.342381] usbcore: registered new interface driver btusb

[    3.347893] usbcore: registered new interface driver ath3k

[    3.496381] usbcore: registered new interface driver usbhid

[    3.501958] usbhid: USB HID core driver

[   58.132670] usb -: new full-speed USB device number  using xhci-hcd

[   58.314580] usbcore: registered new interface driver usbserial

[   58.316675] usbcore: registered new interface driver pl2303

[   58.316707] usbserial: USB Serial support registered for pl2303

[   58.317386] usb -: pl2303 converter now attached to ttyUSB0

[  289.400405] usb -: USB disconnect, device number 

[    1.774779] usbcore: registered new interface driver usbfs

[    1.780377] usbcore: registered new interface driver hub

[    1.785752] usbcore: registered new device driver usb

[    3.230535] usbcore: registered new interface driver usb-storage

[    3.334244] usbcore: registered new interface driver bcm203x

[    3.339930] usbcore: registered new interface driver bfusb

[    3.345439] usbcore: registered new interface driver btusb

[    3.350951] usbcore: registered new interface driver ath3k

[    3.495753] usbcore: registered new interface driver usbhid

[    3.501362] usbhid: USB HID core driver

[    3.643788] usb -: new high-speed USB device number  using xhci-hcd

[    7.070296] usbcore: registered new interface driver usbserial

[    7.099899] usbcore: registered new interface driver ftdi_sio

[    7.099925] usbserial: USB Serial support registered for FTDI USB Serial Device

[    7.100046] usb -: Detected FT2232H

[    7.100439] usb -: FTDI USB Serial Device converter now attached to ttyUSB0

[    7.100539] usb -: Detected FT2232H

[    7.100667] usb -: FTDI USB Serial Device converter now attached to ttyUSB1

[   86.423288] usb -: USB disconnect, device number 

插入USB设备会在/dev/ttyUSBx文件出现,可像操作普通的串口文件/dev/ttySx一样操作,采用通用termios编程。

D2XX驱动

在linux中VCP和D2XX驱动是不兼容的,当D2XX驱动应用前应卸载VCP驱动模块:

sudo rmmod ftdi_sio

sudo rmmod usbserial

实际测试中采用D2XX驱动时系统会自动卸载VCP驱动。

D2XX驱动协议栈如下图,D2XX驱动libftd2xx.tar.gz可在如下页面下载:https://www.ftdichip.com/Drivers/D2XX.htm,或者直接在系统下apt安装(可能需要libusb-dev):

apt install libftdi-dev

在D2XX驱动之上是libmpsse,即MPSSE库。Multi Protocol Synchronous Serial Engine(MPSSE)是一个通用的同步总线如I2C、SPI或JTAG通信库,用于FT2232D、FT2232H、FT4232H和FT232H芯片通过USB与PC或ARM通信。MPSSE基于D2XX设计。

D2XX应用

lora gateway就应用了D2XX驱动,将SPI接口转化为U口与主服务器(X86或ARM)通信,开源库:https://github.com/yuxi-o/RAK833-LoRaGateway-RPihttps://github.com/Lora-net/lora_gateway.git

参考:

1. https://www.ftdichip.com/Support/Documents/AppNotes.htm

2. FTDI FT2232H在嵌入式教学中的应用

3. linux内核支持U-disk和U转串

4. FTDI Drivers Installation Guide for Linux

5. User Guide For LibMPSSE-SPI

FTDI通用转USB芯片简述的更多相关文章

  1. usb芯片调试经验

    记录一下调试usb有关的芯片的一些经验. 1.有i2c的芯片.一般有i2c的地址选择. 检查地址选择是否正确,地址是多少.SCL和SDA上面是否有上拉电阻. 芯片的地址是几位的.I2c的时钟频率也是必 ...

  2. windows xp 连接USB网络打印机服务器(通用所有usb网络打印机服务器的安装)

    usb网络打印机服务器是HP1101U 打印机是 hp1108 需要准备的其他东西:1.HP1108的驱动 首先,接好线,保证usb hp1101u能正常访问,这款USB一旦接入了网络,会分配一个ip ...

  3. CYPRESS USB芯片win10驱动

    The ZIP file attached with this knowledge base article contains the CyUSB3.inf and CyUSB3.sys files ...

  4. USB2.0学习笔记连载(三):通用USB驱动程序解析

    对于USB驱动的开发,读者可以使用Windows DDK.DriverStudio等多种开发工具来实现USB的驱动,但是驱动程序的开发过程都比较复杂,而且很容易致使USB主机内存泄露而死机.那么对于笔 ...

  5. USB Keyboard Recorder

    catalogue . 引言 . Device Class Definition for Human Interface Devices (HID) . USB HID Report Descript ...

  6. USB入门

    简述 USB(Universal Serial Bus)全称通用串口总线,USB为解决即插即用需求而诞生,支持热插拔.USB协议版本有USB1.0.USB1.1.USB2.0.USB3.1等,USB2 ...

  7. USB接口介绍

        USB设备系统分为两个部分,USB Host端和USB Device端,以USB接口的U盘为例子,U盘自身是一个USB Device,PC机的USB接口以及相关的控制电路为USB Host部分 ...

  8. Linux usb子系统(一):子系统架构

    一.USB协议基础知识   前序:USB概念概述 USB1.0版本速度1.5Mbps(低速USB) USB1.1版本速度12Mbps(全速USB)  USB2.0版本速度480Mbps(高速USB). ...

  9. USB Mass Storage大容量存储的基本知识

    http://www.crifan.com/files/doc/docbook/usb_disk_driver/release/htmls/ch02_msc_basic.html 目录 2.1. US ...

随机推荐

  1. mysql存储过程批量向表插入数据

    业务需要,往某个表中批量插入数据,使用存储过程插入 首先,要建立一张mysql表,表明为phone_number, 三个字段,id 自增,number 就是要插入的表格,is_used 表示十分已经使 ...

  2. 【转】WARNING! File system needs to be upgraded. You have version null and I want version 7. Run the '${HBASE_HOME}/bin/hbase migrate' script. 的解决办法

    前段时间集群出问题,hadoop和hbase启动不了了. 后来hadoop回复了,hbase死活master无法启动.打开日志发现报了以下错误: WARNING! File system needs ...

  3. talend 连接mysql数据库没有权限

    使用talend连接一个mysql数据库,提示没有权限,最后发现mysql服务器的配置中只监听了127.0.0.1的端口,拒绝非本地的请求.通过将/etc/mysql/my.cnf中的bind_add ...

  4. Linux 密码过期(WARNING:Your password has expired )

    最近遇到两次这个问题,我们公司用的是开源的堡垒机Jumpserver但是最近有两个同学遇到了 WARNING:Your password has expired 第一次遇到这个问题也没有往深了去查,当 ...

  5. js评价五星

    js评价五星 1.图片(star.png): 2.图片和html文件在同级目录 <html> <head> <script src="http://libs.b ...

  6. SQL SERVER 数据库被标记为“可疑”的解决办法

    问题背景: 日常对Sql Server 2005关系数据库进行操作时,有时对数据库(如:Sharepoint网站配置数据库名Sharepoint_Config)进行些不正常操作如数据库在读写时而无故停 ...

  7. php正则表达式入门-常用语法格式

    php正则表达式入门-常用语法格式 原文地址:http://www.jbxue.com/article/24467.html 分享下php正则表达式中的一些常用语法格式,用于匹配字母.数字等,个人感觉 ...

  8. Android Shell命令dumpsys

    dumpsys命令可以显示手机中所有应用程序的信息,并且也会给出现在手机的状态. 直接执行adb shell dumpsys KEY 会显示以下所有信息. KEY的可选名称 SurfaceFlinge ...

  9. zabbix rpm 安装 新增zabbix yum 源 并更新

    需要安装的包: # rpm -qa|grep zabbix zabbix-server-2.4.3-1.el6.x86_64 zabbix-web-mysql-2.4.3-1.el6.noarch z ...

  10. [MyBean说明书]-如何进行最简单的DEMO

    MyBean是轻量级的.绿色的框架,不需要安装任何的组件和携带任何的其他文件,前 期步骤已经相当精简了,仔细阅读完下面简单的五个步骤,就可以编写基于MyBean的插件: 1.加入Delphi的搜索路径 ...