Compiler Settings for Harmony v2

The MPLAB® Harmony Project Wizard will properly configure the XC32 compiler settings. The following steps will be completed for you:

1

Open the Project Properties window.
Click here for details.

2

Configure the compiler to isolate each function in a section.

  1. Click the xc32-gcc category in the Project Properties dialog.
  2. Select General from the Options category drop down list.
  3. Check the box beside Isolate each function in a section.
xc32_prop_general.jpg
Click image to enlarge.

3

Change the compiler optimization setting to optimization level 1.

  1. Click the xc32-gcc category in the Project Properties dialog.
  2. Select Optimization from the Options category drop down list.
  3. Select 1 from the optimization-level drop down list.
xc32_prop_optimize.jpg
Click image to enlarge.

4

Folders containing any source files found outside of the project folder (<your_project_name>.X) need to be added to the compiler include directories. Your project's src and src/system_config folders will be added.

  1. Click the xc32-gcc category in the Project Properties dialog.
  2. Select Preprocessing and messages from the Options category drop down list.
  3. Click the […] button located next to Include Directories.
  4. Click Browse in the Include Directories dialog.
  5. Navigate to the <install-dir>/apps/<your_project_name>/firmware/src folder.
  6. Click Open.
  7. Click Browse in the Include Directories dialog.
  8. Navigate to the <install-dir>/apps/<your_project_name>/firmware/src/system_config folder.
  9. Click Open.
compiler_include.jpg
Click image to enlarge.

5

Change the compiler's linker setting to remove unused sections.

  1. Click the xc32-ld category in the Project Properties dialog.
  2. Select General from the Options category drop down list.
  3. Check the box beside Remove unused sections.
xc32_prop_linker.jpg
Click image to enlarge.
© 2024 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.