Skip to main content
nikolacabrilo
Associate
January 13, 2019
Question

Importing STM32CubeMX to Eclipse

  • January 13, 2019
  • 10 replies
  • 4801 views

Hello,

I am new to STM32 and trying to learn it by migrating from 8 bit PIC. I have started by setting Eclipse environment and created some simple programs. Now I want to use STM32CubeMX but i have problems. I use STM32CubeMX version 5.0.1, and Eclipse 4.9.0. I tried to import it manually following instructions from one book I got, but CubeMX doesn't make and files under Drivers\CMSIS\Device\ST\STM32F4xx\Source\Templates\ and in every instruction it says that it should.

Than I tried this tool from github https://github.com/cnoviello/CubeMXImporter . When I use this tool and try to build project in Eclipse a lot of error occurs. If I fix one, new one pops up. Initial error is HAL_TICK_FREQ_DEFAUL undeclared here (not in a function). Problem I can see here, that I can't follow as instructed is that I don't have option Vendor CMSIS name when creating project in Eclipse (I don't know why).

I also try importing project direct in eclipse (file -> import) but than no MCU is selected and it wont compile the project.

Do you have any solution for any of those methods, how to import project from CubeMX to Eclipse?

This topic has been closed for replies.

10 replies

Tesla DeLorean
Guru
January 13, 2019

Can't CubeMX generate a .GPDSC file which you can import?

Sorry not using CubeMX, and I do GNU/GCC stuff with makefiles, and the rest with Keil, that "just works" without a lot of faffing about.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
nikolacabrilo
Associate
January 13, 2019

I couldn't find any way, it can generate all needed .c, .h and .s files, but when I try to import them I finish with a lot of errors.

Most of all, I want to use CubeMX to adjust clocks for whole chip, and some parameters also for clock.

chanakalin
Visitor II
January 14, 2019

Hi,

In "Project Manager" tab of STM32CubeMX choose "Makefile" as Toolchain/IDE.

Then generate the code.

For eclipse make sure GNU ARM Eclipse toolchain installed (refer https://gnu-mcu-eclipse.github.io/toolchain/arm/install/).

In eclipse File -> Import -> C/C++ -> Exsisting code as Makefile project -> Next -> and select,

your STM32CubeMX generated code as Exsiting code location and "ARM Cross GCC" ,

Then Finish :D

For your clock configurations you can use STM32CubeMX clock configurations tab.

MTuri.1
Visitor II
August 6, 2021

Hello,

I followed your instructions on how to import STM32CubeMX project into the Eclispe and run into the following problem:

/*

15:07:15 **** Build of configuration Default for project Nucleo-L073RZ_test ****

 all 

Cannot run program "": Launching failed

Error: Program "" not found in PATH

PATH=[C:\Users\..\AppData\Roaming\xPacks\@xpack-dev-tools\windows-build-tools\4.2.1-2.1\.content\bin; ... etc.]

15:07:15 Build Failed. 1 errors, 0 warnings. (took 81ms)

*/

Does anybody have any advice to solve this?

Pavel A.
August 6, 2021

@Matěj Turinský​  Three years passed, and welcome to CubeIDE! It will import your CubeMX .ioc file easily. It will import a makefile project as well.

JorgeNCanadea
Visitor II
December 26, 2021

Hi Nikola, i have the same problem when i use book lessons, the templates folder is empty, how did you solve it? please help me.