{"id":121,"date":"2020-06-01T12:14:32","date_gmt":"2020-06-01T16:14:32","guid":{"rendered":"http:\/\/marcduino.com\/?page_id=121"},"modified":"2021-09-28T16:18:37","modified_gmt":"2021-09-28T20:18:37","slug":"setting-up-eclipse","status":"publish","type":"page","link":"https:\/\/marcduino.com\/?page_id=121","title":{"rendered":"Setting up Eclipse"},"content":{"rendered":"\n<h2 class=\"has-vivid-cyan-blue-color has-text-color wp-block-heading\">Eclipse Setup&nbsp;<\/h2>\n\n\n\n<p>This is the setup I use and recommend. It is more powerful than the simplified Atmel environment, and therefore a bit more complex to install. Note that Eclipse software evolves quickly and that the following might quickly get superseded by new version. But the gist of it should stay the same.<\/p>\n\n\n\n<h2 class=\"has-vivid-cyan-blue-color has-text-color wp-block-heading\">Install the Eclipse development environment for AVR<\/h2>\n\n\n\n<p>I use Eclipse Indigo 3.7 (last time I tried, the new Eclipse 4.2 Juno still had stability issues, which are probably fixed by now). Eclipse 3.7 works equally well on Linux, Mac and Windows, and has more features than I can possibly use.&nbsp;<\/p>\n\n\n\n<p>It&#8217;s a three step process. You will need to install Eclipse C\/C++ version for your platform, then install the AVR plugin from within Eclipse. But before you do so, install the AVR cross compile tools and libraries for you platform:<\/p>\n\n\n\n<h3 class=\"has-vivid-cyan-blue-color has-text-color wp-block-heading\">AVR cross compile tools install<\/h3>\n\n\n\n<p>On Windows, download and install &nbsp;<a href=\"http:\/\/sourceforge.net\/projects\/winavr\/files\/\">WinAVR 2010-01-20<\/a><\/p>\n\n\n\n<p>On Mac, download and install <a href=\"http:\/\/www.obdev.at\/products\/crosspack\/index.html\">Crosspack AVR<\/a><\/p>\n\n\n\n<h3 class=\"has-vivid-cyan-blue-color has-text-color wp-block-heading\">Update problematic files on the Windows version:<\/h3>\n\n\n\n<p>On Win8 and Win10, you need to replace the msys-1.0.dll file in the C:\\WinAVR-20100110\\utils\\bin with this newer version bprrowed from Windows Vista:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/drive.google.com\/open?id=1ny20Frh4j4eSjLX6WFtPnVrQzIexQ-PB\">New msys-1.0.dll (from Windows Vista64 disti)<\/a><\/li><\/ul>\n\n\n\n<p>(with the old file, I got an error when trying to compile: &#8220;avr-gcc.exe: The application did not start correctly&#8221;, the fix above gets rid of it)<\/p>\n\n\n\n<p>Another user reported a similar error: &#8220;avr-gcc.exe application error&#8221;&nbsp;<\/p>\n\n\n\n<p>To clear that one, he needed to rename the file SH.exe to SHA.exe, also found in C:\\WinAVR-20100110\\utils\\bin.<\/p>\n\n\n\n<p>I have not experienced this nor tried it myself.<\/p>\n\n\n\n<h3 class=\"has-vivid-cyan-blue-color has-text-color wp-block-heading\">Eclipse C\/C++ install<\/h3>\n\n\n\n<p>Download and install <a href=\"http:\/\/www.eclipse.org\/downloads\/packages\/release\/indigo\/sr2\">Eclipse IDE for C\/C++<\/a> (3.7 Indigo) for your platform<\/p>\n\n\n\n<h3 class=\"has-vivid-cyan-blue-color has-text-color wp-block-heading\">AVR Plug-in install<\/h3>\n\n\n\n<p>This is accomplished from within Eclipse: &nbsp;<\/p>\n\n\n\n<p><a href=\"http:\/\/avr-eclipse.sourceforge.net\/wiki\/index.php\/Plugin_Download\">AVR plugin installation instructions<\/a><\/p>\n\n\n\n<p>Note: Eclipse AVR used to require the &#8220;PartsDescriptionFiles&#8221; folder which is part of Atmel AVR Studio 5 download, which you can still get here:<\/p>\n\n\n\n<p><a href=\"http:\/\/www.atmel.com\/Images\/as5installer-stable-5.1.208-full.exe\">http:\/\/www.atmel.com\/Images\/as5installer-stable-5.1.208-full.exe<\/a><\/p>\n\n\n\n<p>The plugin will find that folder automatically if Atmel Studio 5 was installed on your computer.&nbsp;<\/p>\n\n\n\n<p>The current version is now Atmel Studio 6, and this folder has been renamed &#8220;devices&#8221;. I have Studio 5 installed on my machine, and it works great. I have not tested whether you need install Studio 6 or anything else with the new Eclipse AVR version.&nbsp;<\/p>\n\n\n\n<h3 class=\"has-vivid-cyan-blue-color has-text-color wp-block-heading\">Setup a new MarcDuino project<\/h3>\n\n\n\n<p>Launch Eclipse, and designate a folder as your workspace.<\/p>\n\n\n\n<p>Go to File-&gt;New-&gt;C Project.<\/p>\n\n\n\n<p>In the dialog window that opens, select AVR Cross Target Application, empty project,&nbsp;<\/p>\n\n\n\n<p>Give it a project name. <strong>Beware, the project name should have NO SPACES in it<\/strong>, or you&#8217;ll get a weird error at compile time.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"511\" height=\"451\" src=\"https:\/\/marcduino.com\/wp-content\/uploads\/2020\/06\/Eclipse_Empty_project.jpg\" alt=\"\" class=\"wp-image-460\" srcset=\"https:\/\/marcduino.com\/wp-content\/uploads\/2020\/06\/Eclipse_Empty_project.jpg 511w, https:\/\/marcduino.com\/wp-content\/uploads\/2020\/06\/Eclipse_Empty_project-300x265.jpg 300w\" sizes=\"auto, (max-width: 511px) 100vw, 511px\" \/><\/figure>\n\n\n\n<h3 class=\"has-vivid-cyan-blue-color has-text-color wp-block-heading\">Configure the project hardware properties for the MarcDuino board<\/h3>\n\n\n\n<p>Go to Project -&gt; Properties&nbsp;<\/p>\n\n\n\n<p>In the dialog window that opens, select AVR, then Target Hardware<\/p>\n\n\n\n<p>Set the MCU Type to ATMega328p, and MCU Clock to 16000000 (our 16 MHz clock)&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"583\" src=\"https:\/\/marcduino.com\/wp-content\/uploads\/2020\/06\/Eclipse-Target-Hardware-1024x583.jpg\" alt=\"\" class=\"wp-image-461\" srcset=\"https:\/\/marcduino.com\/wp-content\/uploads\/2020\/06\/Eclipse-Target-Hardware-1024x583.jpg 1024w, https:\/\/marcduino.com\/wp-content\/uploads\/2020\/06\/Eclipse-Target-Hardware-300x171.jpg 300w, https:\/\/marcduino.com\/wp-content\/uploads\/2020\/06\/Eclipse-Target-Hardware-768x437.jpg 768w, https:\/\/marcduino.com\/wp-content\/uploads\/2020\/06\/Eclipse-Target-Hardware.jpg 1160w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"has-vivid-cyan-blue-color has-text-color wp-block-heading\">Configure AVRdude &nbsp;and Fuse values<\/h3>\n\n\n\n<p>This assumes you will be using SparkFun&#8217;s <a href=\"http:\/\/www.curiousmarc.com\/dome-automation\/building-marcduino-boards\/building-the-firware\">AVR Pocket Programmer as described here<\/a>.<\/p>\n\n\n\n<p>In the dialog box above, click on the right on AVRDude. Then go to the Programmer tab. Click New&#8230;, select USBTiny from the list, leave everything as default, name the scheme &#8220;AVR Pocket Programmer&#8221;.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"587\" src=\"https:\/\/marcduino.com\/wp-content\/uploads\/2020\/06\/Eclipse-AVR-Dude-1024x587.jpg\" alt=\"\" class=\"wp-image-463\" srcset=\"https:\/\/marcduino.com\/wp-content\/uploads\/2020\/06\/Eclipse-AVR-Dude-1024x587.jpg 1024w, https:\/\/marcduino.com\/wp-content\/uploads\/2020\/06\/Eclipse-AVR-Dude-300x172.jpg 300w, https:\/\/marcduino.com\/wp-content\/uploads\/2020\/06\/Eclipse-AVR-Dude-768x440.jpg 768w, https:\/\/marcduino.com\/wp-content\/uploads\/2020\/06\/Eclipse-AVR-Dude.jpg 1157w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Next you should go to the Fuse tab. This is an important step. Setting the fuses will determine among others the clocking source for the ATmega328 chip, memory protection and programming methods. If you set it wrong, there is a good chance you will brick your chip forever. Double check the fuse values twice. You only have to set the fuses once at the first upload. You can disable downloading fuses afterwards.<\/p>\n\n\n\n<p>Click direct HEX values -&gt; click convert -&gt; fill values with FF DF FC<\/p>\n\n\n\n<p>NOTE:  The image below is out of date.  The extended fuse should be FC, not 07 as shown below.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1010\" height=\"577\" src=\"https:\/\/marcduino.com\/wp-content\/uploads\/2020\/06\/Eclipse-Fuses.jpg\" alt=\"\" class=\"wp-image-462\" srcset=\"https:\/\/marcduino.com\/wp-content\/uploads\/2020\/06\/Eclipse-Fuses.jpg 1010w, https:\/\/marcduino.com\/wp-content\/uploads\/2020\/06\/Eclipse-Fuses-300x171.jpg 300w, https:\/\/marcduino.com\/wp-content\/uploads\/2020\/06\/Eclipse-Fuses-768x439.jpg 768w\" sizes=\"auto, (max-width: 1010px) 100vw, 1010px\" \/><\/figure>\n\n\n\n<p>Click OK to dismiss the dialog.<\/p>\n\n\n\n<h3 class=\"has-vivid-cyan-blue-color has-text-color wp-block-heading\">Import source files into the project<\/h3>\n\n\n\n<p>Source files are here <a href=\"https:\/\/github.com\/nhutchison\/MarcDuinoMain\/releases\" data-type=\"URL\" data-id=\"https:\/\/github.com\/nhutchison\/MarcDuinoMain\/releases\">Main<\/a> \/ <a href=\"https:\/\/github.com\/nhutchison\/MarcDuinoClient\/releases\">Client<\/a>. Select the zip file for the board you want to build, download it and unzip it.<\/p>\n\n\n\n<p>Go to File -&gt; Import&nbsp;<\/p>\n\n\n\n<p>In the dialog that appears, choose File System.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"536\" height=\"630\" src=\"https:\/\/marcduino.com\/wp-content\/uploads\/2020\/06\/Eclipse-Import-Files.jpg\" alt=\"\" class=\"wp-image-459\" srcset=\"https:\/\/marcduino.com\/wp-content\/uploads\/2020\/06\/Eclipse-Import-Files.jpg 536w, https:\/\/marcduino.com\/wp-content\/uploads\/2020\/06\/Eclipse-Import-Files-255x300.jpg 255w\" sizes=\"auto, (max-width: 536px) 100vw, 536px\" \/><\/figure>\n\n\n\n<p>Click Next, and Browse&#8230; to select the folder where you expanded the source files. Put a checkmark next to it to select all the files.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"623\" height=\"684\" src=\"https:\/\/marcduino.com\/wp-content\/uploads\/2020\/06\/Eclipse-Import-Files2.jpg\" alt=\"\" class=\"wp-image-467\" srcset=\"https:\/\/marcduino.com\/wp-content\/uploads\/2020\/06\/Eclipse-Import-Files2.jpg 623w, https:\/\/marcduino.com\/wp-content\/uploads\/2020\/06\/Eclipse-Import-Files2-273x300.jpg 273w\" sizes=\"auto, (max-width: 623px) 100vw, 623px\" \/><\/figure>\n\n\n\n<p>Click Finish. All your project files should now appear into your project folder (and don&#8217;t do like me and use spaces in your project name!). If you double click on main.c for example, the main program source file will open in the editor tab. You can now explore and edit the source code as desired.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"667\" src=\"https:\/\/marcduino.com\/wp-content\/uploads\/2020\/06\/Eclipse-Proejct-View-1024x667.jpg\" alt=\"\" class=\"wp-image-468\" srcset=\"https:\/\/marcduino.com\/wp-content\/uploads\/2020\/06\/Eclipse-Proejct-View-1024x667.jpg 1024w, https:\/\/marcduino.com\/wp-content\/uploads\/2020\/06\/Eclipse-Proejct-View-300x195.jpg 300w, https:\/\/marcduino.com\/wp-content\/uploads\/2020\/06\/Eclipse-Proejct-View-768x500.jpg 768w, https:\/\/marcduino.com\/wp-content\/uploads\/2020\/06\/Eclipse-Proejct-View.jpg 1265w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"has-vivid-cyan-blue-color has-text-color wp-block-heading\">Compile and upload the code<\/h3>\n\n\n\n<p>Make sure your project folder is selected. Click on the little arrow next to the Hammer Icon, and select Release. The source code will compile, takes just a few seconds.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"663\" height=\"365\" src=\"https:\/\/marcduino.com\/wp-content\/uploads\/2020\/06\/Eclipse-Compile.jpg\" alt=\"\" class=\"wp-image-470\" srcset=\"https:\/\/marcduino.com\/wp-content\/uploads\/2020\/06\/Eclipse-Compile.jpg 663w, https:\/\/marcduino.com\/wp-content\/uploads\/2020\/06\/Eclipse-Compile-300x165.jpg 300w\" sizes=\"auto, (max-width: 663px) 100vw, 663px\" \/><\/figure>\n\n\n\n<p>The console window should appear at the bottom with some kind of good news like this:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"682\" height=\"480\" src=\"https:\/\/marcduino.com\/wp-content\/uploads\/2020\/06\/Eclipse-compile-success4.jpg\" alt=\"\" class=\"wp-image-471\" srcset=\"https:\/\/marcduino.com\/wp-content\/uploads\/2020\/06\/Eclipse-compile-success4.jpg 682w, https:\/\/marcduino.com\/wp-content\/uploads\/2020\/06\/Eclipse-compile-success4-300x211.jpg 300w\" sizes=\"auto, (max-width: 682px) 100vw, 682px\" \/><\/figure>\n\n\n\n<p>Once that is done, you can simply upload the code and set the board fuses with one click on the AVR* icon.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"627\" height=\"285\" src=\"https:\/\/marcduino.com\/wp-content\/uploads\/2020\/06\/Eclipse-Upload.jpg\" alt=\"\" class=\"wp-image-472\" srcset=\"https:\/\/marcduino.com\/wp-content\/uploads\/2020\/06\/Eclipse-Upload.jpg 627w, https:\/\/marcduino.com\/wp-content\/uploads\/2020\/06\/Eclipse-Upload-300x136.jpg 300w\" sizes=\"auto, (max-width: 627px) 100vw, 627px\" \/><\/figure>\n\n\n\n<p>On occasion, I get an error &#8220;Could not find USBTiny device&#8221;, just unplugging and replugging the Pocket Programmer fixes it.<\/p>\n\n\n\n<p>Your program should upload and the telltale red LED light should begin to flash after it&#8217;s done, indicating the program is running&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"715\" src=\"https:\/\/marcduino.com\/wp-content\/uploads\/2020\/06\/Eclipse-Upload-In-Progress-1024x715.jpg\" alt=\"\" class=\"wp-image-473\" srcset=\"https:\/\/marcduino.com\/wp-content\/uploads\/2020\/06\/Eclipse-Upload-In-Progress-1024x715.jpg 1024w, https:\/\/marcduino.com\/wp-content\/uploads\/2020\/06\/Eclipse-Upload-In-Progress-300x210.jpg 300w, https:\/\/marcduino.com\/wp-content\/uploads\/2020\/06\/Eclipse-Upload-In-Progress-768x537.jpg 768w, https:\/\/marcduino.com\/wp-content\/uploads\/2020\/06\/Eclipse-Upload-In-Progress.jpg 1248w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Eclipse Setup&nbsp; This is the setup I use and recommend. It is more powerful than the simplified Atmel environment, and therefore a bit more complex to install. Note that Eclipse &hellip; <a href=\"https:\/\/marcduino.com\/?page_id=121\" class=\"more-link\"><span>Continue reading<span class=\"screen-reader-text\">Setting up Eclipse<\/span><\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-121","page","type-page","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/marcduino.com\/index.php?rest_route=\/wp\/v2\/pages\/121","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/marcduino.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/marcduino.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/marcduino.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/marcduino.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=121"}],"version-history":[{"count":5,"href":"https:\/\/marcduino.com\/index.php?rest_route=\/wp\/v2\/pages\/121\/revisions"}],"predecessor-version":[{"id":555,"href":"https:\/\/marcduino.com\/index.php?rest_route=\/wp\/v2\/pages\/121\/revisions\/555"}],"wp:attachment":[{"href":"https:\/\/marcduino.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=121"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}