Eclipse - PW-Sat2/PWSat2OBC GitHub Wiki

Importing project

  1. Download Eclipse C++ (http://www.eclipse.org/downloads/)
  2. Create build folder as sibling to source folder
  3. Go to build folder
  4. Run cmake -G "Eclipse CDT4 - Unix Makefiles" <path to source folder>(use Eclipse CDT4 - MinGW Makefiles on Windows)
  5. In Eclipse, select Import...,
  6. Select General -> Existing project into workspace, click Next
  7. Select root directory: build folder
  8. In Projects select PWSat2
  9. Click Finish

Now project is imported into Eclipse. Make targets are available in 'Make targets' view. 'Build project' action invokes make all. Source files are visible under [Source Directory] in Project Explorer.

GDB Hardware Debuggging

  1. Install GNU ARM C/C++ JLink Debugging from update site http://gnuarmeclipse.sourceforge.net/updates
  2. Open Debug Configurations
  3. Create new __GDB Segger JLink Debugging`
  4. In C/C++ Application select build\<platform>\bin\pwsat file
  5. On Debugger tab enter path to JLinkGDBServerCL.exe file
  6. In Device name enter EFM32GG990F1024
  7. In GDB Client Setup -> Executable enter path to arm-none-eabi-gdb from GCC toolchain

Code completion and C++

Unfortunately CMake is not able to generate proper .cproject file and C++ indexer in Eclipse thinks that code is using C++98 standard. That decision in based on __cplusplus value put in .cproject by CMake. Changing that value to 201402L will not work as project files are regenerated during build. Fortunately it is possible to instruct Eclipse to detect compiler settings (including __cplusplus by itself).

  1. Go to Window -> Preferences -> C/C++ -> Build -> Settings and go to Discovery tab
  2. Select CDT GCC Built-in Compiler Settings Cross ARM [Shared]
  3. Edit Command to get compiler specs to match: <toolchain path>\bin\arm-none-eabi-${COMMAND} ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD "${INPUTS}" -std=c++14
  4. Click OK
  5. Open project properties: Project -> Properties -> C/C++ General -> Preprocessor Include Path, Macros etc
  6. Check CDT GCC Built-in Compiler Settings Cross ARM [Shared] entry and check Use global provider shared between projects
  7. Move CDT GCC Built-in Compiler Settings Cross ARM [Shared] **above **Contributed PathEntry Containers [Shared]
  8. Close project properties by clicking OK

Solution based on StackOverflow answer: http://stackoverflow.com/a/24561615/995351

⚠️ **GitHub.com Fallback** ⚠️