MPLAB XC32

  1. Download and install MPLAB XC32 Compiler for your operating system.

  2. Set these environment variables:

  3. To check that you have set these variables correctly in your current environment, follow these example shell sessions (the XC32_TOOLCHAIN_PATH values 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
    
  4. For Microchip SoCs, set XC_PACK_DIR to the root directory containing installed Microchip Device Family Packs (DFPs).

    Note

    Zephyr uses XC_PACK_DIR to find the DFP matching the selected SoC and to pass the required -mdfp and -mprocessor flag 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