Ending an MPLAB® X IDE Debug Session and Generating a Production-Ready HEX File

Last modified by Microchip on 2023/11/10 12:00

In order to run an application on a device in Stand-Alone mode, you must generate a production version of the HEX file.

When debugging an application, MPLAB® X Integrated Development Environment (IDE) creates and programs a debug version of the HEX file into the device. The debug HEX file contains configuration bit settings that activate special debug circuitry on the device, and in some cases add code to the application. Debug versions of the application are inappropriate for Production mode as they will not operate without an attached programmer/debugger. 

In order to generate a production HEX file, you must first end the debug session by selecting Finish Debug Session from the toolbar.

Ending a Debug Session

Finished Debugger Session button

Production Build Buttons

The production HEX file is placed within the dist subdirectory of the project folder. The exact subdirectory depends upon which MPLAB X IDE project configuration is used. When no configuration is specified, MPLAB X IDE uses a default subdirectory called "default." Within the dist\<configuration> directory, the HEX file will be found in the production subdirectory.

Once the project is built, the HEX file for a project is created using the project name formatted as ProjectName.X. If the default configuration is used, it may be found at the location shown in the following image:

HEX location

Configuration Name

Learn More