How to configure IDE eclipse

Eclipse Development Environment Settings

You can download the Eclipse IDE from the official web-site.

Getting Ready

Tutorial video

Instructions

For proper functionality of Eclipse perform the following steps:

  1. Go to: SEGGER - The Embedded Experts - Downloads - J-Link / J-Trace.
  2. Roll-down the “J-Link Software and Documentation Pack” item and download version for your OS.
  3. Run the installation file and complete the installation by following the on-screen instructions.
  4. Go to: https://java.com/ru/download/ and download the latest version for your OS.
  5. Run the installation file and complete the installation by following the on-screen instructions.
  6. Go to: https://www.oracle.com/technetwork/java/javase/downloads/jdk12-downloads-5295953.html and download the latest version for your OS.
  7. Run the installation file and complete the installation by following the on-screen instructions.
  8. Go to: Node.js and download the latest version for your OS.
  9. Run the installation file and complete the installation by following the on-screen instructions.
  10. Run PowerShell.exe using administrative rights.
  11. Execute the following command:
    npm install --global xpm
  12. Re-launch PowerShell.exe using administrative rights and execute the following commands:
    xpm install --global @gnu-mcu-eclipse/arm-none-eabi-gcc
    xpm install --global @gnu-mcu-eclipse/windows-build-tools

If script running is disabled on your OS, execute the following command:
Set-ExecutionPolicy RemoteSigned

  1. Run Eclipse.
  2. Go to “Help → Eclipse marketplace…”.
  3. Enter “GNU MCU” into the search line.
  4. Click “Install” next to GNU MCU Eclipse.

  1. Do not change any installation options, just click “Next” up to the end.
  2. Eclipse will be re-started.
  3. Open “Packs” (“Window” → “Perspective” → “Open Perspective” → “Other…” → “Packs”) and click “Refresh”.

19_prep

  1. If there is an error message, click “Ignore All”.

20_prep

  1. Select the required pack for your MCU and install it.

  1. Before compiling a project, manually specify a path to the make-file in the “Build command” field (see the figure below). As a general rule, the path is the following: C:\Users\<User Name>\AppData\Roaming\xPacks\@gnu-mcu-eclipse\windows-build-tools\2.12.1-1\.content\bin\make.exe unless manually changed.

Configuring

Tutorial video

Instructions

  1. Select a project, select “Debug As->Debug Configurations” on the menu list or on the toolbar (see Figure 1А and Figure. 1B).

The project has to be compiled successfully at least once.


1B

  1. Right-click “GDB Segger J-Link Debugging” on the configuration tree and select "New Configuration" on the context menu (see Figure 2).

If necessary, configuration name can be changed right away, but in this example we will leave it as it is.
3. If the project was not compiled successfully at least once, the "C/C++ Application" field will be left blank (in Figure 3 all fields are filled in correctly). In this case close configuration window, compile the project, then open configuration window again and run the file by clicking “Search Project”.

  1. Make sure filepath in the “Actual Executable” field at the “Debugger” tab is correct. If it is incorrect, then GDB-server was installed wrong (see Getting Ready). A correct filepath is shown in Figure 4.

  1. Specify device name in the corresponding field. Switch the “Connection” radio-button to "IP", specify IP-address and port for the current session as follows: IP:Port (see Figure 5). Make sure the “Interface” radio-button is at "SWD". Device name, IP-address and port are shown on the Connection and Tools page.

While using port forwarding, use localhost as the IP-address and serv_port as Port. serv_port is shown on the Connection and Tools page.

5

  1. Scroll down the settings list. If the value in the "Actual Executable" field in "GDB Client Setup" group seems incorrect (see Figure 6), specify file path for arm-none-eagbi-gdb in the “Executable name” field. As a general rule, the path is the following: C:\Users\<User Name>\AppData\Roaming\xPacks\@gnu-mcu-eclipse\arm-none-eabi-gcc\8.2.1-1.7.1\.content\bin\arm-none-eabi-gdb.exe unless manually changed.

6

  1. Click “Debug”.

This configuration can be used more than once. Just select it as the target one during debugging.

If J-Link GDB Server timed out while starting:

  1. Run Cmd.exe and execute the following commands:
    cd «JLink_Path», where «JLink_Path» is a path to JLinkGDBServerCL.exe
    JLinkGDBServerCL.exe -select IP=«IP»:«Port» -device «device_name» -endian little -if SWD -speed 4000 -noir -LocalhostOnly, where «IP», «Port» and «device_name» are from the Connection and Tools page.

While using port forwarding, use localhost as the IP-address and <serv_port> as Port. serv_port is shown on the Connection and Tools page.

  1. Open “Debug Configurations” window for the created configuration.
  2. Uncheck “Start the J-Link GDB server locally” at the “Debugger” tab.
    _10
  3. Click “Debug”.