Eclipse for microcontrollers (STM32) + FreeRTOS Task Aware Debugger

  • Tutorial
image


This article will describe how to install eclipse for microcontrollers + FreeRTOS Task Aware Debugger.

For example, Windows OS, CubeMX, and the STM32L4Discovery board.

Installation


Install:

Eclipse IDE for C / C ++ Developers
Download eclipse , unpack, copy to C: / eclipse
chocolatey
Chocolatey - a package manager for Windows, an analog of apt-get, allows you to install programs through the console.
Open PowerShell.exe as administrator and execute:
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
Jdk
Without JDK, eclipse and CubeMX will not start.
Open PowerShell.exe as administrator and execute:

cinst -y jdk8
Node.js
Node.js contains the npm package manager needed to install xpm.
Open PowerShell.exe as administrator and execute:

cinst -y nodejs
xpm
Xpm - xPack package manager, allows you to quickly install the necessary utilities for eclipse with three lines on the command line.
Restart PowerShell.exe as administrator and execute:

npm install --global xpm
Arm compiler, build system and debugger
Restart PowerShell.exe as administrator and execute:

xpm install --global @gnu-mcu-eclipse/arm-none-eabi-gcc
xpm install --global @gnu-mcu-eclipse/windows-build-tools
xpm install --global @gnu-mcu-eclipse/openocd
GNU MCU Plugin:
Launch eclipse, Help -> Eclipse marketplace ...

Enter "GNU MCU" in the search box.

Click Install.

We leave everything as it is, click further, further, further. Eclipse will restart.image
Mcu pack
Go to Packs, click Refresh. image
We choose the Pack installation depending on your microcontroller: image
After that, we go to the kitchen to put a kettle, the update process is not fast.
image
When the error comes out, click Ignore All:image
Cubemx
Follow the link , download and install
ST-Link
Follow the link , download and install
J link software
Follow the link , download and install


Flashing ST-Link to J-Link
Follow the link , download and install.
Run STLinkReflash.exe, accept the agreement, select [1] - Upgrade to J-Link.
At any time, you can return ST-Link back by selecting [3] - Restore ST-Link.image
We erase the memory on the microcontroller
Open the J-flash lite in the launch, click OK. image
Select your microcontroller and click Erase.image

Project creation


In the project folder, create 2 projects:
C:\projects\armtest_cube
C:\projects\armtest

Create a project in CubeMX
We go into CubeMX, create a new project.
We include FreeRTOS in the project, switch USE_TRACE_FACILITY -> ENABLED
image
RECORD_STACK_HIGH_ADDRESS -> Enable
image
SYS -> Timebase Source, select any unnecessary timer, for example TIM7
image
Turn on additional functions as needed.
Click Generate Code.
image
Create a project in Eclipse
Go to Eclipse -> New -> Project ...
Select C Project. We set the
image
name of the project and its location, select the type of project.
image
The most important thing is to indicate the correct kernel, depending on your type of microcontroller (see datasheet). The rest of the settings are not important.
image
Click next, next.
If the toolchain is not detected automatically, then indicate its location.
Click Finish.
image
Delete everything from the project tree:
image
Go to the project folder armtest_cube and copy everything except .project and .cproject to the project folder armtest. We update the
image
project tree:
image
Go to the project settings Project -> Properties, select the necessary microcontroller.image
We go into the linker settings, delete all the available Script files and add the ld file from the project tree.
image
We connect the library with support for Floating Point:
image
Select the format of the Motorola S-record output file.
image
Add includ:
image
Add defin for the preprocessor:
image
Rename the startup file “startup_stm32l476xx.s” to “startup_stm32l476xx.S”. Otherwise, errors appear in debug. image
Run -> Debug configurationsimage
Install FreeRTOS debugger plugin
Help -> Install new Software ...
http://freescale.com/lgfiles/updates/Eclipse/KDS
image

Total


Turn on Debug, in the new FreeRTOS menu select Task List + Heap Usage.

image

We get a visual display of the load of Heap & Stack and other buns:

image

Also popular now: