4.4 Compiling, Programming, and Debugging PLIB Demonstration Project
The opened PLIB demonstration project can be compiled and programmed as is. All PLIB demonstrations available in the repository must be compiled as is, with no need for regenerating the project. To compile and program a PLIB demonstration, the user must select the DFP, compiler toolchain, and hardware tool (the tool must be connected to the PC) to be used with this project.
- Right-click on the project, and then
select Set Configuration > Customize....
Figure 4-5. Set Configuration - In the Project Properties window, under Categories select Conf: [sam_d21_xpro].
- In the right Configuration property page, select the DFP, Hardware tool, and compiler toolchain version (if multiple versions are installed) to compile and then program the project in the device.
- Click OK.
Figure 4-6. Project Properties The following options can be changed in the Project Properties window:
- General File Inclusion, File Exclusion, MACRO addition
- XC32 compiler settings, such as optimization, preprocessing settings, message settings, and additional optional compiler switches
- General linker settings, linker symbols and macros and linker switches
- XC32 assembler options
- Debugger program options, memories to program, debug communication interface speed
- Select Make and Program Device
Main Project from the drop-down list to compile the project and program the
device with compiler code.
Figure 4-7. Make and Program Device - To start the debug session, from
MPLAB X IDE, select Debug Main Project from the drop-down list, or click on
the Debug Main Project icon. This enables the user to debug the project.
Figure 4-8. Debug Main Project