完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
我有一个问题,在定制的UART的第一个包不工作,每个PSoC 3,PSoC 4,PSoC 5LP和PSoC模拟协处理器UART Bootloader页面33-35HTTP://wwwyCysP.COM/FIL/417171下载。这个包只包含启动、输入引导加载命令、两个命令的校验和和结束命令。校验和应该是LSB和MSB的两个补充,添加0x38和0x01是0x39,但由于某种原因,PSoC响应不正确的校验和或0x。08。我使用的当前值是MSB的LSB和0x0C的0x07。如果有人对这个问题有什么想法,请回答。
-谢谢 以上来自于百度翻译 以下为原文 I'm having an issue with the checksum not working for the first packet in making a custom UART,per the Psoc 3, Psoc 4, Psoc 5LP and Psoc Analog Coprocessor UART Bootloader page 33-35 http://www.cypress.com/file/45171/download . This packet only contains start, the enter bootload command,the checksum for those two commands and the end command.The checksum should be the two's complement of the LSB and MSB for the addition of 0x38 and 0x01 which is 0x39 but for some reason the psoc is responding with incorrect checksum or 0x08. The current values that I am using are 0x07 for the LSB and 0x0C for the MSB. If anyone has an idea on what the issue may be please reply. -Thanks |
|
相关推荐
5个回答
|
|
|
你好,
有两种类型的校验和计算,它们可以在引导加载程序组件配置(基本求和和CRC-16-ccITT)中选择。 在此基础上,CyAcd报头中的校验和选项发生变化。你能检查一下你是否计算这个配置的校验和? 谢谢, 希马 以上来自于百度翻译 以下为原文 Hello, There are two types of checksum calculations which can be selected in the Bootloader component configuration (Basic Summation and CRC-16-CCITT). Based on this the checksum option in the .cyacd header changes. Can you check if you are calculation the checksum with respect to this configuration? Thanks, Hima |
|
|
|
|
60user67 发表于 2018-10-26 11:58 嗨,Hima, 我检查只是为了确保,但选择的选项是基本求和,这是我准备我的数据包。我相当肯定,求和使用了两个补码,其中LSB首先被发送,MSB被发送到第二个。问题可能在我的LSB和MSB中,但我几乎可以肯定,发送的是正确的值。下面是VisualStudio中的第一个包以及错误包的构建,希望这能为问题提供更多的启发。 字节[]分组=新字节[7 ]; 包[ 0 ]=0x01;/ /开始 分组〔1〕=0x38;/ /命令码 分组〔2〕=0x00;/ /长度LSB 分组〔3〕=0x00;/ /长度MSB 分组〔4〕=0x0C;/ /校验和LSB 分组〔5〕=0x07;//校验和MSB 包[ 6 ]=0x17;/ /结束 响应包 1 8 0 0 0 247 255 23 -谢谢 亚当 以上来自于百度翻译 以下为原文 Hi Hima, I checked just to make sure but the option that is selected is the basic summation, which is what I prepared my packets for. I'm fairly certain that summation uses two's complement where the LSB is sent first and the MSB is sent second. The issue might be in my LSB and MSB but i'm almost certain that what is being sent are the correct values. Below is the construction of the first packet in Visual Studio along with the error packet, hope this sheds some more light on the issue. byte[] packet = new byte[7]; packet[0] = 0x01; // start packet[1] = 0x38; // command code packet[2] = 0x00; // Length LSB packet[3] = 0x00; // Length MSB packet[4] = 0x0C; // Checksum LSB packet[5] = 0x07; // Checksum MSB packet[6] = 0x17; // End Response packet 1 8 0 0 247 255 23 -Thanks Adam |
|
|
|
|
|
你好,
实际上,对于包计算的校验和是错误的,根据基本求和。校验和应该是C7 FF。 校验和=(0x01+(0xFFF-(0x01+0x38)))= FFC7 你能试试这个吗? 谢谢, 希马 以上来自于百度翻译 以下为原文 Hello , Actually the checksum calculated for the packet is wrong as per basic summation. The checksum should be c7 ff. Checksum = (0x01+(0xFFFF- (0x01+0x38)))= FF C7 can you try this? Thanks, Hima |
|
|
|
|
60user67 发表于 2018-10-26 12:20 嗨,Hima, 这是有效的!所以我以后不会有任何问题,我如何计算一个具有多个字节的包的校验和? -谢谢 亚当 以上来自于百度翻译 以下为原文 Hi Hima, This works! Just so I don't have any questions in the future, how would I calculate the checksum for a packet with multiple bytes? -Thanks Adam |
|
|
|
|
|
它应该类似于上面提到的方法。添加所有8个字节。从0xFFFF中减去并添加0x01。
谢谢, 希马 以上来自于百度翻译 以下为原文 It should be similar to the method mentioned above. Add all the 8 bytes. Subtract from 0xFFFF and add 0x01. Thanks, Hima |
|
|
|
|
只有小组成员才能发言,加入小组>>
786个成员聚集在这个小组
加入小组cyUSB3014一直显示2.1,不能到3.0情况,谁遇到过
7088 浏览 0 评论
2477 浏览 1 评论
2166 浏览 1 评论
4031 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
2074 浏览 6 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
7572浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
6120浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
742浏览 2评论
710浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
7965浏览 2评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-2 18:18 , Processed in 0.637684 second(s), Total 50, Slave 43 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
1695