cancel
Showing results for 
Search instead for 
Did you mean: 

Import from Keil MDK into STMCubeIDE

BRodr.3
Associate III

Hello,

I have been trying to import an already-existing project into CubeIDE. This project was created on Keil MDK. So, when I import the project, CubeIDE does not recognize the drivers for the board I am program, nor the source files. How can I use the project on CubeIDE?

Any insight is appreciated

Thank you.

27 REPLIES 27
Cartu38 OpenDev
Lead II

Is your Keil project based on STM32CubeMX (.ioc file) ?

BRodr.3
Associate III

Hi,

No, it has no .ioc file. I have all .h and .c files, which include drivers and middlewares. Is there a way of importing?

Thanks

If no .ioc move to STM32CubeIDE is fully doable but will require you to invest a bit.

I foresee various options:

1) Let's create a brand new STM32CubeIDE so called "Empty": File > New > STM32Cube Project

0693W00000AMZf8QAH.jpgThen up to you to copy / paste your .c/.h files and add proper setups to get a build running (defines, includes, ...) based on project properties

0693W00000AMZfDQAX.jpg 

Or have a ty to import a "pre"-set project you can get from FW pack. File > Open Project From File System

0693W00000AMZgBQAX.jpgNote: Select your serie and board you need

Then still up to you to copy / paste your .c/.h files and add proper setups to get a build running (defines, includes, ...) based on project properties BUT already all drivers dependencies and setup should be available to you

Hi @Cartu38 OpenDev​,

I have been trying to create my new project on STMCubeIDE from an empty project as suggested (copy-paste of source files) but it looks like some files are not recognizable by STMCubeIDE or even missing (the files do exist actually in the folder). Moreover, I am not working with commercial board.

Do you know if there is any way to use the existing uvprojx and uvoptx files into STMCudeIDE?

Thanks for your help

Regards.

uvprojx and uvoptx are Keil proprietary files ... no way to exploit such if STM32CubeIDE.

Could you possibly share your Keil project ?

Hi @Cartu38 OpenDev​,

Ok, I see what you mean with that.

Unfortunately, I cannot share my Keil project.

I appreciate your help.

Regards.

Pavel A.
Evangelist III

If I remember correctly, Keil can create sort of makefile for MDK projects.

CubeIDE then can import a makefile-based project.

You'll need to provide assembly startup file , linker script and some C library stub files instead of Keil-specific files.

If this sounds complicated, find a consultant/contractor to help.

--pa

Hello,

I have some questions. I have been reading on how the projects are structured on both STM32CubeIDE and Keil MDK.

I believe that I have found a manner to deal with the importing process from Keil MDK to STMCubeIDE, which is:

On Keil MDK, the *.uvprojx file contains the project structure in XML format; such a file also contains the compilation/linking flags and these are IDE-dependent. So, what is useful for me are the source files. Furthermore, since I have the scatter file *.sct (this describes the memory layout; STM32CubeIDE does not support such files) created on Keil, I can use it to write a linker file *.ld on STM32CubeIDE.

In addition, I have the startup code written in assembler *.s and it is my understanding that I have to modify it according to my project since this is IDE-dependent. STM32CubeIDE is capable of creating the makefile automatically. However, I also must work on it; specifically, I have to modify the compilation and linking flags.

I already have the linker script *.ld describing the memory layout.

These points are not clear to me:

  1. STM32CubeIDE is equipped with GNU ARM Embedded and GNU for STM32 toolchains, which one should I use to then? When I work on the makefile, the compilation and linking flags, and target and debugger configuration should follow such a toolchain
  2. Can I avoid having a *.ioc file and still have a working project?
  3. I can start off a empty project, but I do not see how its structure should be, which folder should contain what?
  4. I have all object files created on Keil. So can I use them to first have a working linker script? I am not sure if these are compatible with STM32CubeIDE.

Thank you for your support.

Regards.

Pavel A.
Evangelist III

> I have the startup code written in assembler *.s and it is my understanding that I have to modify it according to my project since this is IDE-dependent. 

Correct

> STM32CubeIDE is capable of creating the makefile automatically.

Yes, the latest version 1.7 can create a makefile-type project from existing files.

To your questions:

1 - start with the STM32 toolchain, unless you must use generic ARM toolchain.

2 - yes

3 - Create a minimal project or import an example, then delete all unneeded files.

For a single-core processor (most of the models) all sources can just be in one flat directory.

4 - no

--pa