警告[212] 增强型 16cxxx 设备应指定 __CONFIG 地址

Warning[212] Enhanced 16cxxx devices should specify __CONFIG address

使用 GPUTILS 为 Microchip PIC 编译汇编程序时,我收到以下警告:

Warning[212] Enhanced 16cxxx devices should specify __CONFIG address.

好像和配置字需要的地址有关,我这里(PIC16F1703)是8007h和8008h

我该如何解决这个警告?

注意:代码是为 PIC16F628A 完成的。

; Simple program to make a led (connected to RC3, pin 7)

        processor   16F1703
        radix       dec
        include     p16f1703.inc
        errorlevel  -302
        __config    _CP_OFF & _LVP_OFF & _BOREN_OFF & _MCLRE_ON & _PWRTE_ON & _WDTE_OFF

; constants
led     equ 3

; User ID Locations
;       org H'8000'
;       dw  H'0'
;       dw  H'1'
;       dw  H'2'
;       dw  H'3'

; EEPROM data
;       org H'2100'
;       de  "Led example"

; variables in ram
        org H'20'
i       res 1
j       res 1

; reset vector
        org H'00'
        goto    setup

; interrupt vector
        org H'04'


setup   clrf    PORTA
;       movlw   H'07'       ;Turn comparators off and enable
;       movwf   CMCON       ;pins for I/O functions
;       bsf STATUS, RP0
        movlw   B'00110111'
        movwf   TRISC
        movlw   B'00111111'
        movwf   TRISA
;       bcf STATUS, RP0

start   bcf PORTC, led
        call    delay
        bsf PORTC, led
        call    delay
        goto    start


delay   movlw   255
        movwf   j
        movwf   i
        decfsz  i, F
        goto    $-1
        decfsz  j, F
        goto    $-4
        return

        end

来自gputils帮助文件:

gplink requires a linker script. This script tells gplink what memory is available in the target processor. A set of Microchip generated scripts are installed with gputils. These scripts were intended as a starting point, but for many applications they will work as is. If the user does not specify a linker script, gplink will attempt to use the default script for the processor reported in the object file. The default location of the scripts is reported in the gplink help message

因此,在此文件中必须声明开始和结束配置地址,例如:

__CONFIG_START 0x8007
__CONFIG_END 0x800A

您也可以在程序开头声明地址!