Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[Keil][STM32CubeIDE] Keil integration into STM32CubeIDE

The background:
I have to use Keil in my job and honestly - I don't like it much.
The debug is great, but the editor is lacking in many features compared to other IDEs.

I was trying to find a working extension to STM32CubeIDE to integrate Keil's toolchain (build/rebuild/clean) and parse all errors/warnings/infos into STM32CubeIDE.
I couldn't find a sufficient solution, so I decided to make it by myself!
The main purpose of this blog entry is to have STM32CubeIDE project with Keil's toolchain.

The solution:
I assume that you already have STM32CubeIDE project created from Keil's project source files - if not, check out this two blog entries:
NOTE: It is assumed that Keil's compiler (UV4.exe) is in the PATH of your Windows. Otherwise you have to edit scripts and point to UV4.exe location.

Let's start with adding an error parser (i. e. RegEx patterns) to a general build settings of your version of Eclipse/STM32CubeIDE:
00.png
01.png

Copy/paste content:
Error:
(.*)\((\d*)\):\s*.rror:\s*(.*)

Warning:
(.*)\((\d*)\):\s*.arning:\s*(.*)

Info:
(.*)\((\d*)\):\s*.nfo:\s*(.*)

Socond info - Note:
(.*)\((\d*)\):\s*.ote:\s*(.*)

File:
$1

Line:
$2

Description:
$3

Now link just created error parser with your project:
02.png
03.png

So far so good - since now every error/warning/info from building log will be detected and utilised by the Eclipse IDE in a natural way.

Next step is to update build settings of your project to use Keil's toolchain:
04.png

Copy/paste content:
Build directory:
${workspace_loc:/${ProjName}}/../..

05.png

06.png

Copy/paste content:
Build:
${ConfigName}

Clean:
clean

Create a simple makefile as follows:
NOTE: "[DBG]_UC_PRODUCT_APP" and " [REL]_UC_PRODUCT_APP " are target names in my example project.
Change them accordingly to your target names.
07.png


Scripts needed for this solution are on gitlab:

Copy .vscode and Scripts folders from that repo into the root folder of your Keil's project (with Src, Inc and perhaps MDK-ARM subfolders).
Open root folder of your Keil's project by "Open with Code" context menu:
08.png


Navigate to your Keil's project file (.uvproj or .uvprojx) and open it.
Run "Run Build Task..." and choose from the list "Import settings from Keil's v4 or v5 project" - that will import includes, defines and output paths for all project's targets from opened project file.
VSCode should look like an example below:
09.png


After executing "Import settings from Keil's v4 or v5 project" task, terminal tab should look like as follows:
10.png


Get back to STM32CubeIDE and build a project. You should get similar results as follows:
11.png

12.png


From that point if you prefer VSCode, it will also work :)
NOTE: It works because I prepared ".vscode/tasks.json" in a way that it calls proper scripts and parses build log for errors/warnings/infos - check out tasks.json file if you like.
13.png

14.png

15.png


Now the STM32CubeIDE project have Keil's toolchain. You can add also a debug configuration, if you like.
For a debug configuration steps, see this blog entry (under construction).

------------------------------------------------------
Is this blog entry helpful or does it need an improvement?
Please leave the comment below.

Comments

There are no comments to display.

Part and Inventory Search

Blog entry information

Author
niciki
Views
139
Last update

More entries in Uncategorized

More entries from niciki

Top