构建错误“make:*** [.build-impl]错误2”
我有一个简单的代码,用于我的MicroControllerSteacher要求的初始项目。
IM使用Mplab IDE V6.00,XC8编译器。
但是,当我尝试清洁并构建它时,会出现红色煤层代码(最后5行):
CLEAN SUCCESSFUL (total time5ms)
make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf
make[1]: Entering directory 'D:/luis/Documents/Curso/Micro/trab1_micro.X'
make -f nbproject/Makefile-default.mk dist/default/production/trab1_micro.X.production.hex
make[2]: Entering directory 'D:/luis/Documents/Curso/Micro/trab1_micro.X'
"C:\Program Files\Microchip\xc8\v2.36\bin\xc8-cc.exe" -c -mcpu=16F887 -mdfp="C:/Program Files/Microchip/MPLABX/v6.00/packs/Microchip/PIC16Fxxx_DFP/1.3.42/xc8" -fno-short-double -fno-short-float -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=-3 -Wa,-a -DXPRJ_default=default -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-osccal -mno-resetbits -mno-save-resetbits -mno-download -mno-stackcall -mdefault-config-bits -std=c99 -gdwarf-3 -mstack=compiled:auto:auto -o build/default/production/newAsmTemplate.o newAsmTemplate.asm
::: advisory: (2049) C99 compliant libraries are currently not available for baseline or mid-range devices, or for enhanced mid-range devices using a reentrant stack; using C90 libraries
newAsmTemplate.asm:34:25: warning: extra tokens at end of #include directive [-Wextra-tokens]
#include <p16f887.inc> ; processor specific variable definitions
^
//
newAsmTemplate.asm:34:11: fatal error: 'p16f887.inc' file not found
#include <p16f887.inc> ; processor specific variable definitions
^~~~~~~~~~~~~
1 warning and 1 error generated.
(908) exit status = 1
nbproject/Makefile-default.mk:113: recipe for target 'build/default/production/newAsmTemplate.o' failed
make[2]: Leaving directory 'D:/luis/Documents/Curso/Micro/trab1_micro.X'
nbproject/Makefile-default.mk:91: recipe for target '.build-conf' failed
make[1]: Leaving directory 'D:/luis/Documents/Curso/Micro/trab1_micro.X'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
make[2]: *** [build/default/production/newAsmTemplate.o] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 1s)
这是我为PIC项目制作的代码。
汇编代码在这里有帮助:
;**********************************************************************
; This file is a basic code template for assembly code generation *
; on the PIC16F887. This file contains the basic code *
; building blocks to build upon. *
; *
; Refer to the MPASM User's Guide for additional information on *
; features of the assembler (Document DS33014). *
; *
; Refer to the respective PIC data sheet for additional *
; information on the instruction set. *
; *
;**********************************************************************
; *
; Filename: pic.asm *
; Date: *
; File Version: *
; *
; Author: *
; Company: *
; *
; *
;**********************************************************************
; *
; Files Required: P16F887.INC *
; *
;**********************************************************************
; *
; Notes: *
; *
;**********************************************************************
list p=16f887 ; list directive to define processor
#include <p16f887.inc> ; processor specific variable definitions
; '__CONFIG' directive is used to embed configuration data within .asm file.
; The labels following the directive are located in the respective .inc file.
; See respective data sheet for additional information on configuration word.
__CONFIG _CONFIG1, _LVP_OFF & _FCMEN_ON & _IESO_OFF & _BOR_OFF & _CPD_OFF & _CP_OFF & _MCLRE_ON & _PWRTE_ON & _WDT_OFF & _INTRC_OSC_NOCLKOUT
__CONFIG _CONFIG2, _WRT_OFF & _BOR21V
;***** VARIABLE DEFINITIONS
DISPLAY_U EQU 0X7A
DISPLAY_D EQU 0X7B
VAR EQU 0x7C
w_temp EQU 0x7D ; variable used for context saving
status_temp EQU 0x7E ; variable used for context saving
pclath_temp EQU 0x7F ; variable used for context saving
;**********************************************************************
ORG 0x000 ; processor reset vector
nop
goto main ; go to beginning of program
ORG 0x004 ; interrupt vector location
movwf w_temp ; save off current W register contents
movf STATUS,w ; move status register into W register
movwf status_temp ; save off contents of STATUS register
movf PCLATH,w ; move pclath register into w register
movwf pclath_temp ; save off contents of PCLATH register
; isr code can go here or be located as a call subroutine elsewhere
btfss PIR1, ADIF
goto AD_INT_FIM
bcf PIR1, ADIF
rrf ADRESH, F
bcf ADRESH, 1; 7
movf ADRESH, W
call TABELA
movwf VAR
sublw b'00100101' ;25 em bcd, respetivo aos 2.5V
btfss STATUS, Z ;flag z, testar se ativou
goto AD_INT_FIM
movlw b'00111001' ;39 em bcd, respetivo aos nossos números de alunos
movwf VAR
AD_INT_FIM
btfss INTCON, INTF
goto FIM_INT
bcf INTCON, INTF
bsf ADCON0, GO
FIM_INT
movf pclath_temp,w ; retrieve copy of PCLATH register
movwf PCLATH ; restore pre-isr PCLATH register contents
movf status_temp,w ; retrieve copy of STATUS register
movwf STATUS ; restore pre-isr STATUS register contents
swapf w_temp,f
swapf w_temp,w ; restore pre-isr W register contents
retfie ; return from interrupt
main
bsf STATUS,RP1
bsf STATUS,RP0
bsf ANSEL, ANS0
bcf ANSELH, ANS12
bcf STATUS,RP1
bsf STATUS,RP0
clrf TRISC
bsf PIE1, ADIE
bcf STATUS, RP0
movlw b'00000001'
movwf ADCON0
bcf PIR1, ADIF
bsf INTCON, INTE
bcf INTCON, INTF
bsf INTCON, PEIE
bsf INTCON, GIE
clrf VAR
loop
; VAR = U U U U D D D D
;PORTC = 1 0 X X D D D D
movf VAR, W
movwf DISPLAY_D
bsf DISPLAY_D, 1; 7
bcf DISPLAY_D, 0; 6
movf DISPLAY_D, W
movwf PORTC
;PORTC = 0 1 X X U U U U
movf VAR, W
movwf DISPLAY_U
swapf DISPLAY_U, F
bcf DISPLAY_U, 1; 7
bsf DISPLAY_U, 0; 6
movf DISPLAY_U, W
movwf PORTC
GOTO loop
; remaining code goes here
TABELA
addwf PCL,f
RETLW 0x0
RETLW 0x0
RETLW 0x1
RETLW 0x1
RETLW 0x2
RETLW 0x2
RETLW 0x2
RETLW 0x3
RETLW 0x3
RETLW 0x4
RETLW 0x4
RETLW 0x4
RETLW 0x5
RETLW 0x5
RETLW 0x5
RETLW 0x6
RETLW 0x6
RETLW 0x7
RETLW 0x7
RETLW 0x7
RETLW 0x8
RETLW 0x8
RETLW 0x9
RETLW 0x9
RETLW 0x9
RETLW 0x10
RETLW 0x10
RETLW 0x11
RETLW 0x11
RETLW 0x11
RETLW 0x12
RETLW 0x12
RETLW 0x13
RETLW 0x13
RETLW 0x13
RETLW 0x14
RETLW 0x14
RETLW 0x14
RETLW 0x15
RETLW 0x15
RETLW 0x16
RETLW 0x16
RETLW 0x16
RETLW 0x17
RETLW 0x17
RETLW 0x18
RETLW 0x18
RETLW 0x18
RETLW 0x19
RETLW 0x19
RETLW 0x20
RETLW 0x20
RETLW 0x20
RETLW 0x21
RETLW 0x21
RETLW 0x21
RETLW 0x22
RETLW 0x22
RETLW 0x23
RETLW 0x23
RETLW 0x23
RETLW 0x24
RETLW 0x24
RETLW 0x25
RETLW 0x25
RETLW 0x25
RETLW 0x26
RETLW 0x26
RETLW 0x27
RETLW 0x27
RETLW 0x27
RETLW 0x28
RETLW 0x28
RETLW 0x29
RETLW 0x29
RETLW 0x29
RETLW 0x30
RETLW 0x30
RETLW 0x30
RETLW 0x31
RETLW 0x31
RETLW 0x32
RETLW 0x32
RETLW 0x32
RETLW 0x33
RETLW 0x33
RETLW 0x34
RETLW 0x34
RETLW 0x34
RETLW 0x35
RETLW 0x35
RETLW 0x36
RETLW 0x36
RETLW 0x36
RETLW 0x37
RETLW 0x37
RETLW 0x38
RETLW 0x38
RETLW 0x38
RETLW 0x39
RETLW 0x39
RETLW 0x39
RETLW 0x40
RETLW 0x40
RETLW 0x41
RETLW 0x41
RETLW 0x41
RETLW 0x42
RETLW 0x42
RETLW 0x43
RETLW 0x43
RETLW 0x43
RETLW 0x44
RETLW 0x44
RETLW 0x45
RETLW 0x45
RETLW 0x45
RETLW 0x46
RETLW 0x46
RETLW 0x46
RETLW 0x47
RETLW 0x47
RETLW 0x48
RETLW 0x48
RETLW 0x48
RETLW 0x49
RETLW 0x49
RETLW 0x50
; example of preloading EEPROM locations
ORG 0x2100
DE 5, 4, 3, 2, 1
END ; directive 'end of program'
I have this simple code for an initial project that my microcontrollersteacher asked.
Im using MPLAB IDE V6.00, the xc8 compiler.
But when i try to clean and build it this error in red collor code appears (the last 5 lines):
CLEAN SUCCESSFUL (total time5ms)
make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf
make[1]: Entering directory 'D:/luis/Documents/Curso/Micro/trab1_micro.X'
make -f nbproject/Makefile-default.mk dist/default/production/trab1_micro.X.production.hex
make[2]: Entering directory 'D:/luis/Documents/Curso/Micro/trab1_micro.X'
"C:\Program Files\Microchip\xc8\v2.36\bin\xc8-cc.exe" -c -mcpu=16F887 -mdfp="C:/Program Files/Microchip/MPLABX/v6.00/packs/Microchip/PIC16Fxxx_DFP/1.3.42/xc8" -fno-short-double -fno-short-float -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=-3 -Wa,-a -DXPRJ_default=default -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-osccal -mno-resetbits -mno-save-resetbits -mno-download -mno-stackcall -mdefault-config-bits -std=c99 -gdwarf-3 -mstack=compiled:auto:auto -o build/default/production/newAsmTemplate.o newAsmTemplate.asm
::: advisory: (2049) C99 compliant libraries are currently not available for baseline or mid-range devices, or for enhanced mid-range devices using a reentrant stack; using C90 libraries
newAsmTemplate.asm:34:25: warning: extra tokens at end of #include directive [-Wextra-tokens]
#include <p16f887.inc> ; processor specific variable definitions
^
//
newAsmTemplate.asm:34:11: fatal error: 'p16f887.inc' file not found
#include <p16f887.inc> ; processor specific variable definitions
^~~~~~~~~~~~~
1 warning and 1 error generated.
(908) exit status = 1
nbproject/Makefile-default.mk:113: recipe for target 'build/default/production/newAsmTemplate.o' failed
make[2]: Leaving directory 'D:/luis/Documents/Curso/Micro/trab1_micro.X'
nbproject/Makefile-default.mk:91: recipe for target '.build-conf' failed
make[1]: Leaving directory 'D:/luis/Documents/Curso/Micro/trab1_micro.X'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
make[2]: *** [build/default/production/newAsmTemplate.o] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 1s)
Here is code i made for the pic project.
The assembly code is here in case it helps:
;**********************************************************************
; This file is a basic code template for assembly code generation *
; on the PIC16F887. This file contains the basic code *
; building blocks to build upon. *
; *
; Refer to the MPASM User's Guide for additional information on *
; features of the assembler (Document DS33014). *
; *
; Refer to the respective PIC data sheet for additional *
; information on the instruction set. *
; *
;**********************************************************************
; *
; Filename: pic.asm *
; Date: *
; File Version: *
; *
; Author: *
; Company: *
; *
; *
;**********************************************************************
; *
; Files Required: P16F887.INC *
; *
;**********************************************************************
; *
; Notes: *
; *
;**********************************************************************
list p=16f887 ; list directive to define processor
#include <p16f887.inc> ; processor specific variable definitions
; '__CONFIG' directive is used to embed configuration data within .asm file.
; The labels following the directive are located in the respective .inc file.
; See respective data sheet for additional information on configuration word.
__CONFIG _CONFIG1, _LVP_OFF & _FCMEN_ON & _IESO_OFF & _BOR_OFF & _CPD_OFF & _CP_OFF & _MCLRE_ON & _PWRTE_ON & _WDT_OFF & _INTRC_OSC_NOCLKOUT
__CONFIG _CONFIG2, _WRT_OFF & _BOR21V
;***** VARIABLE DEFINITIONS
DISPLAY_U EQU 0X7A
DISPLAY_D EQU 0X7B
VAR EQU 0x7C
w_temp EQU 0x7D ; variable used for context saving
status_temp EQU 0x7E ; variable used for context saving
pclath_temp EQU 0x7F ; variable used for context saving
;**********************************************************************
ORG 0x000 ; processor reset vector
nop
goto main ; go to beginning of program
ORG 0x004 ; interrupt vector location
movwf w_temp ; save off current W register contents
movf STATUS,w ; move status register into W register
movwf status_temp ; save off contents of STATUS register
movf PCLATH,w ; move pclath register into w register
movwf pclath_temp ; save off contents of PCLATH register
; isr code can go here or be located as a call subroutine elsewhere
btfss PIR1, ADIF
goto AD_INT_FIM
bcf PIR1, ADIF
rrf ADRESH, F
bcf ADRESH, 1; 7
movf ADRESH, W
call TABELA
movwf VAR
sublw b'00100101' ;25 em bcd, respetivo aos 2.5V
btfss STATUS, Z ;flag z, testar se ativou
goto AD_INT_FIM
movlw b'00111001' ;39 em bcd, respetivo aos nossos números de alunos
movwf VAR
AD_INT_FIM
btfss INTCON, INTF
goto FIM_INT
bcf INTCON, INTF
bsf ADCON0, GO
FIM_INT
movf pclath_temp,w ; retrieve copy of PCLATH register
movwf PCLATH ; restore pre-isr PCLATH register contents
movf status_temp,w ; retrieve copy of STATUS register
movwf STATUS ; restore pre-isr STATUS register contents
swapf w_temp,f
swapf w_temp,w ; restore pre-isr W register contents
retfie ; return from interrupt
main
bsf STATUS,RP1
bsf STATUS,RP0
bsf ANSEL, ANS0
bcf ANSELH, ANS12
bcf STATUS,RP1
bsf STATUS,RP0
clrf TRISC
bsf PIE1, ADIE
bcf STATUS, RP0
movlw b'00000001'
movwf ADCON0
bcf PIR1, ADIF
bsf INTCON, INTE
bcf INTCON, INTF
bsf INTCON, PEIE
bsf INTCON, GIE
clrf VAR
loop
; VAR = U U U U D D D D
;PORTC = 1 0 X X D D D D
movf VAR, W
movwf DISPLAY_D
bsf DISPLAY_D, 1; 7
bcf DISPLAY_D, 0; 6
movf DISPLAY_D, W
movwf PORTC
;PORTC = 0 1 X X U U U U
movf VAR, W
movwf DISPLAY_U
swapf DISPLAY_U, F
bcf DISPLAY_U, 1; 7
bsf DISPLAY_U, 0; 6
movf DISPLAY_U, W
movwf PORTC
GOTO loop
; remaining code goes here
TABELA
addwf PCL,f
RETLW 0x0
RETLW 0x0
RETLW 0x1
RETLW 0x1
RETLW 0x2
RETLW 0x2
RETLW 0x2
RETLW 0x3
RETLW 0x3
RETLW 0x4
RETLW 0x4
RETLW 0x4
RETLW 0x5
RETLW 0x5
RETLW 0x5
RETLW 0x6
RETLW 0x6
RETLW 0x7
RETLW 0x7
RETLW 0x7
RETLW 0x8
RETLW 0x8
RETLW 0x9
RETLW 0x9
RETLW 0x9
RETLW 0x10
RETLW 0x10
RETLW 0x11
RETLW 0x11
RETLW 0x11
RETLW 0x12
RETLW 0x12
RETLW 0x13
RETLW 0x13
RETLW 0x13
RETLW 0x14
RETLW 0x14
RETLW 0x14
RETLW 0x15
RETLW 0x15
RETLW 0x16
RETLW 0x16
RETLW 0x16
RETLW 0x17
RETLW 0x17
RETLW 0x18
RETLW 0x18
RETLW 0x18
RETLW 0x19
RETLW 0x19
RETLW 0x20
RETLW 0x20
RETLW 0x20
RETLW 0x21
RETLW 0x21
RETLW 0x21
RETLW 0x22
RETLW 0x22
RETLW 0x23
RETLW 0x23
RETLW 0x23
RETLW 0x24
RETLW 0x24
RETLW 0x25
RETLW 0x25
RETLW 0x25
RETLW 0x26
RETLW 0x26
RETLW 0x27
RETLW 0x27
RETLW 0x27
RETLW 0x28
RETLW 0x28
RETLW 0x29
RETLW 0x29
RETLW 0x29
RETLW 0x30
RETLW 0x30
RETLW 0x30
RETLW 0x31
RETLW 0x31
RETLW 0x32
RETLW 0x32
RETLW 0x32
RETLW 0x33
RETLW 0x33
RETLW 0x34
RETLW 0x34
RETLW 0x34
RETLW 0x35
RETLW 0x35
RETLW 0x36
RETLW 0x36
RETLW 0x36
RETLW 0x37
RETLW 0x37
RETLW 0x38
RETLW 0x38
RETLW 0x38
RETLW 0x39
RETLW 0x39
RETLW 0x39
RETLW 0x40
RETLW 0x40
RETLW 0x41
RETLW 0x41
RETLW 0x41
RETLW 0x42
RETLW 0x42
RETLW 0x43
RETLW 0x43
RETLW 0x43
RETLW 0x44
RETLW 0x44
RETLW 0x45
RETLW 0x45
RETLW 0x45
RETLW 0x46
RETLW 0x46
RETLW 0x46
RETLW 0x47
RETLW 0x47
RETLW 0x48
RETLW 0x48
RETLW 0x48
RETLW 0x49
RETLW 0x49
RETLW 0x50
; example of preloading EEPROM locations
ORG 0x2100
DE 5, 4, 3, 2, 1
END ; directive 'end of program'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Microchip 汇编器对文件扩展名可能非常挑剔。使用大写“S”而不是“.asm”引起的问题最少。
这是使用 pic-as 汇编器移植来构建的代码:
The Microchip assembler can be very picky about the file name extension. Using a capital 'S' rather than '.asm' causes the least problems.
This is your code ported to build using the pic-as assembler: