Variables to Control Processor Selection

The MP_PROCESSOR_OPTION is the main variable that is used to control the processor name. Be aware that different compilers expect the name of the processor to be different. Some append "PIC", some use small “f”, etc. The Makefiles created by MPLAB® X IDE have the correct values. When you override these values by using MP_PROCESSOR_OPTION, you must ensure names are correct.

Note: Since MPLAB X IDE v2.00, the generated Makefiles for the most recent versions of the MPLAB XC C compilers, MPLAB C Compiler for PIC18 MCUs, and MPASM assembler, cannot be used with different processors by simply changing the value of MP_PROCESSOR_OPTION. This is only for the debug images. You can still produce different hex files for different device by changing the MP_PROCESSOR_OPTION value.

As of MPLAB X IDE v2.00, the debug image is produced by a link line which includes the list of memory regions allocated to the debugger. This list is device dependent. For example, here is the link line to create the debug image on an MPLAB XC16 project:

"/opt/microchip/xc16/v1.21/bin/xc16-gcc"   -o dist/default/debug/Explorer16dsPIC33F_1.X.debug.elf  build/default/debug/main.o      -mcpu=33FJ128GP710        -D__DEBUG -D__MPLAB_DEBUGGER_REAL_ICE=1  -omf=elf  -mreserve=data@0x800:0x81F -mreserve=data@0x820:0x821 -mreserve=data@0x822:0x823 -mreserve=data@0x824:0x825 -mreserve=data@0x826:0x84F   -Wl,,--defsym=__MPLAB_BUILD=1,--defsym=__MPLAB_DEBUG=1,--defsym=__DEBUG=1,--defsym=__MPLAB_DEBUGGER_REAL_ICE=1,,--script=p33FJ128GP710.gld,--check-sections,--data-init,--pack-data,--handles,--isr,--no-gc-sections,--fill-upper=0,--stackguard=16,--no-force-link,--smart-io,-Map="dist/default/debug/Explorer16dsPIC33F_1.X.debug.map"

The reserve areas (-mreserve above) may change from device to device. If you want to produce different debug images for different processors, it is preferable to change the processor in the IDE and use prjMakefilesRegenerator to recreate the Makefiles.

These are the versions that support the -mreserve keyword or that pass the list of debug regions by using other means. To generate a debug image with the correct debug ranges passed to the linker, you need to run prjMakefilesRegenerator. You cannot simply change MP_PROCESSOR_OPTION.

Toolchain First version supported.
All versions greater or equal to
this version issue -mreserve
XC8 1.00
XC16 1.21
XC32 1.30
MPASMX 5.54
C18 3.47
© 2018 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.