Menu

Build environment setup

ravaz

Build environment setup

Follow those instruction to setup an environment used to build, debug and run the firmware and software present in the embKernel package.

Install the environment

  1. Optionally download and install the RapidEE tool from http://www.rapidee.com/en/about to ease you setting the PATH value.
  2. Download and install the gcc-arm-none-eabi from https://launchpad.net/gcc-arm-embedded/+download. Ensure the bin folder "gcc_arm_embedded_install_folder/bin" is in the PATH.
  3. Download and install the yagarto tools from http://www.emb4fun.de/archive/gabmt/index.html. Ensure the bin folder "yagarto_tools_install_folder/bin" is in the PATH.
  4. Download *openocd from http://www.freddiechopin.info/en/download/category/10-openocd-dev and extract it in a folder of your choice.
  5. Download libusb-win32-bin from https://sourceforge.net/projects/libusb-win32/files/ and extract it in a folder of your choice. This package is require to install the libusb device filter to the discovery boards in order to use them with openocd.
  6. If not done yet download and install JAVA from http://java.com/en/download/index.jsp.
  7. Download Eclipse classic from http://www.eclipse.org/downloads/ and extract it in a folder of your choice. Eclipse doesn't require to be installed, to run it launch the eclipse.exe file inside the extracted directory.
  8. Run eclipse.
  9. Click on the Help->Install new software menu and install the following items:
    • Programming Languages->C/C++ Development Tools
    • Mobile and Device Development->C/C++ GDB Hardware Debugging
  10. Install the GNU ARM Eclipse Plug-in following the instruction on http://gnuarmeclipse.livius.net/blog/downloads/.

Download the source code using git

  1. Restart eclipse and select the *Window->Open Perspective->Other..." menu.
  2. From the appearing dialog select the Git as shown below.
  3. On the left panel click on "Clone a Git repository" and on the appearing dialog insert "git://git.code.sf.net/p/embkernel/git" as URI as shown below and then click next->next->finish.
  4. Right click on repository and from the context menu select "Import projects" as shown below and then on the opening dialog click on next->finish.

Compile C++ code

  1. Select the *Window->Open Perspective->Other..." menu.
  2. From the appearing dialog select the C/C++ perspective as shown below.
  3. Select the embKernel project and then click on the small arrow on the right side of the small hammer icon on the toolbar as shown below.
  4. Click the build configuration that suits your hardware and wait for the build process to complete. If everything works as expected you should see the following text on the console.

Debug the firmware

  1. Click on the small arrow on the right of the external tool icon and click on the External Tools Configuration menu as shown below.
  2. On the appearing dialog create a new program launch configuration and fill the fields as shown below (your openocd may be different).
  3. Connect the discovery board USB st-link port to the PC. If not done yet install the libusb-win32 device filter using the install-filter-win.exe tool present in the libusb-win32-bin package. Select the board and click install as shown below.
  4. Click run. If everything works as expected you should see the following message in the console window.
  5. Leave the openocd running as this will serve the gdb server required for debugging.
  6. Click on the small arrow on the right of the bug icon and select Debug Configurations... from the menu as shown below.
  7. On the appearing dialog create a new GDB hardware debugging configuration and fill the fields as shown on the images below.


  8. Click on the Debug button. It everythink works as expected the prospective will change to Debug and on the to left panel you should see something similar to the image below.
  9. Control the execution of the program using the debug controls shown below. Refer to the eclipse documentation for more information about debugging.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.