完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
使用MPLAB X 4.20 ANS XC16 1.34,所有SAMPLTF都运行良好。现在我更新到MPLAB X 5时,SaMPTF将在一% 01D被调用时添加0x00。对于:SaMPTF(和TMP-Buff[0),rPo: %01DR,ID);我得到:TMP-Buff[0 ] CHAR 0x9D6R;0xD TMP-Buff[1 ] CHAR 0x9D7'B';0x42 TMP-Buff[2 ] char 0x9D8。D9't';0x74tMP-Buff[[ 4 ] char 0x9Da't';0x74tMPiBuff[5 ] char 0x9dB′′;0x6c tMP-Buff[6 ] char 0x9dc'e′;0x65 tMP-Buff[7 ] char 0x9dD′:;0x3a tMP-Buff[8 ] char 0x9d'';0x20tMP-Buff[9 ] char 0x9df null;0x0& lt;l--------…“O”;0x6f TMP-Buff[3 ] CHAR 0x9TMP-Buff[10 ] char 0x9e0r;0xd,对于所有具有任何%转换的SaveTf都发生这种情况。
以上来自于百度翻译 以下为原文 Using MPLAB X 4.20 ans XC16 1.34 all sprintf were working fine. Now that I updated to MPLAB X 5.00 the sprintf will add a 0x00 when a %01d is called for. For: sprintf(&tmp_buff[0],"rBottle: %01dr",id); I get: tmp_buff[0] char 0x9D6 r; 0xd tmp_buff[1] char 0x9D7 'B'; 0x42 tmp_buff[2] char 0x9D8 'o'; 0x6f tmp_buff[3] char 0x9D9 't'; 0x74 tmp_buff[4] char 0x9DA 't'; 0x74 tmp_buff[5] char 0x9DB 'l'; 0x6c tmp_buff[6] char 0x9DC 'e'; 0x65 tmp_buff[7] char 0x9DD ':'; 0x3a tmp_buff[8] char 0x9DE ' '; 0x20 tmp_buff[9] char 0x9DF NUL; 0x0 |
|
相关推荐
5个回答
|
|
MPLAB(IDE)不太可能改变C编译器的行为。
以上来自于百度翻译 以下为原文 it's unlikely that MPLAB (IDE) changed the behaviour for C compiler... |
|
|
|
我被挤得像墙一样大。但是当我回顾这些事件的时候,它是唯一改变的东西。1。处理XC16 1.35在Mac上安装的问题,它原来是和OS 2。在Microchip调试期间,我注意到MPLAB X 5,所以我尝试了它。3。因为它指示项目将是变化的,不兼容MPLAB X 4,所以我更新了2台PC到MPLAB X5.00。然后在项目中的一台PC上做了一些工作,并注意到SCANF停止工作,所以我替换了它。6。直到后来我才意识到我的喷水也不起作用。7。调试了这些调用,发现只要SpETTF看到一%个东西,它就会在字符串中插入0x00,然后停止。8。相同的编译器XC16 1.34一直在工作。我认为链接器调用中有一些事情正在做,但是我不确定什么。它必须与链接器有关。我也注意到,我几乎在任何时候编程时都已经断开和重新连接皮卡3。来自IDE的LLED。我必须开始检查DOC,看看是怎么回事。我已经打开了一个案例,并将尝试一个测试用例,看看它是否被限制在一个转换的项目中。
以上来自于百度翻译 以下为原文 I was supersized as wall. But when I go over the events its the only thing that has changed. 1. Working on issues with XC16 1.35 installing on Mac which turned out to be and OS. 2. During the debug with Microchip I notice MPLAB X 5.00 so I tried it. 3. Because it indicated the projects would be change and not compatible with MPLAB X 4 I update 2 PC to MPLAB x 5.00. 4. Then did some work on one of the PC on the project and notice that sscanf stopped working so I replaced it. 6. Did not realize until latter that my sprintf was also not work. 7. Debugged the calls and found that as soon as sprintf sees a %anything it would put a 0x00 in the string and stop. 8. Same compiler XC16 1.34 which had been working all along. I think there is something in the linker call that is doing this but I am not sure what. It must have something to do with the linker..... I also notice that I have disconnect and reconnect the PICKIT 3 almost ever time I program a part when called from the IDE. I will have to start going through the doc as see what is up. I have opened a case on this and will try a test case to see if it is limited to a converted project. |
|
|
|
在更多的调查中,我现在看到它会工作一些时间。我有一个循环,它会阻塞块,而且每次循环都不会以同样的方式进行。所以SpaTeF断断续续地发生了一些事情。你如何调试它。
以上来自于百度翻译 以下为原文 In more investigation I am now seeing that it will work some times. I have a loop that dumps blocks and it will not do it the same way though the loop each time. So something is happening where the sprintf is failing intermittently. How do you debug that. |
|
|
|
你可以发布有问题的最小剥离代码样本,这样其他人可以看看。
以上来自于百度翻译 以下为原文 You could post the smallest stripped down code sample that has the problem so others might have a look. |
|
|
|
这里有一些输出和代码来查看问题,为什么它会在1位而不是其他地方工作。我也得到了片状的结果:标签UID:0Bug:00数据:[ 0000 ]…UID应该是8个字节的HexBug:00个数据:[]防止丢失的HEX数据库锁:00个数据:[O] OX 6缺失的HEX数据库锁:00个数据:(0000)…块:00个数据:[ 0000 ]…块:00个数据:[ 0000 ]…块:00个数据:[ 0000 ]…块:00个数据:[ 0000 ]…块:00个数据:[ 0000 ]…块:00个数据:[ 0000 ]…块:0个数据:[ 0000 ]…块:0个数据:[] 7013缺失的十六进制数据锁:0数据:(000)9…丢失十六进制数据锁:0数据:[ 0000 ]…块:0个数据:[A]A225丢失的十六进制数据锁:0个数据:[ 00 ] 8A。丢失十六进制数据锁:0数据:[ 0000 ]…块:0个数据:(0)…K丢失的HEX数据库锁:0数据:[ 0 ] x。丢失十六进制数据代码以生成块行:(ii=0;ii工作组;Bask.CNT;I+++){SAMTIFF(&;TMPI- Buff[0),“块:%03D”,II);WrimeBufff(&;TMPI Buff[0)];//UARTHEXESTCSTROM(“块”);//UARTURL PATBULTENG(UI8BlcNoNKONS);//输出块号SAMPLTF(&TMP-Buff[0),]数据:[(])WrimeBufff(&;TMP-Buff[0 ]);(i=0;i & lt;4;i++){SAMTIFF(&;TMP-Buff[0),“%02x”,WorkStay.DATA(II]);/ /不每次都工作。;TMP-Buff[0 ]);//UARTUR-PUTHEQUEL(G/PUI8TrFuff[UI8LoopCal]);和/或发送数据从标签到主机} SaveTFF(和;TMPI Buff[0 ],] ];Wrad EngfBuff[&TMP-Buff[0 ] ];(i=0;i<4;i++){if(WorkStale.DATA [I] & gt;=’)){UART1x写(WorkLeal.DATA [II]);} {UA)写入器(和放大器)RT1X写('.');};UART1X写('r');uART1x写('n);};
以上来自于百度翻译 以下为原文 Here is some output and code to see the issues. Why would it work in 1 place and not others. I also get flaky results: TAG UID: 0Block: 00 Data: [0000] .... UID should be 8 bytes of hex Block: 00 Data: [] Anti Missing Hex data Block: 00 Data: [] ox 6 Missing Hex data Block: 00 Data: [0000] .... Block: 00 Data: [0000] .... Block: 00 Data: [0000] .... Block: 00 Data: [0000] .... Block: 00 Data: [0000] .... Block: 00 Data: [0000] .... Block: 00 Data: [0000] .... Block: 0 Data: [0000] .... Block: 0 Data: [] 7013 Missing Hex data Block: 0 Data: [000] 9... Missing Hex data Block: 0 Data: [0000] .... Block: 0 Data: [] A225 Missing Hex data Block: 0 Data: [00] 8A.. Missing Hex data Block: 0 Data: [0000] .... Block: 0 Data: [0] ..k Missing Hex data Block: 0 Data: [0] x. . Missing Hex data Code to generate the Block Line: for (ii= 0; ii < work_area.block_cnt; ii++){ sprintf(&tmp_buff[0],"Block: %03d",ii); write_buff(&tmp_buff[0]); //UART_sendCString("Block "); //UART_putByte(ui8BlockNumber); // Output block number sprintf(&tmp_buff[0]," Data: ["); write_buff(&tmp_buff[0]); for (i = 0; i < 4; i++) { sprintf(&tmp_buff[0],"%02x",work_area.data[ii]); // does not work every time.... write_buff(&tmp_buff[0]); //UART_putByte(g_pui8TrfBuffer[ui8LoopCount]); // Send out data read from tag to host } sprintf(&tmp_buff[0],"] "); write_buff(&tmp_buff[0]); for (i = 0; i < 4; i++) { if(work_area.data[ii] >= ' '){ UART1_Write(work_area.data[ii]); } else { UART1_Write('.'); } }; UART1_Write('r'); UART1_Write('n'); }; |
|
|
|
只有小组成员才能发言,加入小组>>
5207 浏览 9 评论
2017 浏览 8 评论
1943 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3188 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2244 浏览 5 评论
758浏览 1评论
644浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
560浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
657浏览 0评论
556浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-8 11:18 , Processed in 1.066061 second(s), Total 56, Slave 49 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号