完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我正在使用XC8 1.45与MPLABX 4.05进行一个简单的项目,并遇到了问题。我的项目的目标是18F27 K40,但由于它们还没有到达,我想我将开始使用工作车间中找到的18F2680或18F2550中的一个进行调试。当目标是18F27 K40时,XC8编译并链接精细,但是当选择了较旧的设备时,出现以下错误。ED工作通过XC8编译器版本,代码编译为1.32但不迟。我还发现MPLABX 4.05不允许我更改在18F2680或18F2550上的配置4L中的NDebug配置位。在配置位编辑器中,它没有出现在同一配置字节中的其他位。附上项目文件范例。
以上来自于百度翻译 以下为原文 I'm working on a simple project using XC8 1.45 with MPLABX 4.05 and have hit a problem. My project targets an 18F27K40 but as they have not arrived yet I thought I'd start debugging using one of the 18F2680 or 18F2550 I found in the workshop. XC8 compiles and links fine when the target is the 18f27K40 but fails with the following error when either of the older devices is selected. make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf make[1]: Entering directory 'D:/Son.Im/son.im-quotem' make -f nbproject/Makefile-default.mk dist/default/production/son.im-quotem.production.hex make[2]: Entering directory 'D:/Son.Im/son.im-quotem' "C:Program Files (x86)Microchipxc8v1.45binxc8.exe" --chip=18F2680 -G -mdist/default/production/son.im-quotem.production.map --double=24 --float=24 --emi=wordwrite --opt=+asm,+asmfile,-speed,+space,-debug,-local --addrqual=ignore --mode=free -P -N255 --warn=-3 --asmlist -DXPRJ_default=default --summary=default,-psect,-class,+mem,-hex,-file --output=default,-inhx032 --runtime=default,+clear,+init,-keep,-no_startup,-download,+config,+clib,-plib --output=-mcof,+elf:multilocs --stack=compiled:auto:auto:auto "--errformat=%f:%l: error: (%n) %s" "--warnformat=%f:%l: warning: (%n) %s" "--msgformat=%f:%l: advisory: (%n) %s" --memorysummary dist/default/production/memoryfile.xml -odist/default/production/son.im-quotem.production.elf build/default/production/firmware.p1 Microchip MPLAB XC8 C Compiler (Free Mode) V1.45 Build date: Nov 15 2017 Part Support Version: 1.45 (B) Copyright (C) 2017 Microchip Technology Inc. License type: Node Configuration:: advisory: (1233) Employing 18F2680 errata work-arounds: :: advisory: (1234) * Corrupted fast interrupt shadow registers :: warning: (1273) Omniscient Code Generation not available in Free mode Non line specific message:: error: (1437) CMF error: no psect defined for the line (908) exit status = 1 nbproject/Makefile-default.mk:131: recipe for target 'dist/default/production/son.im-quotem.production.hex' failed make[2]: Leaving directory 'D:/Son.Im/son.im-quotem' nbproject/Makefile-default.mk:90: recipe for target '.build-conf' failed make[1]: Leaving directory 'D:/Son.Im/son.im-quotem' nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed make[2]: *** [dist/default/production/son.im-quotem.production.hex] Error 1I tried working backwards through XC8 compiler versions and the code compiles with 1.32 but not later. I've also found the MPLABX 4.05 does not allow me to change the NDEBUG configuration bit in CONFIG4L on the 18F2680 or 18F2550. It does not appear in the configuration bit editor with other bits in the same configuration byte. Is there a workaround for these? Example project files attached. Attachment(s) example.zip (28.68 KB) - downloaded 41 times |
|
相关推荐
4个回答
|
|
你必须仔细看看代码。有了那些FrSHuffiNER ASM语句,在那些FrSuthBuier-宏中,很容易忽略“简单”的东西。特别是,看看那些失败的CPU不同的部分。在26K80和2550的传输位278, 279, 280行中缺少了什么?也许这能让你开始调试。底线:为什么编译器不能提供更好的诊断?对嵌入式ASM()语句来说,对编译器和C程序员来说都是一个挑战。
以上来自于百度翻译 以下为原文 You have to look, really look, at the code. With all of those furshlugginer asm statements inside those furshlugginer macros it's easy to overlook "simple" stuff. In particular, look at the parts that are different for the CPUs that fail. What's missing in your lines 278, 279, 280 of TRANSMIT_BIT for '26K80 and '2550? asm ("nop"); asm ("nop"); asm ("bcf LATB,0"); Maybe this can get you to the point of starting debugging. Bottom line: Why can't the compiler give better diagnostics? Well, it's always a challenge (to the compiler as well as to C programmers who would like to help) with embedded asm() statements. Regards, Dave |
|
|
|
因为您不应该更改该位,IDE在调试/运行中这样做。
以上来自于百度翻译 以下为原文 Because YOU are not supposed to change that bit, the IDE does that for a DEBUG build/RUN. |
|
|
|
这个错误通常是当代码(通常是手写汇编)不在一个区段(PSCT)中时产生的。您在所指示的行上缺少一个反斜杠,导致剩下的代码被解释为实际代码,而不是宏定义。
以上来自于百度翻译 以下为原文 This error is usually produced when there is code (which will typically be hand-written assembly) that is not inside a section (psect). You are missing a backslash on the indicated line, resulting in the remaining code being interpreted as actual code, not a macro definition. #if defined (__18F2680__) || defined (__18F2550__) #define TRANSMIT_BIT(reg,bit) asm ("bsf LATB,0"); asm ("nop"); asm ("nop"); asm ("btfss " reg "," #bit); asm ("bcf LATB,0"); asm ("nop"); asm ("nop"); asm ("nop"); <------- oops! asm ("bcf LATB,0"); asm ("nop"); asm ("nop"); asm ("nop"); asm ("nop"); #endif Jeff. |
|
|
|
|
|
|
|
只有小组成员才能发言,加入小组>>
5178 浏览 9 评论
2003 浏览 8 评论
1931 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3177 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2228 浏览 5 评论
738浏览 1评论
622浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
509浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
636浏览 0评论
533浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-27 08:54 , Processed in 1.239729 second(s), Total 52, Slave 46 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号