MPLAB XC32
Download and install MPLAB XC32 Compiler for your operating system.
Set these environment variables:
Set
ZEPHYR_TOOLCHAIN_VARIANTtoxc32.Set
XC32_TOOLCHAIN_PATHto the toolchain installation directory.
To check that you have set these variables correctly in your current environment, follow these example shell sessions (the
XC32_TOOLCHAIN_PATHvalues may be different on your system):# Linux, macOS: $ echo $ZEPHYR_TOOLCHAIN_VARIANT xc32 $ echo $XC32_TOOLCHAIN_PATH /opt/microchip/xc32/v5.00 # Windows: > echo %ZEPHYR_TOOLCHAIN_VARIANT% xc32 > echo %XC32_TOOLCHAIN_PATH% C:\Microchip\xc32\v5.00
For Microchip SoCs, set
XC_PACK_DIRto the root directory containing installed Microchip Device Family Packs (DFPs).Note
Zephyr uses
XC_PACK_DIRto find the DFP matching the selected SoC and to pass the required-mdfpand-mprocessorflag to the XC32 toolchain.For example:
# Linux, macOS: $ export XC_PACK_DIR=/home/path/.packs/microchip # Windows: > set XC_PACK_DIR=C:\Users\path\.mchp_packs\Microchip