|
|
### **1. Install GNU MCU Eclipse plugin**
|
|
|
Open Eclipse, go to **Help->Install new software**.
|
|
|
In _Work with_ put `http://gnu-mcu-eclipse.netlify.com/v4-neon-updates/` and press enter.
|
|
|
In the list below, check only **`GNU MCU C/C++ ARM Cross Compiler`** and **`GNU MCU C/C++ OpenOCD Debugging`**, then follow the steps to finalize the installation.
|
|
|
### **1. Install the required plugins**
|
|
|
* **GNU MCU Ecplise**
|
|
|
Open Eclipse, go to **Help->Eclipse Marketplace**.
|
|
|
In _Find_ search for `GNU MCU Eclipse` and click install.
|
|
|
In the feature list make sure you checked **`GNU MCU C/C++ ARM Cross Compiler`** and **`GNU MCU C/C++ OpenOCD Debugging`**, then follow the steps to finalize the installation. No other features are required.
|
|
|
|
|
|
* **CppStyle**
|
|
|
This extensions lets you run clang-format every time you save a file. Follow the same steps as the point above to install it.
|
|
|
|
|
|
### **2. Importing skyward-boardcore**
|
|
|
After you cloned the skyward-boardcore repo on your system, in Eclipse go to **File->New->Makefile project with existing code**. Select the root directory of the skyward-boardcore repo, and choose **`ARM Cross GCC`** as the `Toolchain for Indexer Settings`
|
... | ... | @@ -10,21 +13,42 @@ After you cloned the skyward-boardcore repo on your system, in Eclipse go to **F |
|
|
### **3. Setting up the Indexer**
|
|
|
We now need to setup the Indexer for code completion / error detection to work correctly.
|
|
|
Go to **Project->Properties** and follow the instructions for each of the following sections, make sure you apply the settings after each section:
|
|
|
* **C/C++ Build->Settings:**
|
|
|
Prefix: `arm-miosix-eabi-`
|
|
|
_Toolchain Path:_ Click on "project" right below the text box and add `/opt/arm-miosix-eabi/bin` to _"Toolchain Folder"_
|
|
|
* **C/C++ Build:**
|
|
|
Uncheck `Use default build command`.
|
|
|
In `Build command` write, depending on your OS:
|
|
|
* Windows
|
|
|
`py "${workspace_loc:/skyward-boardcore}\sbs"`
|
|
|
* Linux
|
|
|
`${workspace_loc:/skyward-boardcore}/sbs`
|
|
|
|
|
|
* **C/C++ General->Indexer:**
|
|
|
Check **_"Enable project specific settings"_**
|
|
|
Uncheck **_"Index source files not included in the build"_** and **_"Allow euristic resolution of includes"_**
|
|
|
Check **_"Use active build configuration"_**. There appears to be a bug in eclipse that will switch back to _"Use a fixed build configuration"_ after you close the program. If you prefer, you can select your build configuration here and leave the check on _"Use a fixed build configuration"_.
|
|
|
Check `Enable project specific settings`
|
|
|
Uncheck
|
|
|
* `Index source files not included in the build`
|
|
|
* `Allow euristic resolution of includes`
|
|
|
* `Index unused headers as C/C++ files`
|
|
|
|
|
|
Finally, check `Use active build configuration`.
|
|
|
There appears to be a bug in eclipse that will switch back to `Use a fixed build configuration` after you close the program. If you prefer, you can select your build configuration here and leave the check on `Use a fixed build configuration`.
|
|
|
|
|
|
### **4. Adding board specific build configurations**
|
|
|
_(Currently supported boards are STM32F429zi discovery and Skyward Stormtrooper Master)_
|
|
|
First, download the file for your desired board from [HERE](https://drive.google.com/open?id=1Jq4VUUA5OcZfbJRDmoJTISem0f8qh30k)
|
|
|
_(Currently supported boards are stm32f429zi_stm32f4discovery and stm32f429zi_skyward_homeone)_
|
|
|
First, download the file for your desired board and OS from [HERE](https://drive.google.com/open?id=1Jq4VUUA5OcZfbJRDmoJTISem0f8qh30k)
|
|
|
In the project properties, click on the **C/C++ Build** section and then on **Manage Configurations...**.
|
|
|
Create a new configurations for your board (eg. "Discovery") making sure you selected **"Copy settings from... Existing configuration->Default"**
|
|
|
Press **Set Active** and apply the settings, then go to **File->Import->C/C++->C/C++ Project settings**. Select the configuration file for the board you want (eg. "SKW_TRP_Master.xml"), your project and the corresponding configuration.
|
|
|
After that, rebuild the index using **Project->C/C++ index->Rebuild**, and you're done!
|
|
|
Create a new configurations for your board (eg. "stm32f429zi_skyward_homeone") making sure you selected **"Copy settings from... Existing configuration->Default"**
|
|
|
Press **Set Active** and apply the settings, then go to **File->Import->C/C++->C/C++ Project settings**. Select the configuration file for the board you want (eg. "stm32f429zi_stm32f4discovery.xml"), your project and the corresponding configuration.
|
|
|
|
|
|
Finally, we have to add filters to prevent the indexer to index files from other boards:
|
|
|
Go to **C/C++ General->Paths and Symbols->Source Location** select the `/skyward-boardcore` folder and click `Edit Fitler...` and then `Add multiple` on the next window.
|
|
|
You now have to select every folder under `libs/miosix-kernel/miosix/arch/` and `libs/miosix-kernel/miosix/config/arch/` that is not related to the board you are targeting. For example, if you are targeting the _stm32f429zi_skyward_homeone_ board, you should select:
|
|
|
* *Every* folder under `libs/miosix-kernel/miosix/arch/` **but** `common` (these files are common for each board) and `cortexM4_stm32f4` (the MCU architecture of our board)
|
|
|
* *Every* folder under `libs/miosix-kernel/miosix/arch/cortexM4_stm32f4/` **but** `common` and `stm32f429zi_skyward_homeone` (our board!)
|
|
|
* *Every* folder under `libs/miosix-kernel/miosix/config/arch/` **but** `cortexM4_stm32f4` (the MCU architecture of our board)
|
|
|
* *Every* folder under `libs/miosix-kernel/miosix/config/arch/cortexM4_stm32f4/` **but** `stm32f429zi_skyward_homeone` (our board!)
|
|
|
|
|
|
|
|
|
After that, rebuild the index using **Project->C/C++ index->Rebuild** and you should be good to go!
|
|
|
|
|
|
|
|
|
### **Creating settings for a new board**
|
|
|
(WIP)
|
... | ... | |