STC8H8K64U 的 USB 功能测试(未成功)
对 STC8H8K64U 的 USB 功能测试, 因为存在很多问题并且未能解释/解决, 就不写到系列里了, 把记录放上来抛砖引玉吧.
代码
测试代码下载地址 http://www.stcmcudata.com/STC8F-DATASHEET/STC8H8K64U-DEMO-CODE.ZIP , 使用其中的"39-通过USB发送命令读取ADC测试程序", 用于创建一个 USB HID 设备.
连线
USB口的4线顺序
USB Layout: 5V | D- | D+ | GND
连线
USB STC8H8K64U
5V -> VCC # 这一部分的连线会有其它情况
D- -> P3.0
D+ -> P3.1
P3.2 # 拉高为运行用户代码, 拉低为ISP模式
GND -> GND
VCC的电压, 对USB功能是否工作会有影响, 下面分3种情况说明. 测试的是一片lqfp48封装的 STC8H8K64U, 丝印是B版本, 这些问题也许是个体差异, 需要更多测试判断
测试
VCC直连5V
Win10 能检测到 USB 设备, 但是不识别.
Ubuntu20.04 dmesg 输出
[ 2483.709716] usb 2-3: new full-speed USB device number 31 using xhci_hcd
[ 2483.837738] usb 2-3: device descriptor read/64, error -71
[ 2484.073747] usb 2-3: device descriptor read/64, error -71
[ 2484.309721] usb 2-3: new full-speed USB device number 32 using xhci_hcd
[ 2484.437740] usb 2-3: device descriptor read/64, error -71
[ 2484.673739] usb 2-3: device descriptor read/64, error -71
[ 2484.781788] usb usb2-port3: attempt power cycle
[ 2485.437650] usb 2-3: new full-speed USB device number 33 using xhci_hcd
[ 2485.437786] usb 2-3: Device not responding to setup address.
[ 2485.645720] usb 2-3: Device not responding to setup address.
[ 2485.853705] usb 2-3: device not accepting address 33, error -71
[ 2485.981717] usb 2-3: new full-speed USB device number 34 using xhci_hcd
[ 2486.002557] usb 2-3: device descriptor read/8, error -71
[ 2486.130718] usb 2-3: device descriptor read/8, error -71
[ 2486.237826] usb usb2-port3: unable to enumerate USB device
VCC经两个1N4148串联降压到3.7V
Win10 能检测到 USB 设备, 但是不识别.
Ubuntu20.04 的 dmesg, 此时能检测到, 但是应该是有问题的. 在刚开始测试时, 会输出与上面错误状态一样的dmesg
[ 2035.215017] usb 2-3: new full-speed USB device number 29 using xhci_hcd
[ 2035.343043] usb 2-3: device descriptor read/64, error -71
[ 2035.601374] usb 2-3: New USB device found, idVendor=5354, idProduct=4380, bcdDevice= 1.00
[ 2035.601389] usb 2-3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 2035.601395] usb 2-3: Product: STC USB Device
[ 2035.601399] usb 2-3: Manufacturer: STC
[ 2036.170978] hid: raw HID events driver (C) Jiri Kosina
[ 2036.176067] usbhid 2-3:1.0: can't add hid device: -71
[ 2036.176082] usbhid: probe of 2-3:1.0 failed with error -71
[ 2036.176133] usbcore: registered new interface driver usbhid
[ 2036.176136] usbhid: USB HID core driver
[ 2083.254934] usb 2-3: USB disconnect, device number 29
[ 2085.559301] usb 2-3: new full-speed USB device number 30 using xhci_hcd
[ 2085.709303] usb 2-3: New USB device found, idVendor=5354, idProduct=4380, bcdDevice= 1.00
[ 2085.709318] usb 2-3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 2085.709323] usb 2-3: Product: STC USB Device
[ 2085.709328] usb 2-3: Manufacturer: STC
[ 2085.711834] usbhid 2-3:1.0: can't add hid device: -71
[ 2085.711867] usbhid: probe of 2-3:1.0 failed with error -71
[ 2340.604515] usb 2-3: USB disconnect, device number 30
VCC使用USB2TTL提供的3.3V
USB 与 USB2TTL 共地
Win10 情况依旧, 在很少数的情况, 能识别出 HID Input 设备, 但是上位机软件无法检测识别.
Ubuntu20.04 可以正常识别, 分两种情况:
将P32通过2KR电阻接3.3V上拉, 最初加电未正常工作, 经过两次加电, 能看到正确的输出
[ 1902.282379] usb 2-2: new full-speed USB device number 42 using xhci_hcd
[ 1902.432752] usb 2-2: New USB device found, idVendor=5354, idProduct=4380, bcdDevice= 1.00
[ 1902.432766] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 1902.432771] usb 2-2: Product: STC USB Device
[ 1902.432776] usb 2-2: Manufacturer: STC
[ 1902.436845] input: STC STC USB Device as /devices/pci0000:00/0000:00:14.0/usb2/2-2/2-2:1.0/0003:5354:4380.0003/input/input22
[ 1902.494766] hid-generic 0003:5354:4380.0003: input,hidraw0: USB HID v1.01 Device [STC STC USB Device] on usb-0000:00:14.0-2/input0
USB设备信息
$ lsusb -v
Bus 002 Device 042: ID 5354:4380 Meyer Instruments (MIS) STC USB Device
Couldn't open device, some information will be missing
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x5354 Meyer Instruments (MIS)
idProduct 0x4380
bcdDevice 1.00
iManufacturer 1
iProduct 2
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 0x0029
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 100mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 3 Human Interface Device
bInterfaceSubClass 0
bInterfaceProtocol 0
iInterface 0
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.01
bCountryCode 0 Not supported
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 27
Report Descriptors:
** UNAVAILABLE **
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 1
P32悬空, 会进入ISP模式
[ 1645.193000] usb 2-2: new full-speed USB device number 30 using xhci_hcd
[ 1645.341751] usb 2-2: device descriptor read/all, error -71
[ 1645.468940] usb 2-2: new full-speed USB device number 31 using xhci_hcd
[ 1645.597259] usb 2-2: Device not responding to setup address.
[ 1645.805130] usb 2-2: Device not responding to setup address.
[ 1646.012966] usb 2-2: device not accepting address 31, error -71
[ 1646.013086] usb usb2-port2: attempt power cycle
[ 1646.668947] usb 2-2: new full-speed USB device number 32 using xhci_hcd
[ 1646.669156] usb 2-2: Device not responding to setup address.
[ 1646.877105] usb 2-2: Device not responding to setup address.
[ 1647.084924] usb 2-2: device not accepting address 32, error -71
[ 1647.212913] usb 2-2: new full-speed USB device number 33 using xhci_hcd
[ 1647.238924] usb 2-2: New USB device found, idVendor=34bf, idProduct=1001, bcdDevice= 1.00
[ 1647.238934] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 1647.238939] usb 2-2: Product: USB-ISP
[ 1647.238942] usb 2-2: Manufacturer: STC
[ 1647.242464] input: STC USB-ISP as /devices/pci0000:00/0000:00:14.0/usb2/2-2/2-2:1.0/0003:34BF:1001.0002/input/input21
[ 1647.301225] hid-generic 0003:34BF:1001.0002: input,hidraw0: USB HID v1.01 Device [STC USB-ISP] on usb-0000:00:14.0-2/input0
lsusb -v
Bus 002 Device 033: ID 34bf:1001 STC USB-ISP
Couldn't open device, some information will be missing
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x34bf
idProduct 0x1001
bcdDevice 1.00
iManufacturer 1
iProduct 2
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 0x0029
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 100mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 3 Human Interface Device
bInterfaceSubClass 0
bInterfaceProtocol 0
iInterface 0
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.01
bCountryCode 0 Not supported
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 23
Report Descriptors:
** UNAVAILABLE **
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x84 EP 4 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x04 EP 4 OUT
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 1
问题
综上, STC8H 的 USB 功能还是存在一些问题, 也许是使用的方法不对, 这些记录对其他人也许会有帮助. 待有更多资料再试吧.
参考
- USB下载的说明 https://www.stcisp.com/stc15-usb-isp-d1.html
- USB HID 跨平台库 libusb/hidapi
STC8H8K64U 的 USB 功能测试(未成功)的更多相关文章
- PS2鼠标+LCD12864实验(调试未成功)
此试验我一人调试许久都未成功,但发送ff时,读出来的数据确是对的,一开始让我窃喜,但发送f4时,读出来的数据确是错的,哎让苦恼啊,能力有限,只能先暂时就这样吧,那位什么还要贴出来呢,有两个原因: 1. ...
- WebApi 数据保护操作未成功。这可能是由于未为当前线程的用户上下文加载用户配置文件导致的。当线程执行模拟时,可能会出现此情况。","ExceptionType":"System.Security.Cryptography.CryptographicException","StackTrace
在调用System.Security.Cryptography.ProtectedData.Protect方法来保护私密信息时,IIS可能会报以下错误:CryptographicException: ...
- Eclipse + Apache Axis2 发布RESTful WebService(三)第一个程序Hello Axis2 !(未成功)
此路不通 Axis2发布SOAP WebService非常简单,建一个Dynamic Web Project,然后为它建一个Axis的Web Service(Tomcat7+JDK),就会生成Clas ...
- git 取消未成功的 merge
git 取消未成功的 merge # 合并时遇到冲突想取消操作,恢复index $ git merge --abort # 可以回退到某个提交 $ git reset --hard # 可以撤销某个提 ...
- 解Bug之路-主从切换"未成功"?
解Bug之路-主从切换"未成功"? 前言 数据库主从切换是个非常有意思的话题.能够稳定的处理主从切换是保证业务连续性的必要条件.今天笔者就来讲讲主从切换过程中一个小小的问题. 故障 ...
- STC8H开发(九): STC8H8K64U模拟USB HID外设
目录 STC8H开发(一): 在Keil5中配置和使用FwLib_STC8封装库(图文详解) STC8H开发(二): 在Linux VSCode中配置和使用FwLib_STC8封装库(图文详解) ST ...
- 22、在Ubuntu 14.0上使用韦东山IP2977测试总结(未成功)
1. 去www.kernel.org下载同版本的内核(与Ubuntu 14.0) 解压后把drivers/media/video/uvc目录取出(发现我的3.13版本的在drivers\media\u ...
- django 未成功初始化自定义表单
用以下两句 python3 manage.py makemigrations python3 manage.py migrate 成功初始化了数据库,但是只初始化了django自带的表,未初始化我自定 ...
- VS发布,应用程序验证未成功。无法继续。
用VS2005发布客户端程序. 1.发布:点击工程项目属性,右键发布按钮,一切正常. 2.测试安装:提示如下提示框: 打开详细信息内容如下: 错误摘要 以下是错误摘要,这些错误的详细信息列在该日志的后 ...
- VisualSVN Server搭建VDFS分布式仓研究(未成功)
FSFS与VDFS的使用区别在于FSFS是本地仓库,VDFS是分布式仓库,实现在同一个局域网内多台仓库进行同步:以下是我的猜测,因为没搭建成功: 1.必须是同一个局域网,如果有外内网基本是不可实现,需 ...
随机推荐
- css - 编写 兼容到ie7的导航
1, index.html <!DOCTYPE html> <html lang="en"> <head> <meta charset=& ...
- Laravel - 创建项目
1,创建目录 ( 路径不要带有中文 ) 2,进入目录,执行下列命令 composer create-project --prefer-dist laravel/laravel project
- [转帖]OceanBase 4.2.1 LTS 发版 | 一体化数据库首个长期支持版本
2013.11.20 https://open.oceanbase.com/blog/7746655008?_gl=1*1qv10rf*_ga*Nzk3MjIxOTk0LjE3MDI2MTAxMzk. ...
- [转帖]SQL Server高级进阶之索引碎片维护
https://www.cnblogs.com/atomy/p/15268589.html 一.产生原因及影响 索引是数据库引擎中针对表(有时候也针对视图)建立的特别数据结构,用来帮助查找和整理数据, ...
- [转帖]tidb Modify Configuration Dynamically
https://docs.pingcap.com/tidb/v6.5/dynamic-config This document describes how to dynamically modify ...
- [转帖]【TiDB】快速起步
1. 存储引擎的的功能 提供数据存储接口并持久化存储数据 2. LSM-tree 的特性 LSM-tree 结构本质上是一个用空间置换写入延迟,用顺序写入替换随机写入的数据结构 3. 数据库技术的发展 ...
- [转帖]harbor 更改网段(docker-compose)
https://blog.csdn.net/Darkernote/article/details/119390862 问题:harbor 安装后网段冲突 docker-compose 一般安装会创建一 ...
- Oracle12c(未更新任何补丁) 使用compression=all 参数导出之后导入失败
1. 最近使用Oracle12c 进行相关的测试工作, 平台linux 和 windows 都有一个问题 备份恢复使用的 compression=all 时导入数据库不管是oracle12c还是 or ...
- vue3动态组件的展示
需求描述 有些时候,我们需要做这样的处理. 点击A按钮的时候,出现组件A 点击B按钮的时候,出现组件B 点击C按钮的时候,出现组件C 这个时候,我们就可以使用动态组件了 动态组件 <templa ...
- elementui更改Slider 滑块颜色样式
<div class="con-slider"> <el-slider :disabled="disabledFlag" @change=&q ...