• AVR Freaks

LockedLegacy mode ( XINST = OFF ) won't be applied by XC8

Author
lcn
Junior Member
  • Total Posts : 111
  • Reward points : 0
  • Joined: 2012/02/05 06:28:55
  • Location: 0
  • Status: offline
2013/08/20 08:40:42 (permalink)
0

Legacy mode ( XINST = OFF ) won't be applied by XC8

Hello
 
I'm facing a compilation issue with XC8 v1.30 and PIC 18F2620
 
At the end of compilation process i get the following error, although i've set configuration bit XINST = OFF
The program file could not be loaded: com.microchip.mplab.mdbcore.loader.LoadException: The Extended CPU Mode configuration bit is enabled, but the program was not built using extended CPU instructions.
 
This is my bit configuration :
#pragma config OSC=INTIO67,FCMEN=OFF, IESO=OFF    // Use internal oscillator @ 8Mhz ( no crystal on the board, RA6 & RA7 are I/O )
#pragma config PWRT=ON, BOREN=OFF, BORV=3
#pragma config WDT=OFF, WDTPS=1
#pragma config CCP2MX=PORTBE, PBADEN=OFF, LPT1OSC=OFF, MCLRE=ON
#pragma config DEBUG=OFF, STVREN=ON, XINST=OFF, LVP=OFF
#pragma config CP0=OFF, CP1=OFF, CP2=OFF, CP3=OFF
#pragma config CPB=OFF, CPD=OFF
#pragma config WRT0=OFF, WRT1=OFF, WRT2=OFF, WRT3=OFF
#pragma config WRTC=OFF, WRTB=OFF, WRTD=OFF
#pragma config EBTR0=OFF, EBTR1=OFF, EBTR2=OFF, EBTR3=OFF
#pragma config EBTRB=OFF

 
I've tried to reset the "XC Linker" setting, but still no chance.
The option : "Program the device with default config word" is selected.
 
Many thanks for your help,
#1

8 Replies Related Threads

    kevcon
    Super Member
    • Total Posts : 568
    • Reward points : 0
    • Joined: 2011/09/16 07:34:49
    • Location: 0
    • Status: offline
    Re:Legacy mode ( XINST = OFF ) won't be applied by XC8 2013/08/20 09:01:08 (permalink)
    0
    Are you using MPLAB 8 or MPLAB X?
    #2
    lcn
    Junior Member
    • Total Posts : 111
    • Reward points : 0
    • Joined: 2012/02/05 06:28:55
    • Location: 0
    • Status: offline
    Re:Legacy mode ( XINST = OFF ) won't be applied by XC8 2013/08/20 09:21:34 (permalink)
    0
    I use MPLAB X
     
    I just found the conflict comes from 2 defines i've set :
     
     

    #define ON 1
    #define OFF 0

     
    if i set the following instead, compilation goes through

    #define On  1
    #define Off 0

     
     
     
     
    #3
    1and0
    Access is Denied
    • Total Posts : 12269
    • Reward points : 0
    • Joined: 2007/05/06 12:03:20
    • Location: Harry's Gray Matter
    • Status: offline
    Re:Legacy mode ( XINST = OFF ) won't be applied by XC8 2013/08/20 09:25:49 (permalink)
    +1 (1)
    ... and "ON" does not necessary mean the config bit is a '1', and the same goes for "OFF".
     
    #4
    lcn
    Junior Member
    • Total Posts : 111
    • Reward points : 0
    • Joined: 2012/02/05 06:28:55
    • Location: 0
    • Status: offline
    Re:Legacy mode ( XINST = OFF ) won't be applied by XC8 2013/08/20 09:30:50 (permalink)
    0
    I think issue here is syntax.
     
    It looks that "ON" and "OFF" words written in uppercase are reserved and can't be defined or used for other purposes.
    #5
    1and0
    Access is Denied
    • Total Posts : 12269
    • Reward points : 0
    • Joined: 2007/05/06 12:03:20
    • Location: Harry's Gray Matter
    • Status: offline
    Re:Legacy mode ( XINST = OFF ) won't be applied by XC8 2013/08/20 09:38:13 (permalink)
    +1 (1)
    lcn
    It looks that "ON" and "OFF" words written in uppercase are reserved and can't be defined or used for other purposes.
    Correct.  C is case-sensitive.
     
    #6
    Ian.M
    Super Member
    • Total Posts : 13274
    • Reward points : 0
    • Joined: 2009/07/23 07:02:40
    • Location: UK
    • Status: offline
    Re:Legacy mode ( XINST = OFF ) won't be applied by XC8 2013/08/20 14:01:27 (permalink)
    +1 (1)
    This issue has been around for a while: http://www.microchip.com/forums/fb.ashx?m=676260
    Redefining ON and OFF before the #pragma config is a *BAD* idea, but there are work-arounds. wink
    #7
    mad_c
    Super Member
    • Total Posts : 1295
    • Reward points : 0
    • Joined: 2010/12/12 17:48:27
    • Location: Brisbane, Australia
    • Status: offline
    Re:Legacy mode ( XINST = OFF ) won't be applied by XC8 2013/08/20 14:44:50 (permalink)
    +2 (2)
    Ian.M
    This issue has been around for a while: http://www.microchip.com/forums/fb.ashx?m=676260

     
    Indeed it has, and as a result, we changed the way the preprocessing works and there was even text added to the user's guide:
     
    The setting-value pairs can also be quoted to ensure that the preprocessor does not perform substitution of these tokens, for example:
    #pragma config "BOREN=OFF" 
    Without the quotes and with the preprocessor macro OFF defined, for example, substitution within the pragma would take place. You should never assume that the OFF and ON tokens used in configuration macros equate to 0 and 1, respectively, as that is often not the case.
     


    Jeff
    #8
    DarioG
    Allmächtig.
    • Total Posts : 54081
    • Reward points : 0
    • Joined: 2006/02/25 08:58:22
    • Location: Oesterreich
    • Status: offline
    Re:Legacy mode ( XINST = OFF ) won't be applied by XC8 2013/08/20 15:02:11 (permalink)
    0
    good Smile thx

    GENOVA :D :D ! GODO
    #9
    Jump to:
    © 2021 APG vNext Commercial Version 4.5