📜 ⬆️ ⬇️

Eclipse for microcontrollers (STM32) + FreeRTOS Task Aware Debugger

image


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

On the example of Windows OS, CubeMX and STM32L4Discovery boards.

Installation


Install:
')
Eclipse IDE for C / C ++ Developers
Download eclipse , unpack, copy to C: / eclipse
chocolatey
Chocolatey - batch manager for Windows, similar to apk 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, which is required to install xpm.
Open PowerShell.exe as administrator and execute:

 cinst -y nodejs 
xpm
Xpm is the xPack package manager that 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:
Run eclipse, Help -> Eclipse marketplace ...

Enter "GNU MCU" in the search box.

Click Install.

We leave everything as it is, click on further, further, further. Eclipse will restart. image
MCU Pack
Go to the Packs, click Refresh. image
Choose the Pack installation depending on your microcontroller: image
After that we go to the kitchen to put the 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


Reflash ST-Link to J-Link
Follow the link , download and install.
We launch STLinkReflash.exe, accept agreements, select [1] - Upgrade to J-Link.
At any time, you can return ST-Link back by selecting [3] - Restore ST-Link. image
We erase memory on the microcontroller
Open in the launch of J-flash lite, click OK image
Choose 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
Go to CubeMX, create a new project.
We include FreeRTOS in the project, we switch USE_TRACE_FACILITY -> ENABLED
image
RECORD_STACK_HIGH_ADDRESS -> Enable
image
SYS -> Timebase Source select any unnecessary timer, for example TIM7
image
We include additional features as needed.
Click Generate Code.
image
Create a project in Eclipse
Go to Eclipse -> New -> Project ...
Choose C Project
image
We set the name of the project and its location, choose the type of project.
image
The most important thing is to specify the core correctly, depending on your type of microcontroller (see datasheet). The remaining settings are not important.
image
Click next, next.
If the toolchain is not determined automatically, then we specify its location.
Click Finish.
image
Remove 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.
image
We update the project tree:
image
Go to the project settings Project -> Properties, select the desired microcontroller. image
Go to the linker settings, delete all existing Script files and add the ld file from the project tree.
image
Connecting the library with support for Floating Point:
image
Select the format of the output file Motorola S-record
image
Add includ's:
image
We add defin'y for a preprocessor:
image
Rename the startup file “startup_stm32l476xx.s” to “startup_stm32l476xx.S”. Otherwise, errors appear in the debug. image
Run -> Debug configurations image
Install FreeRTOS debugger plugin
Help -> Install new Software ...
 http://freescale.com/lgfiles/updates/Eclipse/KDS 
image

Total


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

image

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

image

Source: https://habr.com/ru/post/441810/


All Articles