EOOS Safe FreeRTOS
EOOS copyrights reserved in Rospatent Federal Service for Intellectual Property, Russian Federation
EOOS Safe for FreeRTOS operating system is a C++ library for cross-platform development of safety-critical software. The library is developed in C++98 programming language and supports features of C++11 programming language depending on compiler options that allows to consider wide criteria when selecting a suitable programming language on initiation step of product development.
EOOS Safe FreeRTOS is developed within ISO C++ standards, complied with MISRA C++:2008 and AUTOSAR C++14 Coding Guidelines, and relies on ISO 26262 that means applications based on EOOS can be used in critical and safety-related systems.
1. About the project
The FreeRTOS operating system has wide number of ports for wide number of MCUs. This project provides exactly one MCU port for exactly one PCB board, which is the EOOS deep elaborated approach.
- Architecture: ARMv7E-M
- Processor: Cortex-M4
- Vendor: ST STM32F429ZIT6
- Board: NUCLEO-F429ZI MB1137-F429ZI-B01
2. Prerequisites
The EOOS system can be built either on Linux, or on Windows host operating system using ARM cross-compiler. Under our Premium Commercial License, there are several projects we can provide to developers to build the system, which are:
- CMake;
- Visual Studio Code;
- Keil;
- Eclipse.
Under the free-software license, we provide only two projects to build and debug the system, which are:
- CMake;
- Visual Studio Code.
To build the project the next tools described below have to be installed on your host operating system.
2.1. On Ubuntu 22.04
The process described below is passed on
- Ubuntu 22.04.5 LTS (jammy x86_64)
Note: We recommend to build, develop and debug EOOS on the Ubuntu host operating system.
2.1.1. Download and install Git for Linux and Unix
Get Git for Ubuntu following the commands below.
$ sudo apt-get update
$ sudo apt-get install git
$ git --version
git version 2.34.1
2.1.2. Download and install CMake 3.20 or higher
Download and install CMake and check its version.
$ sudo apt-get install cmake
$ cmake --version
cmake version 3.31.6
2.1.3. Download and install Python 3.7 or higher for automation
Check your version
$ python3 --version
Python 3.10.12
2.1.4. Install ARM GCC arm-none-eabi cross-compiler v10.3.1 or higher
Install cross-compiler and check its version.
$ sudo apt install gcc-arm-none-eabi
$ /usr/bin/arm-none-eabi-gcc --version
arm-none-eabi-gcc (15:10.3-2021.07-4) 10.3.1 20210621 (release)
$ /usr/bin/arm-none-eabi-g++ --version
arm-none-eabi-g++ (15:10.3-2021.07-4) 10.3.1 20210621 (release)
2.1.5. Install debug probe
For debug and programming, you can install either ST-Link, or SEGGER J-Link software so that you are able to use the embedded ST-LINK/V2-1 debug probe or an external SEGGER J-Link probe.
2.1.5.1. Download and install STM32CubeIDE v1.19.0 or higher
Download STM32CubeIDE Debian Linux Installer and install STM32CubeIDE all-in-one development tool.
$ sudo sh ./st-stm32cubeide_1.19.0_25607_20250703_0907_amd64.deb_bundle.sh
2.1.5.2. Download and install STM32CubeProgrammer v2.20.0 or higher
Download STM32CubeProgrammer software for Linux and install STM32CubeProg all-in-one software tool and check its command-line interface.
$ ./SetupSTM32CubeProgrammer-2.20.0.linux
$ cd ~/STMicroelectronics/STM32Cube/STM32CubeProgrammer/Drivers/rules
$ sudo cp *.* /etc/udev/rules.d
$ cd ~/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin
$ ./STM32_Programmer_CLI
STM32CubeProgrammer v2.20.0
2.1.5.3. Download and install Segger J-Link/J-Trace V8.12a or higher
Download debian package and install it with checking GDB server version.
$ sudo apt install ./JLink_Linux_V812a_x86_64.deb
$ /opt/SEGGER/JLink/JLinkGDBServerCLExe --version
SEGGER J-Link GDB Server V8.12a Command Line Version
2.1.6. Install GNU GDB client v12.1 or higher
Install the GDB client, create the arm-none-eabi-gdb symbolic link on the client to use it in some IDEs, and check its version.
$ sudo apt install gdb-arm-none-eabi
$ sudo ln -s /usr/bin/gdb-multiarch /usr/bin/arm-none-eabi-gdb
$ /usr/bin/arm-none-eabi-gdb --version
GNU gdb (Ubuntu 12.1-0ubuntu1~22.04.2) 12.1
2.1.7. Install terminal Minicom v2.8 or higher
To use terminal on serial UART interface through USB port for debugging, install Minicom, delete brltty for accessing to /dev/ttyUSB0 and check version.
$ sudo apt install minicom
$ sudo apt remove -y brltty
$ minicom --version
minicom version 2.8
2.2.6. Download and install Visual Studio Code IDE
Visual Studio Code v1.96.3 or higher
Download debian package and install it with checking VSCode version.
$ sudo apt install ./code_1.96.3-1736454372_amd64.deb
$ code --version
1.96.3
2.2. On Windows
The process described below is passed on
- Windows 11 (64-bit)
2.2.1. Download and install Git for Windows
The installer automatically sets the Path system environment variable. But you have to set manually C:\Program Files\Git\binpath to the Path user environment variable to execute Bash. After the installation, check in CMD that tool is executed properly by executing the following commands.
C:\> git --version
git version 2.51.0.windows.2
2.2.2. Download and install ARM GNU Toolchain Version 14.2.Rel1 arm-none-eabi or higher
EOOS is developed within ISO C++ standards and can be compiled with any ARM cross-compilers, which support ISO/IEC 14882:1998 standard and ISO/IEC 14882:2011 standard for new features of C++ programming language.
For now, the project is developed in assembly directives and linker script of GCC GNU Toolchain. Therefore, we recommend to use the toolchain target like arm-gnu-toolchain-14.2.rel1-mingw-w64-i686-arm-none-eabi which shall to be installed to its default directory C:\Program Files (x86)\Arm GNU Toolchain arm-none-eabi\14.2 rel1
C:\Program Files (x86)\Arm GNU Toolchain arm-none-eabi\14.2 rel1\bin>arm-none-eabi-gcc.exe --version
arm-none-eabi-gcc.exe (Arm GNU Toolchain 14.2.Rel1 (Build arm-14.52)) 14.2.1 20241119
C:\Program Files (x86)\Arm GNU Toolchain arm-none-eabi\14.2 rel1\bin>arm-none-eabi-g++.exe --version
arm-none-eabi-g++.exe (Arm GNU Toolchain 14.2.Rel1 (Build arm-14.52)) 14.2.1 20241119
2.2.3. Install debug probe
For debug and programming, you can install either ST-Link, or SEGGER J-Link software so that you are able to use the embedded ST-LINK/V2-1 debug probe or an external SEGGER J-Link probe.
2.2.3.1. Download and install STM32CubeIDE v1.19.0 or higher
Install STM32CubeIDE all-in-one development tool.
2.2.3.2. Download and install STM32CubeProgrammer v2.20.0 or higher
Install STM32CubeProg all-in-one software tool and check its command-line interface.
C:\Program Files (x86)\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin> STM32_Programmer_CLI.exe
STM32CubeProgrammer v2.20.0
2.2.3.3. Download and install SEGGER J-Link/J-Trace V7.88e or higher
Install the J-Link all-in-one debugging solution and check version of GDB server.
C:\Program Files\SEGGER\JLink> JLinkGDBServerCL.exe --version
SEGGER J-Link GDB Server V7.88e Command Line Version
2.2.4. Download and install PuTTY Client
To use terminal on serial UART interface through USB port for debugging, install PuTTY Client.
2.2.5. Download and install MSYS2
Run MSYS2 MINGW64 console and install the next tools:
$ pacman -S mingw-w64-x86_64-python
$ pacman -S mingw-w64-x86_64-cmake
$ pacman -S mingw-w64-x86_64-make
2.2.6. Download and install Visual Studio Code IDE
3.3. Upgrade ST-LINK/V2-1 firmware
If you aim to program EOOS with the embedded ST-LINK/V2-1 debug probe, it would be strongly recommended to upgrade the ST-LINK/V2-1 firmware to avoid errors like:
Error: No STM32 target found! If your product embeds Debug Authentication, please perform a discovery using Debug Authentication
To do so, dowload and run the STSW-LINK007 firmware upgrade application, which upgrades the debug probe firmware to the latest version. We recomend to run the application on Windows as it is the easiest way to do. For upgrading the firmware on Ubuntu, please read readme.txt file in the application archive.
3. How-to Get Source Code
This git repository contains repositories as git submodules with source code to build a binary exacutable file for the one board. You can obtain the git repository with similar way either on Linux, or Windows, but we will give instructions in Linux style as we target developing process mostly on it.
3.1. Obtain Git repository
3.1.1. Create an empty directory somewhere on your disk
For instance we will create ~/REPOSITORY.
~$ mkdir REPOSITORY
~$ cd REPOSITORY
3.1.2. Clone this repository
For instance we will clone it to EOOS directory by SSH.
~REPOSITORY$ git clone --branch master git@gitflic.ru:eoos-systems/eoos-project-if-freertos-cm4-stm32f429zit6-nucleof429zi.git EOOS
3.1.3. Go the EOOS directory
~REPOSITORY$ cd EOOS
3.1.4. Initialize and update all submodules of the repository
~REPOSITORY/EOOS$ git submodule update --init
4. How-to Build Project
EOOS is a static library for linkage with other applications. This build can be done with several projects you prefer mentioned above. The result of the build is the EOOS static library and the test executable linked with the library that can be burnt on the target MCU flash.
4.1. Build with CMake project
EOOS can be built on various host operating systems. To standardize the building process, we put most common steps under the hood of the Make.py cross-platform script that is located in scripts/python directory. On Linux you can build it in the console, and on Windows in MSYS2 MINGW64 console. We will give instructions below for the Linux console.
4.1.1. Go to the script directory
~/REPOSITORY/EOOS$ cd scripts/python
4.1.2. Run the script
~/REPOSITORY/EOOS/scripts/python$ python3 Make.py \
--eoos FreeRTOS \
--clean \
--build ALL \
--config RelWithDebInfo \
--toolchain Toolchain.linux.cortex-m4.gcc.cmake
Note that the –config parameter can be one of Release, Debug, RelWithDebInfo, MinSizeRel, but for developing purpose we recommend to pass RelWithDebInfo.
Having done all the steps, the EOOS test exacutable will be located in build/codebase/tests/EoosTests.elf
5. How-to Setup Environment
This EOOS project is developed for fast start developing of target customer boards and is based on the evaluation kit of the target MCU.
5.1. Setup HW environment
5.1.1. Connect the board to your host PC for debug probe
You can debug with the embedded ST-LINK/V2-1 probe or an external SEGGER J-Link probe For the external SEGGER J-Link debug probe, connect the external J-Link probe to SWD connector (CN6) and to USB port of your host PC. For the embedded ST-LINK/V2-1 debug probe, follow the next step.
5.1.2. Connect the board to your host PC with UART
Connect USB cable to ST-LINK USB Micro-B connector (CN1) and to USB port of the host PC for UART interface connection, and possibale usage of the ST-LINK/V2-1 debug probe.
5.2. Setup SW environment
5.2.1. Run a terminal for serial UART connection
On Ubuntu run Minicom
$ sudo minicom --setup
Go to Serial port setup, set the settings:
A - Serial Device : /dev/ttyACM0
B - Lockfile Location : /var/lock
C - Callin Program :
D - Callout Program :
E - Bps/Par/Bits : 115200 8N1
F - Hardware Flow Control : No
G - Software Flow Control : No
H - RS485 Enable : No
I - RS485 Rts On Send : No
J - RS485 Rts After Send : No
K - RS485 Rx During Tx : No
L - RS485 Terminate Bus : No
M - RS485 Delay Rts Before: 0
N - RS485 Delay Rts After : 0
and Exit to the terminal.
On Windows run PyTTY
Check COM port number for this press Windows + R keyboard shortcut to launch the Windows Run box, type devmgmt.msc and click the OK button. The Device Manager window appears, go to ports (COM and LPT) and check your COM port number for a USB Serial Device (COMx) where COMx is port number you need.
Run PyTTY, go Session and check Serial. Go to Connection -> Serial and enter the configuration:
- Serial line to connction to: COM port you got in Device Manager
- Speed (baud): 115200
- Data bits: 8
- Stop bits: 1
- Parity: None
- Flow control: None
Press Open button to run the PyTTY terminal.
6. How-to Run Program
The EOOS built executable file can be burnt and run either on Ubuntu, or on Windows. We will give instructions how to do this on Ubuntu host operating system, but through the same steps you can pass on Windows as well.
6.1. Run two consoles
6.1.1. Run J-Link GDB Server in separate consol
$ /opt/SEGGER/JLink/JLinkGDBServerCLExe \
-if swd \
-device STM32F429ZI \
-endian little \
-speed 1000 \
-port 2331 \
-swoport 2332 \
-telnetport 2333 \
-vd \
-ir \
-localhostonly 1 \
-singlerun \
-strict \
-timeout 0 \
-nogui
6.1.2. Run GNU GDB Client in separate consol
$ /usr/bin/arm-none-eabi-gdb
(gdb)
6.2. Run the program in GDB consoles
6.2.1. Load ELF file
(gdb) file ~/REPOSITORY/EOOS/build/codebase/tests/EoosTests.elf
6.2.2. Connect to the GDB server
(gdb) target remote localhost:2331
6.2.3. Reset MCU
(gdb) monitor reset
6.2.4. Load ELF file
(gdb) load
6.2.5. Set breakpoint on the main() funtion
(gdb) break main
6.2.5. Run the program to the breakpoint
(gdb) continue
6.2.5. Continue the program execution
(gdb) continue
Press Ctrl+C to stop execution
6.3. Check the project run
In the terminal for serial UART connection check the output of the program.
[EOOS PJT] ~~~ eoos start ~~~~~~~~~~~~~~~~~
[EOOS PJT] WELCOME TO EOOS FreeRTOS TESTS
[EOOS PJT] LANGUAGE: C++11
[EOOS PJT] DATA MODEL: C++ Standard Library types
[EOOS PJT] DISABLE: Dynamic heap memory allocation
[EOOS SYS] MEMORY STACK: Stack size of a task is 1024 Bytes
[EOOS SYS] MEMORY MODE: Mutex in pool memory of 5
[EOOS SYS] MEMORY MODE: Semaphore in pool memory of 5
[EOOS SYS] MEMORY MODE: Thread in pool memory of 5
[EOOS HAL] MEMORY MODE: Trap in pool memory of 2
[EOOS DRV] MEMORY MODE: GPIO driver in pool memory of 5
[EOOS DRV] MEMORY MODE: NVIC driver in pool memory of 3
[EOOS DRV] MEMORY MODE: USART driver in pool memory of 1
[EOOS PJT] SYSTEM: Size of system is 7424 Bytes
And check that User LEDs (LD1, LD2, LD3) are blinking.
7. How-to Debug Program
7.1. Debug with Visual Studio Code
VSCode is IDE that allows to debug the CMake built EOOS program. For the reason you need to install the next plugins:
7.1.1. Build the project
Build the CMake project with Debug configuration
~/REPOSITORY/EOOS/scripts/python$ python3 Make.py \
--eoos FreeRTOS \
--clean \
--build ALL \
--config Debug \
--toolchain Toolchain.linux.cortex-m4.gcc.cmake
Having done the step, the EOOS test exacutable will be located in build/codebase/tests/EoosTests.elf
7.1.2. Debug the project
Run VSCode and do the next steps:
- Open projetc folder ~/REPOSITORY/EOOS: File > Open Folder…
- Go to Run and Debug and click Create a launch.json file
- Select the Cortex Debug debugger in the drop-down list
- Copy a json file content from ~/REPOSITORY/EOOS/ide/eoos-exe-tests-vscode directory to the created launch.json file
After the steps done, press the ST-Link EOOS Debug, or J-Link EOOS Debug button depending on debugger you use, so that VSCode loads the elf file to MCU flash memory and runs the EOOS to the main function. You can debug the program.
To get more details on it, see official documentation how to setup J-Link Visual Studio Code.
Описание
EOOS Project for FreeRTOS on Cortex-M4 STM32F429ZIT6 NUCLEO-F429ZI