2.2. Development environment setup

2.2.1. Introduction

This page will guide you in order to setup the complete required environment so you can test and use EGOS at your side.

If you consider yourself as a "User" and not a "Contributor", then you can stop after the first chapter Mandatory tools.

But if you want to contribute to EGOS, please setup every tool listed on this page.

2.2.2. Mandatory tools

2.2.2.1. Eclipse IDE Workspace setup

EGOS is provided with predefined configuration files for Eclipse CDT (current version used internally is 2020.06)

However, nothing prevents you from using Notepad++ or any other text editor like SublimeText. The advantage of using Eclipse IDE is that the project is maintained by eRTOSgener, so you are sure to use a ready-to-work IDE, which is linked to the build system so that you can develop and compile within one tool.

Furthermore, Eclipse is fully compatible with a 100% free debugging setup based on SEGGER J-Link and GDB. See the chapter Debugger below for more details about how to configure it.

An Eclipse project is provided within EGOS_Project repository. There is a dedicated project depending on if you are a contributor or a user.

Before going any further, you need to download and install Eclipse C/C++ IDE Package (including Java JRE) from this page: https://www.eclipse.org/downloads/.

You can follow the detailed steps to setup Eclipse here, after reading the following important notes:

  • Make sure to select "Eclipse IDE for C/C++ Developers".
  • Select a path without space in the naming to avoid any upcoming issue when working with Eclipse

We recommend to use the CDT version 2020.09 as this is the version we used but using any most recent version should also work fine.

2.2.2.2. Build System

The build system is based on GNU make version 4.2.1 or greater. It is platform independent (Windows or Linux (probably MacOS too but not tested yet)) and all required tools are provided depending on the OS you run, including GNU make tool itself.

So all you need is a shell (CMD on Windows or Bash on Linux). It can also work with Cygwin. However, it doesn't work with "Ubuntu for Windows 10" because of the usage of Linux system files (dedicated GCC version for Linux is provided in the repository) on a Windows system file.

The usage of the build system is explained in the chapter Developing and Building EGOS

2.2.2.3. Compiler

The only supported compiler for EGOS is The GNU Arm Embedded Toolchain) provided by ARM. There is no need to setup GCC since the executable are included in the repositories of the project, under EGOS_Tools/CPP/ARM/GNU directory.

Please note that every path used in the build system are designed for the case where EGOS_Tools repository is cloned as sub-module under EGOS_Project main repository, or downloaded as .zip file without any changes. Please take care that this is really the case at your side before investigating any error.

2.2.2.4. Debugger

2.2.2.4.1. Introduction

Eclipse provides support for various debugging tools, such as SEGGER J-Link GDB Server and OpenOCD (both are free of charge). These add-ons allow on board debugging, like watching memory and registers, setting up breaking points during run time and more.

J-Link GDB Server was the preferred choice for this project for multiple reasons: historical reasons, as we use other SEGGER products for development, and practical reasons because in order to use the on-board debugger of the ST Nucleo board, SEGGER software is required to update its firmware. Nevertheless, OpenOCD should also work fine.

2.2.2.4.1.1. Setup

Here are the following steps to set up debugging with Eclipse :

Now you are ready to work with EGOS. You can download the source files using your eRTOSgener's GitLab account and downloading the release as a .zip file.

2.2.3. Tools for Contributors

If you intend to contribute to EGOS, it is better to use Git to clone your EGOS release so that you will be able to create Merge Requests so your contributions can be merged into the main branch of EGOS.

2.2.3.1. Git

2.2.3.1.1. Generalities

In order to fully enjoy your GitLab instance, you need to work with Git version system: https://git-scm.com/. If you are not familiar with it, please take some time to get used to it in order to ease your hands-on GitLab.

Here are some other interesting links to read about Git:

If you intend to use Git and GitLab within your company, please make sure you have access to the port 22 of gitlab.ertosgener.com so that you can connect via SSH (https://www.openssh.com/). This is mandatory to be able to clone/fetch/push your source code using Git.

2.2.3.2. Setup

In order to setup Git, please download the latest version available on the official website, depending on the OS installed on your computer: https://git-scm.com/downloads

During the setup on Windows, please take care of the following:

  • When being asked about Adjusting your PATH environment: Either select one of the first 2 options:
  • Use Git from Git Bash only, or
  • Use Git from the Windows Command Prompt

The 3rd option is not recommended.

  • When being asked about Configuring the line ending conversion, please select: "Checkout as-is, commit Unix-style line endings"
  • Select MinTTY as default terminal emulator

If you want, you can also install a Graphical User Interface (GUI) in order to be able to use Git graphically. Git officially supports various GUI, which are listed here: https://git-scm.com/downloads/guis For beginners, using TortoiseGit can help, you will find a setup guide in the following chapter. In case you were familiar with SVN, using TortoiseGit can help but can also be confusing since Git and SVN philosophies are quite different.

2.2.3.2.1. TortoiseGit for Windows

  1. First you need to download the appropriate version from the official website: https://tortoisegit.org/download/
  2. Run the installer TortoiseGit-2.x.0.0-64bit.msi (last version available is 2.9.0.0): tortoise-setup-welcome-screen

  3. Keep the default settings proposed in the following window: tortoise-setup-custom

  4. On the next screen, click on the install button to start the setup of TortoiseGit

  5. You will probably be asked to close a list of running applications, you can choose between closing them or having to restart your computer at the end of the setup. tortoise-setup-files-in-use

  6. At the end of the setup, you will be asked to see the Changelog and / or to run the first start wizard. Please select the Run first start wizard: tortoise-setup-complete

  7. The wizard looks like the following. You can click on Next/Suivant or download a language package if needed: tortoise-wizard-welcome

  8. Then you need to make sure that the Git bin location is correct: tortoise-wizard-git

  9. Then you can adapt your user information

  10. The main part of this wizard is about the authentication and credentials management: Git has its own credential manager, however by default you will have to enter your credentials each time you use Git, which can be boring, although this is also very secure Tortoise propose various ways to handle these credentials, which does not overwrite Gits one, but complement it, depending on which tool you use. Its up to you to decide how to proceed here, but for beginners, we would recommend the default settings, meaning using PuTTY authentication agent. You can decide to generate the SSH key with PuTTY now or later on since there is a detailed description below in the chapter Link Git with GitLab. tortoise-wizard-authentication

  11. Then youre done!

  12. You can refer to the official documentation for more information about the usage of TortoiseGit: https://tortoisegit.org/docs/tortoisegit/

2.2.4. Using the STM32 NUCLEO Demo Board

STM provides various type of "NUCLEO" Eval Boards, including the NUCLEO_L476RG that includes the STM32L476RG C with 1Mb of Flash and 128Kb of RAM. This eval board is fully supported by EGOS but some manipulations are required to be able to use it fully.

NOTE: If you purchased EGOS EvalKit from ERTOSGENER or from Yadom, you don't need to do the following modifications as they have already been done (including the conversion from ST-Link to J-Link).

2.2.4.1. Solder bridges

By default, the solder bridge configuration of the Nucleo board doesn't allow to use the UART port on the Arduino CN9 connector. This is specified in the [Nucleo STM32 Nucleo-64 boards User Manual UM1724)

image

In case you intend to use the UART port with TX/RX PIN of CN9 connector, you need to:

  • Remove the resistor SB13 and SB14
  • Put these resistors to SB62 and SB63