230 lines
21 KiB
HTML
230 lines
21 KiB
HTML
<!DOCTYPE html>
|
|
<html class="no-js" lang="en">
|
|
<head>
|
|
<title>Eclipse - QMK Firmware</title>
|
|
<meta name="description" content="Keyboard controller firmware for Atmel AVR and ARM USB families">
|
|
<meta name="author" content="QMK Community">
|
|
<meta charset="UTF-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
|
|
<link rel="icon" href="../themes/daux/img/favicon-navy.png" type="image/x-icon">
|
|
|
|
<!-- Mobile -->
|
|
<meta name="apple-mobile-web-app-capable" content="yes" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
<!-- Font -->
|
|
|
|
<!-- CSS -->
|
|
<link href='../themes/daux/css/theme-navy.min.css' rel='stylesheet' type='text/css'>
|
|
<!-- Tipue Search -->
|
|
<link href="../tipuesearch/tipuesearch.css" rel="stylesheet">
|
|
|
|
<!--[if lt IE 9]>
|
|
<script src="../themes/daux/js/html5shiv-3.7.3.min.js"></script>
|
|
<![endif]-->
|
|
</head>
|
|
<body class=" ">
|
|
<div class="Columns content">
|
|
<aside class="Columns__left Collapsible">
|
|
<button type="button" class="Button Collapsible__trigger">
|
|
<span class="Collapsible__trigger__bar"></span>
|
|
<span class="Collapsible__trigger__bar"></span>
|
|
<span class="Collapsible__trigger__bar"></span>
|
|
</button>
|
|
|
|
<a class="Brand" href="../index.html">QMK Firmware</a>
|
|
|
|
<div class="Search">
|
|
<svg class="Search__icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 451 451">
|
|
<path d="M447.05 428l-109.6-109.6c29.4-33.8 47.2-77.9 47.2-126.1C384.65 86.2 298.35 0 192.35 0 86.25 0 .05 86.3.05 192.3s86.3 192.3 192.3 192.3c48.2 0 92.3-17.8 126.1-47.2L428.05 447c2.6 2.6 6.1 4 9.5 4s6.9-1.3 9.5-4c5.2-5.2 5.2-13.8 0-19zM26.95 192.3c0-91.2 74.2-165.3 165.3-165.3 91.2 0 165.3 74.2 165.3 165.3s-74.1 165.4-165.3 165.4c-91.1 0-165.3-74.2-165.3-165.4z"/>
|
|
</svg>
|
|
<input type="search" id="tipue_search_input" class="Search__field" placeholder="Search..." autocomplete="on"
|
|
results=25 autosave=text_search>
|
|
</div>
|
|
|
|
<div class="Collapsible__content">
|
|
<!-- Navigation -->
|
|
<ul class='Nav'><li class='Nav__item has-children'><a href="../Getting_Started/index.html" class="folder"><i class="Nav__arrow"> </i>Getting Started</a><ul class='Nav'><li class='Nav__item has-children'><a href="../Getting_Started/Install_Build_Tools/index.html" class="folder"><i class="Nav__arrow"> </i>Install Build Tools</a><ul class='Nav'><li class='Nav__item '><a href="../Getting_Started/Install_Build_Tools/Vagrant.html">Vagrant</a></li></ul></li><li class='Nav__item '><a href="../Getting_Started/Build_Compile_Instructions.html">Build Compile Instructions</a></li><li class='Nav__item '><a href="../Getting_Started/Flashing_Firmware.html">Flashing Firmware</a></li><li class='Nav__item '><a href="../Getting_Started/Contributing.html">Contributing</a></li><li class='Nav__item '><a href="../Getting_Started/How_to_Use_GitHub.html">How to Use GitHub</a></li><li class='Nav__item '><a href="../Getting_Started/Getting_Help.html">Getting Help</a></li></ul></li><li class='Nav__item has-children'><a href="../Complete_Newbs_Guide/index.html" class="folder"><i class="Nav__arrow"> </i>Complete Newbs Guide</a><ul class='Nav'><li class='Nav__item '><a href="../Complete_Newbs_Guide/Complete_Newbie's_Guide.html">Complete Newbie's Guide</a></li><li class='Nav__item '><a href="../Complete_Newbs_Guide/Building_Your_First_Firmware.html">Building Your First Firmware</a></li><li class='Nav__item '><a href="../Complete_Newbs_Guide/Flashing_Firmware.html">Flashing Firmware</a></li><li class='Nav__item '><a href="../Complete_Newbs_Guide/Testing_and_Debugging.html">Testing and Debugging</a></li></ul></li><li class='Nav__item has-children'><a href="../FAQ/index.html" class="folder"><i class="Nav__arrow"> </i>FAQ</a><ul class='Nav'><li class='Nav__item '><a href="../FAQ/General_FAQ.html">General FAQ</a></li><li class='Nav__item '><a href="../FAQ/Build_Compile_QMK.html">Build Compile QMK</a></li><li class='Nav__item '><a href="../FAQ/Debugging_and_Troubleshooting.html">Debugging and Troubleshooting</a></li><li class='Nav__item '><a href="../FAQ/Keymaps.html">Keymaps</a></li></ul></li><li class='Nav__item has-children'><a href="../Hardware/index.html" class="folder"><i class="Nav__arrow"> </i>Hardware</a><ul class='Nav'><li class='Nav__item '><a href="../Hardware/AVR_Processors.html">AVR Processors</a></li><li class='Nav__item '><a href="../Hardware/Drivers.html">Drivers</a></li></ul></li><li class='Nav__item has-children'><a href="../Features/index.html" class="folder"><i class="Nav__arrow"> </i>Features</a><ul class='Nav'><li class='Nav__item '><a href="../Features/Advanced_Keycodes.html">Advanced Keycodes</a></li><li class='Nav__item '><a href="../Features/Audio.html">Audio</a></li><li class='Nav__item '><a href="../Features/Auto_Shift.html">Auto Shift</a></li><li class='Nav__item '><a href="../Features/Backlight.html">Backlight</a></li><li class='Nav__item '><a href="../Features/Bluetooth.html">Bluetooth</a></li><li class='Nav__item '><a href="../Features/Bootmagic.html">Bootmagic</a></li><li class='Nav__item '><a href="../Features/Command.html">Command</a></li><li class='Nav__item '><a href="../Features/Dynamic_Macros.html">Dynamic Macros</a></li><li class='Nav__item '><a href="../Features/Grave_Escape.html">Grave Escape</a></li><li class='Nav__item '><a href="../Features/Key_Lock.html">Key Lock</a></li><li class='Nav__item '><a href="../Features/Layouts.html">Layouts</a></li><li class='Nav__item '><a href="../Features/Leader_Key.html">Leader Key</a></li><li class='Nav__item '><a href="../Features/Macros.html">Macros</a></li><li class='Nav__item '><a href="../Features/Mouse_Keys.html">Mouse Keys</a></li><li class='Nav__item '><a href="../Features/Pointing_Device.html">Pointing Device</a></li><li class='Nav__item '><a href="../Features/PS_2_Mouse.html">PS 2 Mouse</a></li><li class='Nav__item '><a href="../Features/RGB_Lighting.html">RGB Lighting</a></li><li class='Nav__item '><a href="../Features/Space_Cadet_Shift.html">Space Cadet Shift</a></li><li class='Nav__item '><a href="../Features/Space_Cadet_Shift_Enter.html">Space Cadet Shift Enter</a></li><li class='Nav__item '><a href="../Features/Stenography.html">Stenography</a></li><li class='Nav__item '><a href="../Features/Swap_Hands.html">Swap Hands</a></li><li class='Nav__item '><a href="../Features/Tap_Dance.html">Tap Dance</a></li><li class='Nav__item '><a href="../Features/Terminal.html">Terminal</a></li><li class='Nav__item '><a href="../Features/Thermal_Printer.html">Thermal Printer</a></li><li class='Nav__item '><a href="../Features/Unicode.html">Unicode</a></li><li class='Nav__item '><a href="../Features/Userspace.html">Userspace</a></li></ul></li><li class='Nav__item has-children'><a href="../Keycodes/index.html" class="folder"><i class="Nav__arrow"> </i>Keycodes</a><ul class='Nav'><li class='Nav__item '><a href="../Keycodes/Advanced_Keycodes.html">Advanced Keycodes</a></li><li class='Nav__item '><a href="../Keycodes/Backlight.html">Backlight</a></li><li class='Nav__item '><a href="../Keycodes/Basic.html">Basic</a></li><li class='Nav__item '><a href="../Keycodes/Bluetooth.html">Bluetooth</a></li><li class='Nav__item '><a href="../Keycodes/Bootmagic.html">Bootmagic</a></li><li class='Nav__item '><a href="../Keycodes/Quantum_Keycodes.html">Quantum Keycodes</a></li><li class='Nav__item '><a href="../Keycodes/RGB_Lighting.html">RGB Lighting</a></li><li class='Nav__item '><a href="../Keycodes/Stenography.html">Stenography</a></li><li class='Nav__item '><a href="../Keycodes/Thermal_Printer.html">Thermal Printer</a></li><li class='Nav__item '><a href="../Keycodes/US_ANSI_Shifted_keys.html">US ANSI Shifted keys</a></li></ul></li><li class='Nav__item has-children'><a href="../Reference/index.html" class="folder"><i class="Nav__arrow"> </i>Reference</a><ul class='Nav'><li class='Nav__item '><a href="../Reference/Keyboard_Guidelines.html">Keyboard Guidelines</a></li><li class='Nav__item '><a href="../Reference/Compatable_Microcontrollers.html">Compatable Microcontrollers</a></li><li class='Nav__item '><a href="../Reference/Config_Options.html">Config Options</a></li><li class='Nav__item '><a href="../Reference/Custom_Code.html">Custom Code</a></li><li class='Nav__item '><a href="../Reference/Documentation_Best_Practices.html">Documentation Best Practices</a></li><li class='Nav__item '><a href="../Reference/Documentation_Templates.html">Documentation Templates</a></li><li class='Nav__item '><a href="../Reference/Glossary.html">Glossary</a></li><li class='Nav__item '><a href="../Reference/Keymap_Overview.html">Keymap Overview</a></li><li class='Nav__item '><a href="../Reference/Unit_Testing.html">Unit Testing</a></li></ul></li><li class='Nav__item has-children'><a href="../For_Makers_And_Modders/index.html" class="folder"><i class="Nav__arrow"> </i>For Makers And Modders</a><ul class='Nav'><li class='Nav__item '><a href="../For_Makers_And_Modders/Hand_Wiring_Guide.html">Hand Wiring Guide</a></li><li class='Nav__item '><a href="../For_Makers_And_Modders/ISP_Flashing_Guide.html">ISP Flashing Guide</a></li></ul></li><li class='Nav__item Nav__item--open has-children'><a href="../IDEs/index.html" class="folder"><i class="Nav__arrow"> </i>IDEs</a><ul class='Nav'><li class='Nav__item Nav__item--active'><a href="../IDEs/Eclipse.html">Eclipse</a></li></ul></li><li class='Nav__item has-children'><a href="../For_a_Deeper_Understanding/index.html" class="folder"><i class="Nav__arrow"> </i>For a Deeper Understanding</a><ul class='Nav'><li class='Nav__item '><a href="../For_a_Deeper_Understanding/How_Keyboards_Work.html">How Keyboards Work</a></li><li class='Nav__item '><a href="../For_a_Deeper_Understanding/Understanding_QMK.html">Understanding QMK</a></li></ul></li></ul>
|
|
|
|
<div class="Links">
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
</aside>
|
|
<div class="Columns__right Columns__right--full">
|
|
<div class="Columns__right__content">
|
|
<div class="doc_content">
|
|
<article class="Page">
|
|
|
|
<div class="Page__header">
|
|
<h1><a href="../IDEs/index.html">IDEs</a> <svg class="Page__header--separator" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 477.175 477.175"><path d="M360.73 229.075l-225.1-225.1c-5.3-5.3-13.8-5.3-19.1 0s-5.3 13.8 0 19.1l215.5 215.5-215.5 215.5c-5.3 5.3-5.3 13.8 0 19.1 2.6 2.6 6.1 4 9.5 4 3.4 0 6.9-1.3 9.5-4l225.1-225.1c5.3-5.2 5.3-13.8.1-19z"/></svg> <a href="../IDEs/Eclipse.html">Eclipse</a></h1>
|
|
<span class="EditOn">
|
|
<a href="https://github.com/qmk/qmk_firmware/blob/master/docs/09_IDEs/Eclipse.md" target="_blank">
|
|
Edit on GitHub </a>
|
|
</span>
|
|
</div>
|
|
|
|
<div class="s-content">
|
|
<ul class="TableOfContents">
|
|
<li>
|
|
<p><a href="#page_Setting-up-Eclipse-for-QMK-Development">Setting up Eclipse for QMK Development</a></p>
|
|
</li>
|
|
<li>
|
|
<p><a href="#page_Prerequisites">Prerequisites</a></p>
|
|
<ul class="TableOfContents">
|
|
<li>
|
|
<p><a href="#page_Build-Environment">Build Environment</a></p>
|
|
</li>
|
|
<li>
|
|
<p><a href="#page_Java">Java</a></p>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
<li>
|
|
<p><a href="#page_Install-Eclipse-and-Its-Plugins">Install Eclipse and Its Plugins</a></p>
|
|
<ul class="TableOfContents">
|
|
<li>
|
|
<p><a href="#page_Download-and-Install-Eclipse-CDT">Download and Install Eclipse CDT</a></p>
|
|
</li>
|
|
<li>
|
|
<p><a href="#page_First-Launch">First Launch</a></p>
|
|
</li>
|
|
<li>
|
|
<p><a href="#page_Install-the-Necessary-Plugins">Install the Necessary Plugins</a></p>
|
|
<ul class="TableOfContents">
|
|
<li>
|
|
<p><a href="#page_The-AVR-Plugin"><a href="http://avr-eclipse.sourceforge.net/" class="Link--external">The AVR Plugin</a></a></p>
|
|
</li>
|
|
<li>
|
|
<p><a href="#page_ANSI-Escape-in-Console"><a href="https://marketplace.eclipse.org/content/ansi-escape-console" class="Link--external">ANSI Escape in Console</a></a></p>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
<li>
|
|
<p><a href="#page_Configure-Eclipse-for-QMK">Configure Eclipse for QMK</a></p>
|
|
<ul class="TableOfContents">
|
|
<li>
|
|
<p><a href="#page_Importing-the-Project">Importing the Project</a></p>
|
|
</li>
|
|
<li>
|
|
<p><a href="#page_Build-Your-Keyboard">Build Your Keyboard</a></p>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<h1 id="page_Setting-up-Eclipse-for-QMK-Development">Setting up Eclipse for QMK Development</h1>
|
|
<p><a href="https://en.wikipedia.org/wiki/Eclipse_(software)" class="Link--external">Eclipse</a> is an open-source <a href="https://en.wikipedia.org/wiki/Integrated_development_environment" class="Link--external">Integrated Development Environment</a> (IDE) widely used for Java development, but with an extensible plugin system that allows to customize it for other languages and usages.</p>
|
|
<p>Using an IDE such as Eclipse provides many advantages over a plain text editor, such as:</p>
|
|
<ul>
|
|
<li>intelligent code completion</li>
|
|
<li>convenient navigation in the code</li>
|
|
<li>refactoring tools</li>
|
|
<li>build automation (no need for the command-line)</li>
|
|
<li>a GUI for GIT</li>
|
|
<li>static code analysis</li>
|
|
<li>many other tools such as debugging, code formatting, showing call hierarchies etc.</li>
|
|
</ul>
|
|
<p>The purpose of the is page is to document how to set-up Eclipse for developing AVR software, and working on the QMK code base.</p>
|
|
<p>Note that this set-up has been tested on Ubuntu 16.04 only for the moment.</p>
|
|
<h1 id="page_Prerequisites">Prerequisites</h1>
|
|
<h2 id="page_Build-Environment">Build Environment</h2>
|
|
<p>Before starting, you must have followed the <a href="index.html#getting-started">Getting Started</a> section corresponding to your system. In particular, you must have been able to build the firmware with the <code>make</code> command.</p>
|
|
<h2 id="page_Java">Java</h2>
|
|
<p>Eclipse is a Java application, so you will need to install Java 8 or more recent to be able to run it. You may choose between the JRE or the JDK, the latter being useful if you intend to do Java development.</p>
|
|
<h1 id="page_Install-Eclipse-and-Its-Plugins">Install Eclipse and Its Plugins</h1>
|
|
<p>Eclipse comes in <a href="http://www.eclipse.org/downloads/eclipse-packages/" class="Link--external">several flavours</a> depending on the target usage that you will have. There is no package comprising the AVR stack, so we will need to start from Eclipse CDT (C/C++ Development Tooling) and install the necessary plugins.</p>
|
|
<h2 id="page_Download-and-Install-Eclipse-CDT">Download and Install Eclipse CDT</h2>
|
|
<p>If you already have Eclipse CDT on your system, you can skip this step. However it is advised to keep it up-to-date for better support.</p>
|
|
<p>If you have another Eclipse package installed, it is normally possible to <a href="https://eclipse.org/cdt/downloads.php" class="Link--external">install the CDT plugin over it</a>. However it is probably better to reinstall it from scratch to keep it light and avoid the clutter of tools that you don't need for the projects you will be working on.</p>
|
|
<p>Installation is very simple: follow the <a href="https://eclipse.org/downloads/eclipse-packages/?show_instructions=TRUE" class="Link--external">5 Steps to Install Eclipse</a>, and choose <strong>Eclipse IDE for C/C++ Developers</strong> at Step 3.</p>
|
|
<p>Alternatively, you can also directly <a href="http://www.eclipse.org/downloads/eclipse-packages/" class="Link--external">download Eclipse IDE for C/C++ Developers</a> (<a href="http://www.eclipse.org/downloads/packages/eclipse-ide-cc-developers/neonr" class="Link--external">direct link to current version</a>) and extract the package to the location of your choice (this creates an <code>eclipse</code> folder).</p>
|
|
<h2 id="page_First-Launch">First Launch</h2>
|
|
<p>When installation is complete, click the <kbd>Launch</kbd> button. (If you extracted the package manually, open the Eclipse installation folder and double-click the <code>eclipse</code> executable)</p>
|
|
<p>When you are prompted with the Workspace Selector, select a directory that will hold Eclipse metadata and usually your projects. <strong>Do not select the <code>qmk_firmware</code> directory</strong>, this will be the project directory. Select the parent folder instead, or another (preferably empty) folder of your choice (the default is fine if you do not use it yet).</p>
|
|
<p>Once started, click the <kbd>Workbench</kbd> button at the top right to switch to the workbench view (there is a also checkbox at the bottom to skip the welcome screen at startup).</p>
|
|
<h2 id="page_Install-the-Necessary-Plugins">Install the Necessary Plugins</h2>
|
|
<p>Note: you do not need to restart Eclipse after installing each plugin. Simply restart once all plugins are installed.</p>
|
|
<h3 id="page_The-AVR-Plugin"><a href="http://avr-eclipse.sourceforge.net/" class="Link--external">The AVR Plugin</a></h3>
|
|
<p>This is the most important plugin as it will allow Eclipse to <em>understand</em> AVR C code. Follow <a href="http://avr-eclipse.sourceforge.net/wiki/index.php/Plugin_Download#Update_Site" class="Link--external">the instructions for using the update site</a>, and agree with the security warning for unsigned content.</p>
|
|
<h3 id="page_ANSI-Escape-in-Console"><a href="https://marketplace.eclipse.org/content/ansi-escape-console" class="Link--external">ANSI Escape in Console</a></h3>
|
|
<p>This plugin is necessary to properly display the colored build output generated by the QMK makefile.</p>
|
|
<ol>
|
|
<li>Open <kbd><kbd>Help</kbd> > <kbd>Eclipse Marketplace…</kbd></kbd>
|
|
</li>
|
|
<li>Search for <em>ANSI Escape in Console</em>
|
|
</li>
|
|
<li>Click the <samp>Install</samp> button of the plugin</li>
|
|
<li>Follow the instructions and agree again with the security warning for unsigned content.</li>
|
|
</ol>
|
|
<p>Once both plugins are installed, restart Eclipse as prompted.</p>
|
|
<h1 id="page_Configure-Eclipse-for-QMK">Configure Eclipse for QMK</h1>
|
|
<h2 id="page_Importing-the-Project">Importing the Project</h2>
|
|
<ol>
|
|
<li>Click <kbd><kbd>File</kbd> > <kbd>New</kbd> > <kbd>Makefile Project with Existing Code</kbd></kbd>
|
|
</li>
|
|
<li>On the next screen:</li>
|
|
</ol>
|
|
<ul>
|
|
<li>Select the directory where you cloned the repository as <em>Existing Code Location</em>;</li>
|
|
<li>(Optional) Give a different name to the project¹, e.g. <em>QMK</em> or <em>Quantum</em>;</li>
|
|
<li>Select the <em>AVR-GCC Toolchain</em>;</li>
|
|
<li>Keep the rest as-is and click <kbd>Finish</kbd>
|
|
</li>
|
|
</ul>
|
|
<p><img src="http://i.imgur.com/oHYR1yW.png" alt="Importing QMK in Eclipse" /></p>
|
|
<ol start="3">
|
|
<li>The project will now be loaded and indexed. Its files can be browsed easily through the <em>Project Explorer</em> on the left.</li>
|
|
</ol>
|
|
<p>¹ There might be issues for importing the project with a custom name. If it does not work properly, try leaving the default project name (i.e. the name of the directory, probably <code>qmk_firmware</code>).</p>
|
|
<h2 id="page_Build-Your-Keyboard">Build Your Keyboard</h2>
|
|
<p>We will now configure a make target that cleans the project and builds the keymap of your choice.</p>
|
|
<ol>
|
|
<li>On the right side of the screen, select the <kbd>Make Target</kbd> tab</li>
|
|
<li>Expand the folder structure to the keyboard of your choice, e.g. <code>qmk_firmware/keyboards/ergodox</code>
|
|
</li>
|
|
<li>Right-click on the keyboard folder and select <kbd>New…</kbd> (or select the folder and click the <kbd>New Make Target</kbd> icon above the tree)</li>
|
|
<li>Choose a name for your build target, e.g. <em>clean <your keymap></em>
|
|
</li>
|
|
<li>Make Target: this is the arguments that you give to <code>make</code> when building from the command line. If your target name does not match these arguments, uncheck <kbd>Same as target name</kbd> and input the correct arguments, e.g. <code>clean <your keymap></code>
|
|
</li>
|
|
<li>Leave the other options checked and click <kbd>OK</kbd>. Your make target will now appear under the selected keyboard.</li>
|
|
<li>(Optional) Toggle the <kbd>Hide Empty Folders</kbd> icon button above the targets tree to only show your build target.</li>
|
|
<li>Double-click the build target you created to trigger a build.</li>
|
|
<li>Select the <kbd>Console</kbd> view at the bottom to view the running build.</li>
|
|
</ol>
|
|
</div>
|
|
|
|
<nav>
|
|
<ul class="Pager">
|
|
<li class=Pager--prev><a href="../IDEs/index.html">Previous</a></li> <li class=Pager--next><a href="../For_a_Deeper_Understanding/index.html">Next</a></li> </ul>
|
|
</nav>
|
|
</article>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<!-- JS -->
|
|
<script src="../themes/daux/js/jquery-1.11.3.min.js"></script><script src="../themes/daux/js/highlight.pack.js"></script><script src="../themes/daux/js/daux.js"></script>
|
|
<!-- Tipue Search -->
|
|
<script type="text/javascript" src="../tipuesearch/tipuesearch.js"></script>
|
|
|
|
<script>
|
|
window.onunload = function(){}; // force $(document).ready to be called on back/forward navigation in firefox
|
|
$(function() {
|
|
tipuesearch({
|
|
'base_url': '../'
|
|
});
|
|
});
|
|
</script>
|
|
|
|
</body>
|
|
</html>
|