amobbs.com 阿莫电子论坛

 找回密码
 注册
bottom↓
查看: 722|回复: 168

为 STM8 USB 再添一把火 —— 固件讨论帖

  [复制链接]
发表于 2014-6-20 11:36:07 | 显示全部楼层 |阅读模式
本帖最后由 aammoo 于 2014-6-21 21:22 编辑

首先整理一下资料:
        1. 俄罗斯原作者网站
        2. 本坛之前的讨论,STM8软件模拟USB国外已经有人搞定【有源码】
        3. 我的编译工具 为 STM8 USB 添一把火 —— 编译工具
        3. 我的原理图和 PCB 为 STM8 USB 再添一把火 —— 适合热转印的开发板

固件在Github上更新:https://github.com/wlianmin/stm8_usb

目前的状况: 可以枚举为 HID 设备, 但兼容性还有待提高, 在我的笔记本上可以识别, 台式机的3.0接口可以识别, 但台式机的2.0 接口不行. 时许还需要优化以下.

注意:需要配置 option byte 的 AFR0, 使能 PC6,PC7 的 alternate function  

详细说明:
先说一下大体的流程:
首先,通过中断来接收USB数据,接收完后,调用 void usb_rx_ok(void) 来应答或不应答,并识别数据包,把相应的状态写usb这个结构体里面。
然后,在主循环中不断的调用 void usb_process(void) 来根据 usb 里面的状态来做相应的动作。
设备描述符的发送是这样的:调用 void usb_send_data(uint8_t * buffer, uint8_t lenght), 将描述符打包,放到 usb.tx_buffer 里面,然后将状态改为已经准备好发送usb.event = USB_EVENT_READY_DATA_IN,等待主机发送 DATA IN 包。
usb_rx_ok 识别到 DATA IN 包并且 usb.event 为准备发送, 就会调用 void usb_send_answer(void)  来完成数据发送。
 楼主| 发表于 2014-6-20 11:41:53 | 显示全部楼层
本帖最后由 aammoo 于 2014-6-20 11:45 编辑

看起来问题不是很大,应该是数据发送的时机有些问题
修改了一下这里
while (usb.event == USB_EVENT_READY_DATA_IN)
{
        if ((usb.state != USB_STATE_IN)&&(usb.state != USB_STATE_SETUP))
                return;
}
已经可以看到发往PC的数据了,可以确定发送部分是基本没有问题

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
 楼主| 发表于 2014-6-20 11:42:14 | 显示全部楼层
本帖最后由 aammoo 于 2014-6-20 20:37 编辑

可以枚举为 HID 设备, 但兼容性还有待提高, 在我的笔记本上可以识别, 台式机的3.0接口可以识别, 但台式机的2.0 接口不行. 时许还需要优化以下.
代码已经更新到github上



这是抓到的数据和分析:
PID,Address,Endpoint,Frame #,Data,CRC
SETUP,0x00,0x00,,,0x02
DATA0,,,,0x80 0x06 0x00 0x01 0x00 0x00 0x40 0x00,0x94DD        //请求设备描述符
ACK,,,,,
IN,0x00,0x00,,,0x02
DATA1,,,,0x12 0x01 0x00 0x01 0xFF 0x00 0x00 0x08,0xF323
ACK,,,,,
IN,0x00,0x00,,,0x02
DATA0,,,,0x11 0x22 0x33 0x44 0x55 0x66 0x00 0x00,0x2979
ACK,,,,,
IN,0x00,0x00,,,0x02
DATA1,,,,0x00 0x01,0x8F3F
ACK,,,,,
OUT,0x00,0x00,,,0x02
DATA1,,,,,0x0000
ACK,,,,,
//////////////////////////////////////////////////////////设备描述符上传完成

SETUP,0x00,0x00,,,0x02
DATA0,,,,0x00 0x05 0x01 0x00 0x00 0x00 0x00 0x00,0x25EB        //设置地址
ACK,,,,,
IN,0x00,0x00,,,0x02
DATA1,,,,,0x0000
ACK,,,,,
//////////////////////////////////////////////////////////设置地址完成

SETUP,0x01,0x00,,,0x1D
DATA0,,,,0x80 0x06 0x00 0x01 0x00 0x00 0x12 0x00,0xF4E0        //使用新地址重新请求设备描述符
ACK,,,,,
IN,0x01,0x00,,,0x1D
DATA1,,,,0x12 0x01 0x00 0x01 0xFF 0x00 0x00 0x08,0xF323
ACK,,,,,
IN,0x01,0x00,,,0x1D
DATA0,,,,0x11 0x22 0x33 0x44 0x55 0x66 0x00 0x00,0x2979
ACK,,,,,
IN,0x01,0x00,,,0x1D
DATA1,,,,0x00 0x01,0x8F3F
ACK,,,,,
OUT,0x01,0x00,,,0x1D
DATA1,,,,,0x0000
ACK,,,,,
//////////////////////////////////////////////////////////设备描述符上传完成

SETUP,0x01,0x00,,,0x1D
DATA0,,,,0x80 0x06 0x00 0x02 0x00 0x00 0xFF 0x00,0xA4E9        //请求配置描述符
ACK,,,,,
IN,0x01,0x00,,,0x1D
DATA1,,,,0x09 0x02 0x12 0x00 0x01 0x01 0x00 0x80,0xB00E
ACK,,,,,
IN,0x01,0x00,,,0x1D
DATA0,,,,0x32 0x09 0x04 0x00 0x00 0x00 0x03 0x00,0x4DA5
ACK,,,,,
IN,0x01,0x00,,,0x1D
DATA1,,,,0x01 0x00,0xDFFF
ACK,,,,,
OUT,0x01,0x00,,,0x1D
DATA1,,,,,0x0000
ACK,,,,,
//////////////////////////////////////////////////////////配置描述符上传完成

SETUP,0x01,0x00,,,0x1D
DATA0,,,,0x80 0x06 0x00 0x01 0x00 0x00 0x12 0x00,0xF4E0        //请求设备描述符
ACK,,,,,
IN,0x01,0x00,,,0x1D
DATA1,,,,0x12 0x01 0x00 0x01 0xFF 0x00 0x00 0x08,0xF323
ACK,,,,,
IN,0x01,0x00,,,0x1D
DATA0,,,,0x11 0x22 0x33 0x44 0x55 0x66 0x00 0x00,0x2979
ACK,,,,,
IN,0x01,0x00,,,0x1D
DATA1,,,,0x00 0x01,0x8F3F
ACK,,,,,
OUT,0x01,0x00,,,0x1D
DATA1,,,,,0x0000
ACK,,,,,
//////////////////////////////////////////////////////////设备描述符上传完成

SETUP,0x01,0x00,,,0x1D
DATA0,,,,0x80 0x06 0x00 0x02 0x00 0x00 0x09 0x00,0x04AE        //请求配置描述符
ACK,,,,,
IN,0x01,0x00,,,0x1D
DATA1,,,,0x09 0x02 0x12 0x00 0x01 0x01 0x00 0x80,0xB00E
ACK,,,,,
IN,0x01,0x00,,,0x1D
DATA0,,,,0x32 0x09 0x04 0x00 0x00 0x00 0x03 0x00,0x4DA5
//////////////////////////////////////////////////////////配置描述符上传完成

SETUP,0x01,0x00,,,0x1D
DATA0,,,,0x00 0x09 0x00 0x00 0x00 0x00 0x00 0x00,0xF426        //SET_CONFIGURATION
ACK,,,,,
IN,0x01,0x00,,,0x1D
IN,0x01,0x00,,,0x1D

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
发表于 2014-6-20 12:17:44 | 显示全部楼层
谢谢分享!!!
发表于 2014-6-20 12:22:08 | 显示全部楼层
顶一下,山寨莫
发表于 2014-6-20 12:27:00 | 显示全部楼层
这个要mark!一直想学习USB!
发表于 2014-6-20 12:29:16 | 显示全部楼层
楼主厉害,这个stm8s usb老早就关注到了,学习学习。
发表于 2014-6-20 12:57:59 | 显示全部楼层
赞,做出来应该是最便宜的USb学习板
发表于 2014-6-20 14:05:54 | 显示全部楼层
严重支持一下
发表于 2014-6-20 14:27:53 | 显示全部楼层
aammoo 发表于 2014-6-20 11:41
看起来问题不是很大,应该是数据发送的时机有些问题
修改了一下这里
while (usb.event == USB_EVENT_READY_ ...

截图里面的软件是什么软件?虚拟的USB分析仪吗
发表于 2014-6-20 14:30:13 | 显示全部楼层
lz
24M的逻辑分析仪怎么捕捉USB信号?
发表于 2014-6-20 15:09:00 | 显示全部楼层
你好,我也在跟进这个项目。目前这个软核的usb算法论坛上早有人实现,只是现在不便开源。

个人觉得这个意义重大,很有应用价值。

目前开发板已经到手中,周末着手,一起交流下。
 楼主| 发表于 2014-6-20 17:13:08 | 显示全部楼层
asj1989 发表于 2014-6-20 14:30
lz
24M的逻辑分析仪怎么捕捉USB信号?

低速的 USB 是 1.5M 的
 楼主| 发表于 2014-6-20 17:14:44 | 显示全部楼层
菜包 发表于 2014-6-20 14:27
截图里面的软件是什么软件?虚拟的USB分析仪吗

用 saleae 抓得, 自己改造的。
山寨 USB Blaster 挥刀自宫,变身 Saleae 和 Blaster

发表于 2014-6-20 21:28:06 | 显示全部楼层
这个要顶,程序做好了我来做个板。有要的后面根帖支持一下.
发表于 2014-6-20 22:16:37 | 显示全部楼层
支持一个  有空也学学USB
发表于 2014-6-20 23:43:58 | 显示全部楼层
aammoo 发表于 2014-6-20 17:14
用 saleae 抓得, 自己改造的。
山寨 USB Blaster 挥刀自宫,变身 Saleae 和 Blaster

用的是GCC编译器吗
发表于 2014-6-21 04:19:53 | 显示全部楼层
真不错,stm8的性价比又提高了
发表于 2014-6-21 09:54:48 | 显示全部楼层
Cool ,感觉USB协议好复杂,只能坐等分享了
 楼主| 发表于 2014-6-21 10:36:12 | 显示全部楼层
SNOOKER 发表于 2014-6-20 23:43
用的是GCC编译器吗

实际是用的cosmic,只是用了gcc的make
发表于 2014-6-21 12:20:57 | 显示全部楼层
看来是很大进展啊
发表于 2014-6-21 12:35:02 | 显示全部楼层
很不错啊,如果能达到稳定就厉害了
发表于 2014-6-21 17:32:21 | 显示全部楼层
烧录了LZ github上最新的程序试了貌似不行。信号如下:


捕获到逻辑分析仪的数据


编辑:修改错别字。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
发表于 2014-6-21 17:35:04 | 显示全部楼层
显示位置的设备,插在笔记本USB3,USB2,然后用USB2的hub试了都是这样。奇怪。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
发表于 2014-6-21 20:28:41 来自手机 | 显示全部楼层
it need very excellent analysis capabilities. Great.
 楼主| 发表于 2014-6-21 21:13:41 | 显示全部楼层
本帖最后由 aammoo 于 2014-6-21 21:23 编辑
shawn_bu 发表于 2014-6-21 17:35
显示位置的设备,插在笔记本USB3,USB2,然后用USB2的hub试了都是这样。奇怪。
...


你的完全没有反应啊, 是不是配置位没有编程? PC6 和 PC7 不是用的默认状态的

注意:需要配置 option byte 的 AFR0, 使能 PC6,PC7 的 alternate function
发表于 2014-6-21 23:06:19 | 显示全部楼层
aammoo 发表于 2014-6-21 21:13
你的完全没有反应啊, 是不是配置位没有编程? PC6 和 PC7 不是用的默认状态的

注意:需要配置 option byt ...

刚配置了,试了一下貌似还是不行。
是不是需要先连D- D+线,然后再上电?



本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
 楼主| 发表于 2014-6-21 23:09:37 | 显示全部楼层
本帖最后由 aammoo 于 2014-6-21 23:11 编辑
shawn_bu 发表于 2014-6-21 23:06
刚配置了,试了一下貌似还是不行。
是不是需要先连D- D+线,然后再上电?


可以同时上电的,你跟我的原理图和板子对一下,看看是不是一样的. 我就是直接插到 USB 口上就可以了
发表于 2014-6-21 23:21:12 | 显示全部楼层
aammoo 发表于 2014-6-21 23:09
可以同时上电的,你跟我的原理图和板子对一下,看看是不是一样的. 我就是直接插到 USB 口上就可以了 ...

对比了一下原理图,应该是一样的。我用的是这个PCB http://www.amobbs.com/thread-5580494-1-1.html。这个有坛友帮转成PDF的原理图


我接的跳线:
PC6 -> D-
PC7 -> D+

对了,直接烧录stm8_usb\trunk\FW\target\target.s19 这个文件,然后配置一下option byte 的 AFR0就可以测试是吧?还有你用的晶振是12M的么。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
 楼主| 发表于 2014-6-21 23:26:22 | 显示全部楼层
晶振是12M, 你看一下起振了没. 再抓一下数据看看有没有反应, 正常的话即使识别不了也是应该有数据出来的. 可以在代码里加个点灯, 再抓一下那个点灯信号.
发表于 2014-6-21 23:35:38 | 显示全部楼层
aammoo 发表于 2014-6-21 23:26
晶振是12M, 你看一下起振了没. 再抓一下数据看看有没有反应, 正常的话即使识别不了也是应该有数据出来的.  ...

看了一下晶振波形是正常的。逻辑分析仪抓的数据还是跟之前差不多。郁闷啊。





逻辑分析仪数据:


我还没撘编译环境。待会安装你的帖子撘一下重新编译弄个指示灯试试。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
 楼主| 发表于 2014-6-22 00:39:58 来自手机 | 显示全部楼层
本帖最后由 aammoo 于 2014-6-22 00:44 编辑
shawn_bu 发表于 2014-6-21 23:35
看了一下晶振波形是正常的。逻辑分析仪抓的数据还是跟之前差不多。郁闷啊。




要用 FW / target 文件夹里的固件来试,别用错了

要编译的话直接在FW 文件夹下make就可以了,编译完后会自动下载到单片机
发表于 2014-6-22 01:36:33 来自手机 | 显示全部楼层
兼容是个问题,我一台台式机和一台笔记本都无法识别,郁闷!
发表于 2014-6-22 08:07:48 | 显示全部楼层
不知道android上的OTG上能用不?
发表于 2014-6-22 09:37:01 | 显示全部楼层
测试了4台电脑 1部OTG手机,,全部无法识别,,电路 熔丝检测N次,,,难道是人品不行,
 楼主| 发表于 2014-6-22 09:56:05 来自手机 | 显示全部楼层
hongfadg 发表于 2014-6-22 09:37
测试了4台电脑 1部OTG手机,,全部无法识别,,电路 熔丝检测N次,,,难道是人品不行, ...

你是用的FW / target里面的文件吗?直接进入FW 然后make让它自动下载进去试一下
实在不行的话,等周一有时间我再更新一下试试
发表于 2014-6-22 11:06:31 | 显示全部楼层
aammoo 发表于 2014-6-22 09:56
你是用的FW / target里面的文件吗?直接进入FW 然后make让它自动下载进去试一下
实在不行的话,等周一有 ...

是的,按你的方法也试过,用STVP下载也试过,不过我用的是XP系统,应该关系不大吧。
发表于 2014-6-22 20:53:45 来自手机 | 显示全部楼层
这个要顶啊!
发表于 2014-6-22 21:36:30 | 显示全部楼层
顶起来!
发表于 2014-6-22 23:33:49 | 显示全部楼层
这个要顶啊!
发表于 2014-6-23 01:50:38 | 显示全部楼层
SNOOKER 发表于 2014-6-20 23:43
用的是GCC编译器吗

对于gcc控(我也是)来说,多么希望有个stm8-gcc, 可惜没有,听说有一段时间他们搞过,后来无疾而终了,是因为ST公司不开放stm8的架构吧,具体不太清楚。
现在只有看看cosmic.exe的命令行参数,然后在Makefile中调用cosmic.exe来编译、链接了。
发表于 2014-6-24 09:59:10 | 显示全部楼层
逻辑分析仪的数据,下载不了。。。。奇怪,之前好像可以下载的? 是否莫哥升级服务器后出现Bug?
发表于 2014-6-24 12:25:12 | 显示全部楼层
谢谢, mark
发表于 2014-6-24 12:31:02 | 显示全部楼层
不错,兼容问题解决了就更好了。
发表于 2014-6-26 20:37:46 | 显示全部楼层
有人测试成功了木有?
 楼主| 发表于 2014-6-26 21:52:57 | 显示全部楼层
本帖最后由 aammoo 于 2014-6-26 21:54 编辑
shawn_bu 发表于 2014-6-26 20:37
有人测试成功了木有?


这几天光纵深发展了,还没找到不兼容的原因。
github上更新了一个枚举为鼠标,让鼠标指针乱颤的例子,你可以试一下。
大家一起研究一下。
发表于 2014-6-26 23:06:24 | 显示全部楼层
试了N台电脑,终于有一台识别成功了,但是不稳定有时会掉线,汗,  个人怀疑 可能是时序有误差,但手上没有设备,水平也不够,只能期待大神了。
发表于 2014-6-27 00:14:00 | 显示全部楼层
我刚才问了原作者代码兼容的问题,,他告诉我一个链接, 打开一看,正是楼主的代码链接,汗,,,看来,楼主 加油了,就看你了
我的问题,和他的回答如下。


wang
26 Июнь 2014 в 22:58        | #13 Ответить | Цитата
Hi my friend, I Download You Code ,I test 10 sets of computer.but Only one can identify. Why? Please help me,Thank you very much!

ZiB
26 Июнь 2014 в 23:03        | #14 Ответить | Цитата
@wang
Good day!
The problem stems from the fact that some controllers issue while connecting custom impulses that disrupts the logic of the program.
I do not know much English.
I have tried to explain above what could be the problem.
Look here’s the link, it may help you.
https://github.com/wlianmin/stm8_usb
发表于 2014-6-27 09:06:43 | 显示全部楼层
hongfadg 发表于 2014-6-27 00:14
我刚才问了原作者代码兼容的问题,,他告诉我一个链接, 打开一看,正是楼主的代码链接,汗,,,看来,楼 ...

哈哈,这个牛逼。LZ已经被原作者盯上了。
 楼主| 发表于 2014-7-1 21:01:23 | 显示全部楼层
hongfadg 发表于 2014-6-27 00:14
我刚才问了原作者代码兼容的问题,,他告诉我一个链接, 打开一看,正是楼主的代码链接,汗,,,看来,楼 ...

今天更新了,你试一下新的固件看看
发表于 2014-7-2 08:43:57 | 显示全部楼层
sunliezhi 发表于 2014-6-23 01:50
对于gcc控(我也是)来说,多么希望有个stm8-gcc, 可惜没有,听说有一段时间他们搞过,后来无疾而终了,是 ...

sdcc是GCC的一个分支,支持stm8,你可以到SDCC官网看看
发表于 2014-7-2 09:23:54 | 显示全部楼层
本帖最后由 hongfadg 于 2014-7-2 09:40 编辑
aammoo 发表于 2014-7-1 21:01
今天更新了,你试一下新的固件看看

经过反复实验,原来不能识别的电脑偶尔也能识别出一次,发现问题就是出在识别上,只要电脑识别出设备,基本都可以稳定工作,但问题是识别不出来。
发表于 2014-7-2 20:21:00 | 显示全部楼层
onlytest 发表于 2014-7-2 08:43
sdcc是GCC的一个分支,支持stm8,你可以到SDCC官网看看

sdcc在编译51还行吧,编译别的没用过还真不敢发言,
用过的有发言权
发表于 2014-7-16 20:17:17 | 显示全部楼层
楼主请教下 怎么在IAR下 弄成功?那个make很不方便编辑代码啊
 楼主| 发表于 2014-7-16 22:10:03 | 显示全部楼层
rootxie 发表于 2014-7-16 20:17
楼主请教下 怎么在IAR下 弄成功?那个make很不方便编辑代码啊

我也没在IAR下弄成功,所以才弄了个make, 编辑代码用Notepad++
发表于 2014-7-16 22:14:11 | 显示全部楼层
都是高手,玩的都看不懂了。
发表于 2014-7-16 22:20:37 | 显示全部楼层
今天晚上就看IAR对STM8汇编的支持程度,发现有好多指令都不支持,这下如果要用IAR搞,估计自己得重新写汇编,晕死了
你在comsic下编译过吗
发表于 2014-7-16 23:05:19 | 显示全部楼层
好厉害,佩服
 楼主| 发表于 2014-7-17 08:39:42 | 显示全部楼层
rootxie 发表于 2014-7-16 22:20
今天晚上就看IAR对STM8汇编的支持程度,发现有好多指令都不支持,这下如果要用IAR搞,估计自己得重新写汇编 ...

没有,没用过那个环境
发表于 2014-8-14 18:16:50 | 显示全部楼层
mark,标记。
发表于 2014-8-14 21:29:28 来自手机 | 显示全部楼层
mark      
发表于 2014-8-15 22:32:20 | 显示全部楼层
留个名。。。。。。。支持
发表于 2014-8-21 20:03:28 | 显示全部楼层
谢谢分享
发表于 2014-9-10 17:22:31 | 显示全部楼层
留待以后用~
发表于 2014-9-10 19:13:50 | 显示全部楼层
值得关注!
发表于 2014-9-12 15:50:33 | 显示全部楼层
暂时用不到,先mark一下
发表于 2014-9-22 16:21:17 | 显示全部楼层
你的图上stm8s用的3.3v,是不是不能直接用5V呀。我直接用5V显示 无法识别  XP系统。
发表于 2014-9-22 17:54:33 | 显示全部楼层
好强大,MARK学习一下
发表于 2014-9-22 18:15:04 | 显示全部楼层
如果做稳定了, 会很有价值!!
发表于 2014-10-22 13:26:09 | 显示全部楼层
学习了,原来只见过AVR的,STM8也有人搞了啊。
发表于 2014-10-22 13:48:32 | 显示全部楼层
理论上,这样软USB,是不是也可以搞一个host 版本的?
发表于 2014-10-22 14:16:18 | 显示全部楼层
mark      
头像被屏蔽
发表于 2014-10-22 14:18:21 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
发表于 2014-10-25 13:25:26 | 显示全部楼层
话说Saleae8的那个USB协议分析插件在那里有呢?
发表于 2014-10-25 13:31:09 | 显示全部楼层
支持楼主,严重支持。
发表于 2014-10-25 13:39:20 | 显示全部楼层
stm32f0带全速USB,也就几块钱
发表于 2014-10-25 13:43:52 | 显示全部楼层
严重支持一下
发表于 2014-10-25 15:25:22 | 显示全部楼层
支持楼主的研究精神!!
发表于 2015-7-7 17:07:18 | 显示全部楼层
make~~~~~~~
发表于 2015-7-14 19:34:18 | 显示全部楼层
知道的比较晚。想做出个来,还有板子和元件卖吗?
发表于 2015-7-14 22:50:33 | 显示全部楼层
没搞成功呢,什么试都认不到
发表于 2015-7-15 08:06:43 | 显示全部楼层
不错,准备做块板玩玩
发表于 2015-8-12 08:55:36 | 显示全部楼层
你好,请问你的STM8 USB有做出板子来吗?我用你github上的代码,板子是按你的原理图飞线的。怎么试都认不出设备。
哪里能买到你做的板子?
发表于 2015-8-12 08:58:04 | 显示全部楼层
好像连TIM1的中断都没有进入。
发表于 2015-8-12 09:06:35 | 显示全部楼层
都是爱折腾的人啊,谢谢分享
发表于 2015-8-12 17:30:28 | 显示全部楼层
我终于在个别机器上试通了。
1、楼主在Github上的代码把PC6、PC7初始化的代码注释掉了。所以不进入中断。
现在依然存在一些问题,在个别机子上能用,在个别机子上不能用。
发表于 2015-8-13 16:47:37 | 显示全部楼层
lz,有问题请教
汇编中针对PortC,是不是没有用位的方法?导致用户代码初始化PORTC以后,usb连接不上的情况。我测试基本上portc是残废了。不过对于stm8的汇编我也是基本不懂。
持续关注,这个东西挺好玩的。
发表于 2015-8-13 21:59:36 | 显示全部楼层
avr-arm 发表于 2015-8-13 16:47
lz,有问题请教
汇编中针对PortC,是不是没有用位的方法?导致用户代码初始化PORTC以后,usb连接不上的情况 ...

你留意一下,USB.c这个文件,在发送前和发送后都有对PortC进行配置。
发表于 2015-8-13 22:46:58 | 显示全部楼层
yangzhenpeng 发表于 2015-8-13 21:59
你留意一下,USB.c这个文件,在发送前和发送后都有对PortC进行配置。

3q,我记得汇编中操作portc,拉高拉低等操作,是使用的直接操作整个端口,可能我当时没好好看。
过后有时间了再研究
发表于 2015-8-13 23:07:40 | 显示全部楼层
xwkm 发表于 2014-10-25 13:25
话说Saleae8的那个USB协议分析插件在那里有呢?

是啊,我也再找这个
发表于 2015-8-14 02:37:08 来自手机 | 显示全部楼层
markkkkkkkkkkkkjk
发表于 2015-8-14 09:04:05 | 显示全部楼层
aammoo 发表于 2014-6-20 11:41
看起来问题不是很大,应该是数据发送的时机有些问题
修改了一下这里
while (usb.event == USB_EVENT_READY_ ...

这个是什么软件?能看见NRZI编码?
发表于 2015-8-14 09:22:12 | 显示全部楼层
mark      
发表于 2015-8-14 11:41:28 | 显示全部楼层
本帖最后由 yangzhenpeng 于 2015-8-14 11:45 编辑

成确处理的过程:
Time,PID,Address,Endpoint,Frame #,Data,CRC
0.8874302s,SETUP,0x00,0x00,,,0x02
0.8874573s,DATA0,,,,0x80 0x06 0x00 0x01 0x00 0x00 0x40 0x00,0x94DD
0.8875487s,IN,0x00,0x00,,,0x02
0.8875913s,IN,0x00,0x00,,,0x02
0.8876391s,IN,0x00,0x00,,,0x02
0.8876864s,IN,0x00,0x00,,,0x02
0.8877332s,IN,0x00,0x00,,,0x02
0.8877806s,IN,0x00,0x00,,,0x02
0.8878269s,IN,0x00,0x00,,,0x02
0.8878753s,IN,0x00,0x00,,,0x02
0.8879216s,IN,0x00,0x00,,,0x02
0.8879674s,IN,0x00,0x00,,,0x02
0.8880132s,IN,0x00,0x00,,,0x02
0.8880608s,IN,0x00,0x00,,,0x02
0.8881076s,IN,0x00,0x00,,,0x02
0.8881555s,IN,0x00,0x00,,,0x02
0.8882024s,IN,0x00,0x00,,,0x02
0.8884045s,IN,0x00,0x00,,,0x02
0.8884319s,DATA1,,,,0x12 0x01 0x00 0x01 0x00 0x00 0x00 0x08,0xE713
0.8885017s,ACK,,,,,
0.8885202s,IN,0x00,0x00,,,0x02
0.888567s,IN,0x00,0x00,,,0x02
0.8886129s,IN,0x00,0x00,,,0x02
0.8886598s,IN,0x00,0x00,,,0x02
0.8887056s,IN,0x00,0x00,,,0x02
0.8887515s,IN,0x00,0x00,,,0x02
0.8887984s,IN,0x00,0x00,,,0x02
0.8888442s,IN,0x00,0x00,,,0x02
0.88889s,IN,0x00,0x00,,,0x02
0.8889369s,IN,0x00,0x00,,,0x02
0.8889827s,IN,0x00,0x00,,,0x02
0.8890297s,IN,0x00,0x00,,,0x02
0.8890756s,IN,0x00,0x00,,,0x02
0.8891214s,IN,0x00,0x00,,,0x02
0.8891682s,IN,0x00,0x00,,,0x02
0.8892141s,IN,0x00,0x00,,,0x02
0.8894045s,IN,0x00,0x00,,,0x02
0.8894319s,DATA0,,,,0x11 0x22 0x33 0x44 0x55 0x66 0x00 0x00,0x2979
0.8895018s,ACK,,,,,
0.8895202s,IN,0x00,0x00,,,0x02
0.889567s,IN,0x00,0x00,,,0x02
0.8896129s,IN,0x00,0x00,,,0x02
0.8896598s,IN,0x00,0x00,,,0x02
0.8897056s,IN,0x00,0x00,,,0x02
0.8897514s,IN,0x00,0x00,,,0x02
0.8897984s,IN,0x00,0x00,,,0x02
0.8898443s,IN,0x00,0x00,,,0x02
0.8898901s,IN,0x00,0x00,,,0x02
0.889937s,IN,0x00,0x00,,,0x02
0.8899828s,IN,0x00,0x00,,,0x02
0.8900297s,IN,0x00,0x00,,,0x02
0.8900572s,DATA1,,,,0x00 0x01,0x8F3F
0.8900953s,ACK,,,,,
==========输出usb_device_descriptor完成===
0.8901516s,OUT,0x00,0x00,,,0x02
0.8901787s,DATA1,,,,,0x0000
0.9197634s,SETUP,0x00,0x00,,,0x02
0.9197904s,DATA0,,,,0x00 0x05 0x02 0x00 0x00 0x00 0x00 0x00,0x16EB
==========上这这句不知为什么整天收到0x00 0x05 0x07 0x00 0x00 0x00 0x00 0x00,0x43EB
0.9198802s,IN,0x00,0x00,,,0x02
0.9199394s,IN,0x00,0x00,,,0x02
0.919986s,IN,0x00,0x00,,,0x02
0.9200136s,DATA1,,,,,0x0000
0.9200403s,ACK,,,,,
0.9325388s,SETUP,0x02,0x00,,,0x15
0.9325659s,DATA0,,,,0x80 0x06 0x00 0x01 0x00 0x00 0x12 0x00,0xF4E0
0.9326561s,IN,0x02,0x00,,,0x15
0.9327151s,IN,0x02,0x00,,,0x15
0.9327622s,IN,0x02,0x00,,,0x15
0.9328099s,IN,0x02,0x00,,,0x15
0.9328566s,IN,0x02,0x00,,,0x15
0.9329032s,IN,0x02,0x00,,,0x15
0.9329494s,IN,0x02,0x00,,,0x15
0.9329963s,IN,0x02,0x00,,,0x15
0.9330433s,IN,0x02,0x00,,,0x15
0.9330901s,IN,0x02,0x00,,,0x15
0.9331368s,IN,0x02,0x00,,,0x15
0.9331829s,IN,0x02,0x00,,,0x15
0.9334043s,IN,0x02,0x00,,,0x15
0.9334318s,DATA1,,,,0x12 0x01 0x00 0x01 0x00 0x00 0x00 0x08,0xE713
0.9335015s,ACK,,,,,
0.93352s,IN,0x02,0x00,,,0x15
0.9335662s,IN,0x02,0x00,,,0x15
0.9336129s,IN,0x02,0x00,,,0x15
0.9336596s,IN,0x02,0x00,,,0x15
0.9337062s,IN,0x02,0x00,,,0x15
0.9337529s,IN,0x02,0x00,,,0x15
0.9337995s,IN,0x02,0x00,,,0x15
0.9338461s,IN,0x02,0x00,,,0x15
0.9338927s,IN,0x02,0x00,,,0x15
0.9339392s,IN,0x02,0x00,,,0x15
0.933986s,IN,0x02,0x00,,,0x15
0.9340325s,IN,0x02,0x00,,,0x15
0.934079s,IN,0x02,0x00,,,0x15
0.9341256s,IN,0x02,0x00,,,0x15
0.9341723s,IN,0x02,0x00,,,0x15
0.9344043s,IN,0x02,0x00,,,0x15
0.9344318s,DATA0,,,,0x11 0x22 0x33 0x44 0x55 0x66 0x00 0x00,0x2979
0.9345017s,ACK,,,,,
0.934519s,IN,0x02,0x00,,,0x15
0.9345651s,IN,0x02,0x00,,,0x15
0.9346109s,IN,0x02,0x00,,,0x15
0.9346579s,IN,0x02,0x00,,,0x15
0.9347038s,IN,0x02,0x00,,,0x15
0.9347497s,IN,0x02,0x00,,,0x15
0.9347964s,IN,0x02,0x00,,,0x15
0.9348422s,IN,0x02,0x00,,,0x15
0.934888s,IN,0x02,0x00,,,0x15
0.934935s,IN,0x02,0x00,,,0x15
0.9349809s,IN,0x02,0x00,,,0x15
0.9350278s,IN,0x02,0x00,,,0x15
0.9350553s,DATA1,,,,0x00 0x01,0x8F3F
0.9350934s,ACK,,,,,
0.9351157s,OUT,0x02,0x00,,,0x15
0.9351427s,DATA1,,,,,0x0000
0.9355167s,SETUP,0x02,0x00,,,0x15
0.9355437s,DATA0,,,,0x80 0x06 0x00 0x02 0x00 0x00 0xFF 0x00,0xA4E9
0.9356354s,IN,0x02,0x00,,,0x15
0.935678s,IN,0x02,0x00,,,0x15
0.935724s,IN,0x02,0x00,,,0x15
0.9357709s,IN,0x02,0x00,,,0x15
0.9358182s,IN,0x02,0x00,,,0x15
0.9358732s,IN,0x02,0x00,,,0x15
0.9359198s,IN,0x02,0x00,,,0x15
0.9359656s,IN,0x02,0x00,,,0x15
0.9360115s,IN,0x02,0x00,,,0x15
0.9360583s,IN,0x02,0x00,,,0x15
0.9361042s,IN,0x02,0x00,,,0x15
0.9361528s,IN,0x02,0x00,,,0x15
0.9361987s,IN,0x02,0x00,,,0x15
0.9364043s,IN,0x02,0x00,,,0x15
0.9364318s,DATA1,,,,0x09 0x02 0x22 0x00 0x01 0x01 0x00 0x80,0x400B
0.9365015s,ACK,,,,,
0.9365199s,IN,0x02,0x00,,,0x15
0.9365668s,IN,0x02,0x00,,,0x15
0.9366127s,IN,0x02,0x00,,,0x15
0.9366595s,IN,0x02,0x00,,,0x15
0.9367053s,IN,0x02,0x00,,,0x15
0.9367511s,IN,0x02,0x00,,,0x15
0.9367981s,IN,0x02,0x00,,,0x15
0.936844s,IN,0x02,0x00,,,0x15
0.9368898s,IN,0x02,0x00,,,0x15
0.9369367s,IN,0x02,0x00,,,0x15
0.9369825s,IN,0x02,0x00,,,0x15
0.9370294s,IN,0x02,0x00,,,0x15
0.9370753s,IN,0x02,0x00,,,0x15
0.9371211s,IN,0x02,0x00,,,0x15
0.937168s,IN,0x02,0x00,,,0x15
0.9372138s,IN,0x02,0x00,,,0x15
0.9374043s,IN,0x02,0x00,,,0x15
0.9374318s,DATA0,,,,0x30 0x09 0x04 0x00 0x00 0x01 0x03 0x01,0x94B4
0.9375015s,ACK,,,,,
0.9375199s,IN,0x02,0x00,,,0x15
0.9375668s,IN,0x02,0x00,,,0x15
0.9376127s,IN,0x02,0x00,,,0x15
0.9376595s,IN,0x02,0x00,,,0x15
0.9377053s,IN,0x02,0x00,,,0x15
0.9377512s,IN,0x02,0x00,,,0x15
0.9377981s,IN,0x02,0x00,,,0x15
0.937844s,IN,0x02,0x00,,,0x15
0.9378898s,IN,0x02,0x00,,,0x15
0.9379367s,IN,0x02,0x00,,,0x15
0.9379825s,IN,0x02,0x00,,,0x15
0.9380294s,IN,0x02,0x00,,,0x15
0.9380753s,IN,0x02,0x00,,,0x15
0.9381211s,IN,0x02,0x00,,,0x15
0.938168s,IN,0x02,0x00,,,0x15
0.9382145s,IN,0x02,0x00,,,0x15
0.9384043s,IN,0x02,0x00,,,0x15
0.9384318s,DATA1,,,,0x02 0x00 0x09 0x21 0x10 0x01 0x21 0x01,0x230E
0.9385016s,ACK,,,,,
0.93852s,IN,0x02,0x00,,,0x15
0.9385668s,IN,0x02,0x00,,,0x15
0.9386127s,IN,0x02,0x00,,,0x15
0.9386595s,IN,0x02,0x00,,,0x15
0.9387054s,IN,0x02,0x00,,,0x15
0.9387512s,IN,0x02,0x00,,,0x15
0.9387981s,IN,0x02,0x00,,,0x15
0.938844s,IN,0x02,0x00,,,0x15
0.9388899s,IN,0x02,0x00,,,0x15
0.9389367s,IN,0x02,0x00,,,0x15
0.9389825s,IN,0x02,0x00,,,0x15
0.9390294s,IN,0x02,0x00,,,0x15
0.9390754s,IN,0x02,0x00,,,0x15
0.9391212s,IN,0x02,0x00,,,0x15
0.939168s,IN,0x02,0x00,,,0x15
0.9392139s,IN,0x02,0x00,,,0x15
0.9394043s,IN,0x02,0x00,,,0x15
0.9394318s,DATA0,,,,0x22 0x34 0x00 0x07 0x05 0x81 0x03 0x04,0xE1AD
0.9395015s,ACK,,,,,
0.93952s,IN,0x02,0x00,,,0x15
0.9395667s,IN,0x02,0x00,,,0x15
0.9396125s,IN,0x02,0x00,,,0x15
0.9396595s,IN,0x02,0x00,,,0x15
0.9397054s,IN,0x02,0x00,,,0x15
0.9397513s,IN,0x02,0x00,,,0x15
0.9397981s,IN,0x02,0x00,,,0x15
0.9398439s,IN,0x02,0x00,,,0x15
0.9398898s,IN,0x02,0x00,,,0x15
0.9399367s,IN,0x02,0x00,,,0x15
0.9399826s,IN,0x02,0x00,,,0x15
0.9400294s,IN,0x02,0x00,,,0x15
0.9400569s,DATA1,,,,0x00 0x0A,0x487E
0.940095s,ACK,,,,,
===========这里输完了usb_configuration_descriptor
0.9401514s,OUT,0x02,0x00,,,0x15
0.9401784s,DATA1,,,,,0x0000
0.9421919s,SETUP,0x02,0x00,,,0x15
0.942219s,DATA0,,,,0x80 0x06 0x00 0x01 0x00 0x00 0x12 0x00,0xF4E0
===========上面这句也不一样0x80 0x06 0x00 0x02 0x00 0x00 0x09 0x00,0x04AE
0.9424043s,IN,0x02,0x00,,,0x15
0.942457s,IN,0x02,0x00,,,0x15
0.9425106s,IN,0x02,0x00,,,0x15
0.942563s,IN,0x02,0x00,,,0x15
0.9426097s,IN,0x02,0x00,,,0x15
0.9426574s,IN,0x02,0x00,,,0x15
0.9427041s,IN,0x02,0x00,,,0x15
0.9427511s,IN,0x02,0x00,,,0x15
0.9427977s,IN,0x02,0x00,,,0x15
0.9428444s,IN,0x02,0x00,,,0x15
0.9428909s,IN,0x02,0x00,,,0x15
0.942937s,IN,0x02,0x00,,,0x15
0.9429644s,DATA1,,,,0x12 0x01 0x00 0x01 0x00 0x00 0x00 0x08,0xE713
0.9430342s,ACK,,,,,
0.9430537s,IN,0x02,0x00,,,0x15
0.9431002s,IN,0x02,0x00,,,0x15
0.943151s,IN,0x02,0x00,,,0x15
0.9431978s,IN,0x02,0x00,,,0x15
0.9434043s,IN,0x02,0x00,,,0x15
0.9434318s,DATA0,,,,0x11 0x22 0x33 0x44 0x55 0x66 0x00 0x00,0x2979
0.9435017s,ACK,,,,,
0.9435197s,IN,0x02,0x00,,,0x15
0.9435663s,IN,0x02,0x00,,,0x15
0.943613s,IN,0x02,0x00,,,0x15
0.9436598s,IN,0x02,0x00,,,0x15
0.9437066s,IN,0x02,0x00,,,0x15
0.9437531s,IN,0x02,0x00,,,0x15
0.9437994s,IN,0x02,0x00,,,0x15
0.9438461s,IN,0x02,0x00,,,0x15
0.9438928s,IN,0x02,0x00,,,0x15
0.9439391s,IN,0x02,0x00,,,0x15
0.9439857s,IN,0x02,0x00,,,0x15
0.9440132s,DATA1,,,,0x00 0x01,0x8F3F
=========再一次接收完usb_device_descriptor
0.9440513s,ACK,,,,,
0.9440717s,OUT,0x02,0x00,,,0x15
0.9440988s,DATA1,,,,,0x0000
0.944214s,SETUP,0x02,0x00,,,0x15
0.944241s,DATA0,,,,0x80 0x06 0x00 0x02 0x00 0x00 0x09 0x00,0x04AE
0.9444043s,IN,0x02,0x00,,,0x15
0.9444518s,IN,0x02,0x00,,,0x15
0.9444985s,IN,0x02,0x00,,,0x15
0.9445451s,IN,0x02,0x00,,,0x15
0.9445922s,IN,0x02,0x00,,,0x15
0.9446386s,IN,0x02,0x00,,,0x15
0.9446848s,IN,0x02,0x00,,,0x15
0.9447314s,IN,0x02,0x00,,,0x15
0.9447781s,IN,0x02,0x00,,,0x15
0.9448248s,IN,0x02,0x00,,,0x15
0.9448716s,IN,0x02,0x00,,,0x15
0.9449179s,IN,0x02,0x00,,,0x15
0.9449646s,IN,0x02,0x00,,,0x15
0.9450116s,IN,0x02,0x00,,,0x15
0.945058s,IN,0x02,0x00,,,0x15
0.9451047s,IN,0x02,0x00,,,0x15
0.9451531s,IN,0x02,0x00,,,0x15
0.9451996s,IN,0x02,0x00,,,0x15
0.9454042s,IN,0x02,0x00,,,0x15
0.9454317s,DATA1,,,,0x09 0x02 0x22 0x00 0x01 0x01 0x00 0x80,0x400B
0.9455013s,ACK,,,,,
0.9455198s,IN,0x02,0x00,,,0x15
0.9455663s,IN,0x02,0x00,,,0x15
0.945613s,IN,0x02,0x00,,,0x15
0.9456597s,IN,0x02,0x00,,,0x15
0.9457066s,IN,0x02,0x00,,,0x15
0.9457532s,IN,0x02,0x00,,,0x15
0.9457807s,DATA0,,,,0x30,0xAB40
0.9458127s,ACK,,,,,
0.9458321s,OUT,0x02,0x00,,,0x15
0.9458592s,DATA1,,,,,0x0000
0.9459567s,SETUP,0x02,0x00,,,0x15
0.9459838s,DATA0,,,,0x80 0x06 0x00 0x02 0x00 0x00 0x22 0x00,0xF4B0
0.9460732s,IN,0x02,0x00,,,0x15
0.9461325s,IN,0x02,0x00,,,0x15
0.9461788s,IN,0x02,0x00,,,0x15
0.9464042s,IN,0x02,0x00,,,0x15
0.9464318s,DATA1,,,,0x09 0x02 0x22 0x00 0x01 0x01 0x00 0x80,0x400B
0.9465014s,ACK,,,,,
0.9465198s,IN,0x02,0x00,,,0x15
0.9465667s,IN,0x02,0x00,,,0x15
0.9466134s,IN,0x02,0x00,,,0x15
0.9466595s,IN,0x02,0x00,,,0x15
0.9467064s,IN,0x02,0x00,,,0x15
0.9467531s,IN,0x02,0x00,,,0x15
0.9467997s,IN,0x02,0x00,,,0x15
0.9468463s,IN,0x02,0x00,,,0x15
0.9468931s,IN,0x02,0x00,,,0x15
0.9469393s,IN,0x02,0x00,,,0x15
0.9469857s,IN,0x02,0x00,,,0x15
0.9470324s,IN,0x02,0x00,,,0x15
0.9470795s,IN,0x02,0x00,,,0x15
0.9471261s,IN,0x02,0x00,,,0x15
0.9471724s,IN,0x02,0x00,,,0x15
0.9474042s,IN,0x02,0x00,,,0x15
0.9474318s,DATA0,,,,0x30 0x09 0x04 0x00 0x00 0x01 0x03 0x01,0x94B4
0.9475015s,ACK,,,,,
0.9475197s,IN,0x02,0x00,,,0x15
0.9475666s,IN,0x02,0x00,,,0x15
0.9476138s,IN,0x02,0x00,,,0x15
0.9476616s,IN,0x02,0x00,,,0x15
0.9477083s,IN,0x02,0x00,,,0x15
0.9477547s,IN,0x02,0x00,,,0x15
0.9478013s,IN,0x02,0x00,,,0x15
0.947848s,IN,0x02,0x00,,,0x15
0.9478947s,IN,0x02,0x00,,,0x15
0.9479414s,IN,0x02,0x00,,,0x15
0.9479881s,IN,0x02,0x00,,,0x15
0.9480345s,IN,0x02,0x00,,,0x15
0.9480814s,IN,0x02,0x00,,,0x15
0.948128s,IN,0x02,0x00,,,0x15
0.9481744s,IN,0x02,0x00,,,0x15
0.9484042s,IN,0x02,0x00,,,0x15
0.9484317s,DATA1,,,,0x02 0x00 0x09 0x21 0x10 0x01 0x21 0x01,0x230E
0.9485016s,ACK,,,,,
0.9485195s,IN,0x02,0x00,,,0x15
0.9485665s,IN,0x02,0x00,,,0x15
0.948613s,IN,0x02,0x00,,,0x15
0.9486595s,IN,0x02,0x00,,,0x15
0.948706s,IN,0x02,0x00,,,0x15
0.9487528s,IN,0x02,0x00,,,0x15
0.9487994s,IN,0x02,0x00,,,0x15
0.9488461s,IN,0x02,0x00,,,0x15
0.9488928s,IN,0x02,0x00,,,0x15
0.9489391s,IN,0x02,0x00,,,0x15
0.9489858s,IN,0x02,0x00,,,0x15
0.9490324s,IN,0x02,0x00,,,0x15
0.9490789s,IN,0x02,0x00,,,0x15
0.9491255s,IN,0x02,0x00,,,0x15
0.9491722s,IN,0x02,0x00,,,0x15
0.9494042s,IN,0x02,0x00,,,0x15
0.9494317s,DATA0,,,,0x22 0x34 0x00 0x07 0x05 0x81 0x03 0x04,0xE1AD
0.9495014s,ACK,,,,,
0.9495197s,IN,0x02,0x00,,,0x15
0.9495663s,IN,0x02,0x00,,,0x15
0.9496129s,IN,0x02,0x00,,,0x15
0.9496596s,IN,0x02,0x00,,,0x15
0.949706s,IN,0x02,0x00,,,0x15
0.9497527s,IN,0x02,0x00,,,0x15
0.9497993s,IN,0x02,0x00,,,0x15
0.949846s,IN,0x02,0x00,,,0x15
0.9498927s,IN,0x02,0x00,,,0x15
0.9499394s,IN,0x02,0x00,,,0x15
0.9499861s,IN,0x02,0x00,,,0x15
0.9500136s,DATA1,,,,0x00 0x0A,0x487E
0.9500517s,ACK,,,,,
======这里输出完了usb_configuration_descriptor
0.9500717s,OUT,0x02,0x00,,,0x15
0.9500987s,DATA1,,,,,0x0000
//下面这个包如果是SETUP,0x02,0x00,,,0x15就能认出设备了
//不能认出设备的机器,下面这里会传SETUP,0x00,0x00,,,..

0.9502131s,SETUP,0x02,0x00,,,0x15
0.9502402s,DATA0,,,,0x00 0x09 0x01 0x00 0x00 0x00 0x00 0x00,0x2527
0.9504042s,IN,0x02,0x00,,,0x15
0.9504317s,DATA1,,,,,0x0000
0.9504584s,ACK,,,,,
发表于 2015-8-14 11:43:36 | 显示全部楼层
失败处理的过程:
Time ,PID,Address,Endpoint,Frame #,Data,CRC
1.6050518s,SETUP,0x00,0x00,,,0x02
1.6050788s,DATA0,,,,0x80 0x06 0x00 0x01 0x00 0x00 0x40 0x00,0x94DD
1.6051705s,IN,0x00,0x00,,,0x02
1.6052132s,IN,0x00,0x00,,,0x02
1.6052599s,IN,0x00,0x00,,,0x02
1.6053102s,IN,0x00,0x00,,,0x02
1.6053593s,IN,0x00,0x00,,,0x02
1.6054052s,IN,0x00,0x00,,,0x02
1.6056108s,IN,0x00,0x00,,,0x02
1.6056383s,DATA1,,,,0x12 0x01 0x00 0x01 0x00 0x00 0x00 0x08,0xE713
1.6057085s,ACK,,,,,
1.6057267s,IN,0x00,0x00,,,0x02
1.6057734s,IN,0x00,0x00,,,0x02
1.6058193s,IN,0x00,0x00,,,0x02
1.6058671s,IN,0x00,0x00,,,0x02
1.6059148s,IN,0x00,0x00,,,0x02
1.6059632s,IN,0x00,0x00,,,0x02
1.6060097s,IN,0x00,0x00,,,0x02
1.6060556s,IN,0x00,0x00,,,0x02
1.6061015s,IN,0x00,0x00,,,0x02
1.6061484s,IN,0x00,0x00,,,0x02
1.6061943s,IN,0x00,0x00,,,0x02
1.6062411s,IN,0x00,0x00,,,0x02
1.606287s,IN,0x00,0x00,,,0x02
1.6063329s,IN,0x00,0x00,,,0x02
1.6063796s,IN,0x00,0x00,,,0x02
1.6066108s,IN,0x00,0x00,,,0x02
1.6066383s,DATA0,,,,0x11 0x22 0x33 0x44 0x55 0x66 0x00 0x00,0x2979
1.6067083s,ACK,,,,,
1.6067267s,IN,0x00,0x00,,,0x02
1.6067734s,IN,0x00,0x00,,,0x02
1.6068193s,IN,0x00,0x00,,,0x02
1.6068672s,IN,0x00,0x00,,,0x02
1.6069157s,IN,0x00,0x00,,,0x02
1.606962s,IN,0x00,0x00,,,0x02
1.6070104s,IN,0x00,0x00,,,0x02
1.6070587s,IN,0x00,0x00,,,0x02
1.6071076s,IN,0x00,0x00,,,0x02
1.607135s,DATA1,,,,0x00 0x01,0x8F3F
1.6071735s,ACK,,,,,
1.6071926s,OUT,0x00,0x00,,,0x02
1.6072196s,DATA1,,,,,0x0000
1.6489151s,SETUP,0x00,0x00,,,0x02
1.6489421s,DATA0,,,,0x00 0x05 0x02 0x00 0x00 0x00 0x00 0x00,0x16EB
1.6490319s,IN,0x00,0x00,,,0x02
1.6490908s,IN,0x00,0x00,,,0x02
1.6491391s,IN,0x00,0x00,,,0x02
1.6491666s,DATA1,,,,,0x0000
1.6491937s,ACK,,,,,
1.6920209s,SETUP,0x02,0x00,,,0x15
1.692048s,DATA0,,,,0x80 0x06 0x00 0x01 0x00 0x00 0x12 0x00,0xF4E0
1.6921392s,IN,0x02,0x00,,,0x15
1.6921818s,IN,0x02,0x00,,,0x15
1.692232s,IN,0x02,0x00,,,0x15
1.69228s,IN,0x02,0x00,,,0x15
1.6923255s,IN,0x02,0x00,,,0x15
1.6923724s,IN,0x02,0x00,,,0x15
1.6924183s,IN,0x02,0x00,,,0x15
1.6926103s,IN,0x02,0x00,,,0x15
1.6926377s,DATA1,,,,0x12 0x01 0x00 0x01 0x00 0x00 0x00 0x08,0xE713
1.692708s,ACK,,,,,
1.6927262s,IN,0x02,0x00,,,0x15
1.6927728s,IN,0x02,0x00,,,0x15
1.6928187s,IN,0x02,0x00,,,0x15
1.6928659s,IN,0x02,0x00,,,0x15
1.6929135s,IN,0x02,0x00,,,0x15
1.6929606s,IN,0x02,0x00,,,0x15
1.6930074s,IN,0x02,0x00,,,0x15
1.6930562s,IN,0x02,0x00,,,0x15
1.693107s,IN,0x02,0x00,,,0x15
1.6931556s,IN,0x02,0x00,,,0x15
1.6932019s,IN,0x02,0x00,,,0x15
1.6932497s,IN,0x02,0x00,,,0x15
1.6933042s,IN,0x02,0x00,,,0x15
1.6933502s,IN,0x02,0x00,,,0x15
1.6933961s,IN,0x02,0x00,,,0x15
1.6936102s,IN,0x02,0x00,,,0x15
1.6936377s,DATA0,,,,0x11 0x22 0x33 0x44 0x55 0x66 0x00 0x00,0x2979
1.6937077s,ACK,,,,,
1.6937261s,IN,0x02,0x00,,,0x15
1.6937728s,IN,0x02,0x00,,,0x15
1.6938187s,IN,0x02,0x00,,,0x15
1.6938667s,IN,0x02,0x00,,,0x15
1.6939152s,IN,0x02,0x00,,,0x15
1.6939615s,IN,0x02,0x00,,,0x15
1.6940099s,IN,0x02,0x00,,,0x15
1.6940587s,IN,0x02,0x00,,,0x15
1.6941091s,IN,0x02,0x00,,,0x15
1.6941366s,DATA1,,,,0x00 0x01,0x8F3F
1.6941751s,ACK,,,,,
1.6941943s,OUT,0x02,0x00,,,0x15
1.6942214s,DATA1,,,,,0x0000
1.6949489s,SETUP,0x02,0x00,,,0x15
1.6949759s,DATA0,,,,0x80 0x06 0x00 0x02 0x00 0x00 0xFF 0x00,0xA4E9
1.695067s,IN,0x02,0x00,,,0x15
1.6951096s,IN,0x02,0x00,,,0x15
1.6951578s,IN,0x02,0x00,,,0x15
1.6952039s,IN,0x02,0x00,,,0x15
1.6952507s,IN,0x02,0x00,,,0x15
1.6952966s,IN,0x02,0x00,,,0x15
1.6953426s,IN,0x02,0x00,,,0x15
1.6953893s,IN,0x02,0x00,,,0x15
1.6956102s,IN,0x02,0x00,,,0x15
1.6956377s,DATA1,,,,0x09 0x02 0x22 0x00 0x01 0x01 0x00 0x80,0x400B
1.6957081s,ACK,,,,,
1.6957262s,IN,0x02,0x00,,,0x15
1.6957728s,IN,0x02,0x00,,,0x15
1.6958188s,IN,0x02,0x00,,,0x15
1.6958667s,IN,0x02,0x00,,,0x15
1.6959147s,IN,0x02,0x00,,,0x15
1.6959619s,IN,0x02,0x00,,,0x15
1.6960095s,IN,0x02,0x00,,,0x15
1.6960558s,IN,0x02,0x00,,,0x15
1.6961021s,IN,0x02,0x00,,,0x15
1.6961504s,IN,0x02,0x00,,,0x15
1.6961984s,IN,0x02,0x00,,,0x15
1.6962467s,IN,0x02,0x00,,,0x15
1.6962929s,IN,0x02,0x00,,,0x15
1.6963388s,IN,0x02,0x00,,,0x15
1.6963842s,IN,0x02,0x00,,,0x15
1.6966102s,IN,0x02,0x00,,,0x15
1.6966377s,DATA0,,,,0x30 0x09 0x04 0x00 0x00 0x01 0x03 0x01,0x94B4
1.696708s,ACK,,,,,
1.696732s,IN,0x02,0x00,,,0x15
1.6967797s,IN,0x02,0x00,,,0x15
1.6968303s,IN,0x02,0x00,,,0x15
1.6968773s,IN,0x02,0x00,,,0x15
1.6969235s,IN,0x02,0x00,,,0x15
1.6969699s,IN,0x02,0x00,,,0x15
1.6970176s,IN,0x02,0x00,,,0x15
1.6970639s,IN,0x02,0x00,,,0x15
1.6971121s,IN,0x02,0x00,,,0x15
1.6971608s,IN,0x02,0x00,,,0x15
1.6972092s,IN,0x02,0x00,,,0x15
1.6972578s,IN,0x02,0x00,,,0x15
1.6973054s,IN,0x02,0x00,,,0x15
1.6973513s,IN,0x02,0x00,,,0x15
1.6973978s,IN,0x02,0x00,,,0x15
1.6976102s,IN,0x02,0x00,,,0x15
1.6976377s,DATA1,,,,0x02 0x00 0x09 0x21 0x10 0x01 0x21 0x01,0x230E
1.6977078s,ACK,,,,,
1.6977261s,IN,0x02,0x00,,,0x15
1.6977728s,IN,0x02,0x00,,,0x15
1.6978187s,IN,0x02,0x00,,,0x15
1.6978653s,IN,0x02,0x00,,,0x15
1.6979133s,IN,0x02,0x00,,,0x15
1.6979609s,IN,0x02,0x00,,,0x15
1.6980073s,IN,0x02,0x00,,,0x15
1.6980536s,IN,0x02,0x00,,,0x15
1.6981018s,IN,0x02,0x00,,,0x15
1.698148s,IN,0x02,0x00,,,0x15
1.6981939s,IN,0x02,0x00,,,0x15
1.6982405s,IN,0x02,0x00,,,0x15
1.6982864s,IN,0x02,0x00,,,0x15
1.6983323s,IN,0x02,0x00,,,0x15
1.698379s,IN,0x02,0x00,,,0x15
1.6986102s,IN,0x02,0x00,,,0x15
1.6986377s,DATA0,,,,0x22 0x34 0x00 0x07 0x05 0x81 0x03 0x04,0xE1AD
1.6987079s,ACK,,,,,
1.6987261s,IN,0x02,0x00,,,0x15
1.6987728s,IN,0x02,0x00,,,0x15
1.6988186s,IN,0x02,0x00,,,0x15
1.6988669s,IN,0x02,0x00,,,0x15
1.6989155s,IN,0x02,0x00,,,0x15
1.6989636s,IN,0x02,0x00,,,0x15
1.699011s,IN,0x02,0x00,,,0x15
1.6990572s,IN,0x02,0x00,,,0x15
1.699107s,IN,0x02,0x00,,,0x15
1.6991344s,DATA1,,,,0x00 0x0A,0x487E
1.6991731s,ACK,,,,,
1.6991925s,OUT,0x02,0x00,,,0x15
1.6992196s,DATA1,,,,,0x0000
1.8137861s,SETUP,0x02,0x00,,,0x15
1.8138132s,DATA0,,,,0x80 0x06 0x00 0x02 0x00 0x00 0x09 0x00,0x04AE
1.813903s,IN,0x02,0x00,,,0x15
1.8139618s,IN,0x02,0x00,,,0x15
1.8140102s,IN,0x02,0x00,,,0x15
1.8140564s,IN,0x02,0x00,,,0x15
1.8141062s,IN,0x02,0x00,,,0x15
1.8141549s,IN,0x02,0x00,,,0x15
1.8142011s,IN,0x02,0x00,,,0x15
1.8142493s,IN,0x02,0x00,,,0x15
1.8142981s,IN,0x02,0x00,,,0x15
1.8143444s,IN,0x02,0x00,,,0x15
1.8143915s,IN,0x02,0x00,,,0x15
1.8146095s,IN,0x02,0x00,,,0x15
1.8146369s,DATA1,,,,0x09 0x02 0x22 0x00 0x01 0x01 0x00 0x80,0x400B
1.8147073s,ACK,,,,,
1.814726s,IN,0x02,0x00,,,0x15
1.8147744s,IN,0x02,0x00,,,0x15
1.8148207s,IN,0x02,0x00,,,0x15
1.8148687s,IN,0x02,0x00,,,0x15
1.8149149s,IN,0x02,0x00,,,0x15
1.8149612s,IN,0x02,0x00,,,0x15
1.8149887s,DATA0,,,,0x30,0xAB40
1.8150213s,ACK,,,,,
1.815041s,OUT,0x02,0x00,,,0x15
1.815068s,DATA1,,,,,0x0000
1.8156095s,SETUP,0x02,0x00,,,0x15
1.8156365s,DATA0,,,,0x80 0x06 0x00 0x02 0x00 0x00 0x22 0x00,0xF4B0
1.8157312s,IN,0x02,0x00,,,0x15
1.8157738s,IN,0x02,0x00,,,0x15
1.8158221s,IN,0x02,0x00,,,0x15
1.8158688s,IN,0x02,0x00,,,0x15
1.8159151s,IN,0x02,0x00,,,0x15
1.8159614s,IN,0x02,0x00,,,0x15
1.8160088s,IN,0x02,0x00,,,0x15
1.8160551s,IN,0x02,0x00,,,0x15
1.8161013s,IN,0x02,0x00,,,0x15
1.8161497s,IN,0x02,0x00,,,0x15
1.8161981s,IN,0x02,0x00,,,0x15
1.8162455s,IN,0x02,0x00,,,0x15
1.8162939s,IN,0x02,0x00,,,0x15
1.8163402s,IN,0x02,0x00,,,0x15
1.8163867s,IN,0x02,0x00,,,0x15
1.8166095s,IN,0x02,0x00,,,0x15
1.8166369s,DATA1,,,,0x09 0x02 0x22 0x00 0x01 0x01 0x00 0x80,0x400B
1.8167072s,ACK,,,,,
1.8167264s,IN,0x02,0x00,,,0x15
1.8167743s,IN,0x02,0x00,,,0x15
1.8168207s,IN,0x02,0x00,,,0x15
1.8168692s,IN,0x02,0x00,,,0x15
1.8169154s,IN,0x02,0x00,,,0x15
1.8169617s,IN,0x02,0x00,,,0x15
1.8170092s,IN,0x02,0x00,,,0x15
1.8170555s,IN,0x02,0x00,,,0x15
1.8171062s,IN,0x02,0x00,,,0x15
1.8171546s,IN,0x02,0x00,,,0x15
1.8172008s,IN,0x02,0x00,,,0x15
1.8172489s,IN,0x02,0x00,,,0x15
1.8172952s,IN,0x02,0x00,,,0x15
1.8173436s,IN,0x02,0x00,,,0x15
1.8173919s,IN,0x02,0x00,,,0x15
1.8176095s,IN,0x02,0x00,,,0x15
1.8176369s,DATA0,,,,0x30 0x09 0x04 0x00 0x00 0x01 0x03 0x01,0x94B4
1.8177073s,ACK,,,,,
1.8177312s,IN,0x02,0x00,,,0x15
1.8177788s,IN,0x02,0x00,,,0x15
1.8178278s,IN,0x02,0x00,,,0x15
1.8178761s,IN,0x02,0x00,,,0x15
1.8179224s,IN,0x02,0x00,,,0x15
1.8179707s,IN,0x02,0x00,,,0x15
1.8180194s,IN,0x02,0x00,,,0x15
1.8180657s,IN,0x02,0x00,,,0x15
1.8181137s,IN,0x02,0x00,,,0x15
1.8181599s,IN,0x02,0x00,,,0x15
1.8182065s,IN,0x02,0x00,,,0x15
1.8182526s,IN,0x02,0x00,,,0x15
1.8182993s,IN,0x02,0x00,,,0x15
1.8183456s,IN,0x02,0x00,,,0x15
1.818392s,IN,0x02,0x00,,,0x15
1.8186094s,IN,0x02,0x00,,,0x15
1.8186369s,DATA1,,,,0x02 0x00 0x09 0x21 0x10 0x01 0x21 0x01,0x230E
1.818707s,ACK,,,,,
1.8187263s,IN,0x02,0x00,,,0x15
1.8187743s,IN,0x02,0x00,,,0x15
1.8188206s,IN,0x02,0x00,,,0x15
1.8188686s,IN,0x02,0x00,,,0x15
1.8189168s,IN,0x02,0x00,,,0x15
1.8189631s,IN,0x02,0x00,,,0x15
1.8190112s,IN,0x02,0x00,,,0x15
1.8190599s,IN,0x02,0x00,,,0x15
1.8191085s,IN,0x02,0x00,,,0x15
1.8191571s,IN,0x02,0x00,,,0x15
1.8192059s,IN,0x02,0x00,,,0x15
1.8192538s,IN,0x02,0x00,,,0x15
1.8193026s,IN,0x02,0x00,,,0x15
1.8193489s,IN,0x02,0x00,,,0x15
1.8193969s,IN,0x02,0x00,,,0x15
1.8196094s,IN,0x02,0x00,,,0x15
1.8196369s,DATA0,,,,0x22 0x34 0x00 0x07 0x05 0x81 0x03 0x04,0xE1AD
1.8197072s,ACK,,,,,
1.8197312s,IN,0x02,0x00,,,0x15
1.819778s,IN,0x02,0x00,,,0x15
1.8198264s,IN,0x02,0x00,,,0x15
1.8198739s,IN,0x02,0x00,,,0x15
1.8199223s,IN,0x02,0x00,,,0x15
1.8199686s,IN,0x02,0x00,,,0x15
1.8200169s,IN,0x02,0x00,,,0x15
1.8200657s,IN,0x02,0x00,,,0x15
1.8200931s,DATA1,,,,0x00 0x0A,0x487E
1.8201319s,ACK,,,,,
1.8201534s,OUT,0x02,0x00,,,0x15
1.8201805s,DATA1,,,,,0x0000
//最大的区别就是在下面这个SETUP包,
//能正确识别的机器,这里是发送SETUP,0x02,0x00,,,0x02的这里怎么又用来0x00了。

2.0329178s,SETUP,0x00,0x00,,,0x02
2.0329449s,DATA0,,,,0x80 0x06 0x00 0x01 0x00 0x00 0x40 0x00,0x94DD
2.0330329s,IN,0x00,0x00,,,0x02
2.0330918s,IN,0x00,0x00,,,0x02
2.0331344s,IN,0x00,0x00,,,0x02
2.6209564s,SETUP,0x00,0x00,,,0x02
2.6209834s,DATA0,,,,0x80 0x06 0x00 0x01 0x00 0x00 0x40 0x00,0x94DD
2.6210744s,IN,0x00,0x00,,,0x02
2.621117s,IN,0x00,0x00,,,0x02
2.6211596s,IN,0x00,0x00,,,0x02
3.2089749s,SETUP,0x00,0x00,,,0x02
3.2090019s,DATA0,,,,0x80 0x06 0x00 0x01 0x00 0x00 0x40 0x00,0x94DD
3.209091s,IN,0x00,0x00,,,0x02
3.2091499s,IN,0x00,0x00,,,0x02
3.2091925s,IN,0x00,0x00,,,0x02
3.7970159s,SETUP,0x00,0x00,,,0x02
3.7970429s,DATA0,,,,0x80 0x06 0x00 0x01 0x00 0x00 0x40 0x00,0x94DD
3.7971319s,IN,0x00,0x00,,,0x02
3.7971909s,IN,0x00,0x00,,,0x02
发表于 2015-10-7 02:27:18 | 显示全部楼层
值得学习。
友情提示:标题不合格、重复发帖,将会被封锁ID。详情请参考:论坛通告:封锁ID、获得注册邀请码、恢复被封ID、投诉必读
您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|Archiver|amobbs.com 阿莫电子论坛 ( 公安备案:44190002001997(交互式论坛) 工信部备案:粤ICP备09047143号-1 )

GMT+8, 2020-4-8 22:19

阿莫电子论坛, 原"中国电子开发网"

© 2004-2018 www.amobbs.com, 原www.ourdev.cn, 原www.ouravr.com

快速回复 返回顶部 返回列表