This is a C compiler for the dsPIC and PIC24 24-bit address word PICMicros.
Installation is comprised of two steps. The first step installs the commercial compiler and the include files. The second step is used to replace the compiler with the free edition. The support files are needed in step 2 from step 1.
The commercial edition has optimisation limitations unless a license is bought.
mkdir -p /opt/microchip cd /opt/microchip
wget "http://ww1.microchip.com/downloads/en/DeviceDoc/xc16-v1.30-full-install-linux-installer.run" chmod +x *.run ./xc16-v1.30-full-install-linux-installer.run
Peripheral include files need to be fetched and installed separately.
wget "http://ww1.microchip.com/downloads/en//softwarelibrary/pic24 mcu dspic peripheral lib/peripheral-libraries-for-pic24-and-dspic-v2.00-linux-installer.run" chmod +x *.run ./peripheral-libraries-for-pic24-and-dspic-v2.00-linux-installer.run
Use /opt/microchip/xc16/v1.30 as the install directory.
The free edition utilises header files and libraries from the commercial edition so perform the installation steps given above first. The free edition has no limitations and does not require a license for optimisations.
The source code for the compiler needs a number of patches to build and operate. Patches were sourced from patches from the older c30 compiler and others created for XC16. The resultant build has proven to produce binary objects that work on the target devices.
cd /var/tmp apt-get install build-essential flex bison unzip mercurial zlib1g-dev hg clone http://hg.kewl.org/pub/pic30 cd pic30
The install process will apply a number of patches, build the compiler and tools and install everything in /opt/pic30-tools.
wget "http://ww1.microchip.com/downloads/en/DeviceDoc/v1.30.src.zip" ./install
The install script expects the commercial compiler and includes files to be installed so it may copy the support files to the build directory.
The final output of this process is not elegant and can do with more work but this is not a high priority.
This also depends on the commercial edition which must be installed as given above.
mkdir -p /embedded/raspbian/opt/microchip/xc16/v1.30/ cd /embedded/raspbian/opt/microchip/xc16/v1.30/ cp -Rp /opt/microchip/xc16/v1.30/* . mkdir -p /embedded/raspbian/var/tmp/ cd /embedded/raspbian/var/tmp hg clone http://hg.kewl.org/pub/pic30 cd pic30
wget "http://ww1.microchip.com/downloads/en/DeviceDoc/v1.30.src.zip"
apt-get install build-essential flex bison unzip zlib1g-dev cd /var/tmp/pic30 ./install exit
cd /opt cp -Rpa /embedded/raspbian/opt/pic30-tools .