<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ElectricRock Blog &#187; Linux</title>
	<atom:link href="http://www.electricrock.co.nz/blog/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.electricrock.co.nz/blog</link>
	<description>Electronic Ramblings</description>
	<lastBuildDate>Tue, 10 Aug 2010 03:37:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Sample Makefile for C30</title>
		<link>http://www.electricrock.co.nz/blog/2010/07/sample-makefile-for-c30/</link>
		<comments>http://www.electricrock.co.nz/blog/2010/07/sample-makefile-for-c30/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 22:00:11 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[C30]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PIC]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.electricrock.co.nz/blog/?p=157</guid>
		<description><![CDATA[To simplify the process of starting a new C30 project I have created a sample Makefile that takes care of most of the hard work of library paths, linker scripts, etc. Check it out at http://www.electricrock.co.nz/blog/microchip-c30/#makefile and let me know if you run into any problems.
]]></description>
			<content:encoded><![CDATA[<p>To simplify the process of starting a new C30 project I have created a sample Makefile that takes care of most of the hard work of library paths, linker scripts, etc. Check it out at <a href="http://www.electricrock.co.nz/blog/microchip-c30/#makefile">http://www.electricrock.co.nz/blog/microchip-c30/#makefile</a> and let me know if you run into any problems.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.electricrock.co.nz/blog/2010/07/sample-makefile-for-c30/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Updated C30 build script for C30 v3.23b</title>
		<link>http://www.electricrock.co.nz/blog/2010/07/updated-c30-build-script-for-c30-v3-23b/</link>
		<comments>http://www.electricrock.co.nz/blog/2010/07/updated-c30-build-script-for-c30-v3-23b/#comments</comments>
		<pubDate>Wed, 07 Jul 2010 21:26:26 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[C30]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PIC]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.electricrock.co.nz/blog/?p=151</guid>
		<description><![CDATA[I have made a minor update to the C30 install script so that it can build/install C30 v3.23b. The only real change (apart from updating filenames) is a new unattended install script for the non-free part.
Instructions and download here: http://www.electricrock.co.nz/blog/microchip-c30/.
]]></description>
			<content:encoded><![CDATA[<p>I have made a minor update to the C30 install script so that it can build/install C30 v3.23b. The only real change (apart from updating filenames) is a new unattended install script for the non-free part.</p>
<p>Instructions and download here: <a href="http://www.electricrock.co.nz/blog/microchip-c30/">http://www.electricrock.co.nz/blog/microchip-c30/</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.electricrock.co.nz/blog/2010/07/updated-c30-build-script-for-c30-v3-23b/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Updated C30 build script for Ubuntu 10.04</title>
		<link>http://www.electricrock.co.nz/blog/2010/05/updated-c30-build-script-for-ubuntu-10-04/</link>
		<comments>http://www.electricrock.co.nz/blog/2010/05/updated-c30-build-script-for-ubuntu-10-04/#comments</comments>
		<pubDate>Sun, 02 May 2010 21:25:50 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[C30]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PIC]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.electricrock.co.nz/blog/?p=143</guid>
		<description><![CDATA[Ubuntu 10.04 is hot off the press, so I have uploaded an update to the C30 build script to run on it.  Apparently the dos2unix command is no longer supported in 10.04 so the script now uses fromdos (thanks to Nicolas for the info).
Latest version of the script can be found here: http://www.electricrock.co.nz/blog/microchip-c30/
]]></description>
			<content:encoded><![CDATA[<p>Ubuntu 10.04 is hot off the press, so I have uploaded an update to the C30 build script to run on it.  Apparently the dos2unix command is no longer supported in 10.04 so the script now uses fromdos (thanks to Nicolas for the info).</p>
<p>Latest version of the script can be found here: <a href="http://www.electricrock.co.nz/blog/microchip-c30/">http://www.electricrock.co.nz/blog/microchip-c30/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.electricrock.co.nz/blog/2010/05/updated-c30-build-script-for-ubuntu-10-04/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>New C30 page, now with automated goodness</title>
		<link>http://www.electricrock.co.nz/blog/2010/03/new-c30-page-now-with-automated-goodness/</link>
		<comments>http://www.electricrock.co.nz/blog/2010/03/new-c30-page-now-with-automated-goodness/#comments</comments>
		<pubDate>Sun, 21 Mar 2010 05:25:40 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[Informational]]></category>
		<category><![CDATA[C30]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PIC]]></category>

		<guid isPermaLink="false">http://www.electricrock.co.nz/blog/?p=133</guid>
		<description><![CDATA[I have just created a new page to put all my C30 related tutorials, etc. on.  It can be found at http://www.electricrock.co.nz/blog/microchip-c30/.
The most notable update is that my previous C30 building tutorials are now deprecated in favor of a new bash script that does it automagically.  Check out the page for more details.
]]></description>
			<content:encoded><![CDATA[<p>I have just created a new page to put all my C30 related tutorials, etc. on.  It can be found at <a href="http://www.electricrock.co.nz/blog/microchip-c30/">http://www.electricrock.co.nz/blog/microchip-c30/</a>.</p>
<p>The most notable update is that my previous C30 building tutorials are now deprecated in favor of a new bash script that does it automagically.  Check out the page for more details.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.electricrock.co.nz/blog/2010/03/new-c30-page-now-with-automated-goodness/feed/</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
		<item>
		<title>DLP-RFID1 library for Linux</title>
		<link>http://www.electricrock.co.nz/blog/2010/02/dlp-rfid1-library-for-linux/</link>
		<comments>http://www.electricrock.co.nz/blog/2010/02/dlp-rfid1-library-for-linux/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 02:22:43 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[Informational]]></category>
		<category><![CDATA[DLP-RFID1]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.electricrock.co.nz/blog/?p=111</guid>
		<description><![CDATA[This page is deprecated. Please see the new page at: http://www.electricrock.co.nz/tools/dlp-rfid1-library-for-linux/.



I bought a DLP-RFID1 USB RFID tag reader/writer from Digikey (Cat # 813-1013-ND).  However, I was unable to locate sufficient libraries to develop software that uses it under Linux.  So I have written a C++ library to do this.  Read on for [...]]]></description>
			<content:encoded><![CDATA[<p><strong>This page is deprecated. Please see the new page at: <a href="http://www.electricrock.co.nz/tools/dlp-rfid1-library-for-linux/">http://www.electricrock.co.nz/tools/dlp-rfid1-library-for-linux/</a>.<br />
</strong></p>
<p><span style="color: #999999;"><br />
</span></p>
<p><span style="color: #999999;">I bought a <a href="http://www.dlpdesign.com/rf/rfid1.shtml">DLP-RFID1</a> USB RFID tag reader/writer from Digikey (Cat # 813-1013-ND).  However, I was unable to locate sufficient libraries to develop software that uses it under Linux.  So I have written a C++ library to do this.  Read on for more information and to download it.<br />
<span id="more-111"></span></span> <span style="color: #999999;"><br />
The DLP-RFID1 comprises an FTDI USB-Serial IC connected to a microcontroller.  Therefore the library I have developed is based on <a href="http://www.intra2net.com/en/developer/libftdi/">libftdi</a>.  Currently, it is very basic and supports only polling for tags (not reading and writing tags).  As I currently have no need for reading and writing tags I don&#8217;t plan to add this functionality unless someone asks for it.</span></p>
<p><span style="color: #999999;">The library can be downloaded from <a href="http://www.electricrock.co.nz/files/rfid1/librfid1-0.1.0.tar.bz2">http://www.electricrock.co.nz/files/rfid1/librfid1-0.1.0.tar.bz2</a>.  Documentation is provided in the package.</span></p>
<p><span style="color: #999999;">This is my first time making a library package for Linux, so if you find any problems or have any suggestions please leave a comment and let me know.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.electricrock.co.nz/blog/2010/02/dlp-rfid1-library-for-linux/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Building Microchip&#8217;s C30 Compiler v3.20 on Ubuntu 9.10</title>
		<link>http://www.electricrock.co.nz/blog/2010/01/building-c30-v32/</link>
		<comments>http://www.electricrock.co.nz/blog/2010/01/building-c30-v32/#comments</comments>
		<pubDate>Sun, 03 Jan 2010 06:06:04 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[C30]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PIC]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.electricrock.co.nz/blog/?p=87</guid>
		<description><![CDATA[NOTE: This page is now outdated, please go to http://www.electricrock.co.nz/blog/microchip-c30/
This an update to my previous tutorial for building Microchip’s C Compiler for PIC24 MCUs and dsPIC DSCs (herein referred to as C30). This update covers building v3.20 of the compiler (as opposed to v3.12) under Ubuntu 9.10.  Again, this is mostly gleaned from  http://embeddedfreak.wordpress.com/2008/10/10/compiling-mplab-c30-v311b-under-linux, but [...]]]></description>
			<content:encoded><![CDATA[<p><strong>NOTE: This page is now outdated, please go to <a href="http://www.electricrock.co.nz/blog/microchip-c30/">http://www.electricrock.co.nz/blog/microchip-c30/</a></strong></p>
<p>This an update to my <a href="http://www.electricrock.co.nz/blog/2009/08/installing-microchips-c-compiler-for-pic24-mcus-and-dspic-dscs-c30-on-ubuntu-9-04">previous tutorial</a> for building Microchip’s C Compiler for PIC24 MCUs and dsPIC DSCs (herein referred to as C30). This update covers building v3.20 of the compiler (as opposed to v3.12) under Ubuntu 9.10.  Again, this is mostly gleaned from  <a href="http://embeddedfreak.wordpress.com/2008/10/10/compiling-mplab-c30-v311b-under-linux/">http://embeddedfreak.wordpress.com/2008/10/10/compiling-mplab-c30-v311b-under-linux</a>, but adapted for the latest version of C30.</p>
<p>These instructions also work for v3.22 and are reported to work with v3.23.</p>
<p><span id="more-87"></span></p>
<h3>Installation</h3>
<h4>Install prerequisite software</h4>
<ul>
<li> Install packages from the Ubuntu repositories:
<pre class="brush: bash;">sudo aptitude install build-essential bison flex tofrodos</pre>
</li>
<li>Install wine (instructions available from the Wine website: <a href="http://www.winehq.org/download/deb">http://www.winehq.org/download/deb</a>). I used the following steps to install the latest version (you can just install the one in the Ubuntu repositories if you aren&#8217;t worried about being bleeding edge):
<pre class="brush: bash;">sudo add-apt-repository ppa:ubuntu-wine/ppa
sudo aptitude install wine</pre>
</li>
</ul>
<h4>Setup paths</h4>
<p>The exports below can be varied depending on where you prefer things to be put. At the risk of stating the obvious I&#8217;ll outline what each of the exports is for:</p>
<ul>
<li>C30BUILD is the temporary directory where the C30 tool suite is built.</li>
<li>C30INSTALL is  where it will be installed to.</li>
<li>DOWNLOADDIR is where you save files to when downloading.</li>
<li>WINEPREFIX is where you want to install the proprietary tool suite.</li>
</ul>
<pre class="brush: bash;">export C30BUILD=$HOME/c30-build
export C30INSTALL=$HOME/Apps/pic30
export DOWNLOADDIR=$HOME/Downloads
export WINEPREFIX=$HOME/Apps/pic30-wine</pre>
<h4>Download sources, etc.</h4>
<ul>
<li>From Microchip&#8217;s website download the sources for the compiler and binutils.  They can be found on this page: <a href="http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&amp;nodeId=1406&amp;dDocName=en023073">http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&amp;nodeId=1406&amp;dDocName=en023073</a>. You will need to login to download.  You want to get:
<ul>
<li><em>GCC Code for MPLAB ASM30 for dsPIC/PIC24 v3.20</em></li>
<li><em>MPLAB C30 v3.20 GCC Source</em></li>
</ul>
</li>
<li>Download the academic or evaluation version of the proprietary compiler from the C30 website (<a href="http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&amp;nodeId=1406&amp;dDocName=en010065">http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&amp;nodeId=1406&amp;dDocName=en010065</a>)</li>
<li>Download the patches. I have adapted these from those provided by John Steele Scott (see my previous post) to work with v3.20.
<ul>
<li>Binutils: <a href="http://www.electricrock.co.nz/c30/pic30-binutils-3.20.tar.bz2">http://www.electricrock.co.nz/c30/pic30-binutils-3.20.tar.bz2</a></li>
<li>GCC: <a href="http://www.electricrock.co.nz/c30/pic30-gcc-3.20.tar.bz2">http://www.electricrock.co.nz/c30/pic30-gcc-3.20.tar.bz2</a></li>
</ul>
</li>
</ul>
<h4>Building Binutils</h4>
<ul>
<li>Unzip the sources.
<pre class="brush: bash;">
mkdir -p $C30BUILD/binutils
cd $C30BUILD/binutils
tar -zxvf $DOWNLOADDIR/mplabalc30v3_20.tar.gz
tar -jxvf $DOWNLOADDIR/pic30-binutils-3.20.tar.bz2
</pre>
</li>
<li>The microchip sources have been edited on windows, so we need to convert files to unix line endings so that they can be patched.
<pre class="brush: bash;">find . -type f -exec dos2unix '{}' ';'</pre>
</li>
<li>Apply the patches.  So far as I can tell, these fix a few compile issues with the microchip compiler and make it play nicer under Linux.
<pre class="brush: bash;">for i in pic30-binutils-3.20/patches/*.diff; do echo &quot;Applying patch $i...&quot;; patch -p0 &lt; $i; done</pre>
</li>
<li>Build it, the version number in DMHCP_VERSION needs to match the version of the non-free compiler you install.
<pre class="brush: bash;"> cd acme/
CFLAGS=-DMCHP_VERSION=&quot;v3.20-Debian&quot; ./configure --prefix=$C30INSTALL --target=pic30-coff
</pre>
<li>Before we can make it we need to touch some files otherwise it doesn&#8217;t get built properly.
<pre class="brush: plain;">find . -name &quot;*.y&quot; -o -name &quot;*.l&quot; -exec touch '{}' ';'</pre>
<li>Make it.
<pre class="brush: plain;">make</pre>
</li>
<li>Install, if you install to a location that you don&#8217;t have write permission to (e.g. /usr/local) you will need to use sudo.
<pre class="brush: bash;"> make install </pre>
</li>
</ul>
<h4>Building GCC</h4>
<ul>
<li>Similar process to binutils above for building GCC.
<pre class="brush: bash;">mkdir -p $C30BUILD/gcc
cd $C30BUILD/gcc
tar -zxvf $DOWNLOADDIR/mplabc30v3_20.tar.gz
tar -jxvf $DOWNLOADDIR/pic30-gcc-3.20.tar.bz2
find . -type f -exec dos2unix '{}' ';'
for i in pic30-gcc-3.20/patches/*.diff; do echo &quot;Applying patch $i...&quot;; patch -p0 &lt; $i; done</pre>
</li>
<li>We take a slight deviation from binutils here as we create a separate directory for GCC to build in, apparently it likes it that way.
<pre class="brush: bash;">mkdir build
cd build
CFLAGS=-DMCHP_VERSION=&quot;v3.20-Debian&quot; ../gcc-4.0.2/gcc-4.0.2/configure --prefix=$C30INSTALL --target=pic30-coff --enable-languages=c</pre>
</li>
<li>Then we have to touch c-parse.y cause (according to <a href="http://embeddedfreak.wordpress.com/2008/10/10/compiling-mplab-c30-v311b-under-linux/">embeddedfreak</a>) it doesn&#8217;t get generated correctly, so we need it to be recreated. I just followed the instructions and it worked.
<pre class="brush: bash;">touch ../gcc-4.0.2/gcc-4.0.2/gcc/c-parse.y</pre>
</li>
<li>Build it and install it (again, use sudo for make install if you have to).
<pre class="brush: bash;">make
make install</pre>
</li>
<li>Link the binutils into GCC&#8217;s tool path so it can find them, and create a link to GCC itself so we don&#8217;t have to type the version number every time:
<pre class="brush: bash;">ln -s $C30INSTALL/bin/pic30-coff-as $C30INSTALL/libexec/gcc/pic30-coff/4.0.3/pic30-coff-as
ln -s $C30INSTALL/bin/pic30-coff-ld $C30INSTALL/libexec/gcc/pic30-coff/4.0.3/pic30-coff-ld
ln -s $C30INSTALL/bin/pic30-coff-gcc-4.0.3 $C30INSTALL/bin/pic30-coff-gcc</pre>
</li>
</ul>
<h4>Next Steps</h4>
<p>The rest of the steps are just the same as for building v3.12.  I won&#8217;t repeat myself here, just check out my <a href="http://www.electricrock.co.nz/blog/2009/08/installing-microchips-c-compiler-for-pic24-mcus-and-dspic-dscs-c30-on-ubuntu-9-04/">previous tutorial</a> and follow the steps from <em>Setup the non-free part</em> onward.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.electricrock.co.nz/blog/2010/01/building-c30-v32/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
