Showing results for 
Search instead for 
Did you mean: 

How to export STM32 project in STM32CubeIDE ?


I have used UART example code for P-NUCLEO_WB55 board to check it's UART.

Now i want to share that project to another team member

But if i just Copy paste project folder to other file location than it gives me compilation errors of Few files missing.

I have also tried to Export that project by Clicking File->Export than also i was not able to build that project.

Let me know solution of this.

Associate III

Here is what you have to do, first you should start with STM32CubeIDE and when CubeIDE ask if you want a CubeMX flow you should answer yes, why you ask? Well turns out STM32CubeMX is great at building the File structures and putting files in the proper directory so they can be found.

Next when CubeMX ask if you want to install all PERIPHERALS, answer NO. Then CubeMX will ask if you wish to GENERATE CODE?. Here you answer yes. CubeMX will generate the code and switch the PERSPECTIVE to CubeIDE, here you can open the main.c and see what CubeMX have produced.

Now here comes the good part. Since you have a working UART design this is good. Next you ERASE everything that CubeMX create for you and replace them with your UART files:

1) main.c

2) stm32F3xx_hal_msp.c (you will have to look to use the HAL for your MCU - this one shown is for the F3 family)

3) system_stmf3xx.c (once again pick this c file for the processor you intend on using).

4) stm32f3xx_it.c (this is for the interrupt for you processor, pick the one that matches your processor)

5) main.h

6) stm32f3xx_hal_conf.h

7) stm32Fxx_it.h

So there are four c -files and 3-h files you will need to cut and paste from your working design into the INC/SRC of the new CubeMX created design - which is now empty. I repeat, simply erase all source files that CubeMX created - just keep the beautiful file structure MX has provided.

Next, you will have to correct the DRIVER folder in your new design. This folder is "drivers\BSP\STM32f3xx-Nucleo\stm32f3xx_nucleo.c". Note, this BSP I show is for the STM32F3 products. You must locate the files for your processor of choice.

You will also need to make sure in your new design include the STM32Fxxx_HAL_Driver folder and is updated with the correct drivers.

Compile all of this, and it will function as it did with you last platform. One thing to note, when you follow this flow you won't be able to let CubeMX re-create code as it will overwrite the code you just pasted in. This over-write can be avoided if you paste within the USER PORTIONS of the CubeMX created code. This will take a little surgical implanting if you chose to do this. If you just want to see the code working in CubeIDE you won't need to do this.

Once again, once you paste your old code into CubeIDE, don't let CubeMX re-generate as it will over write your pasted material.

Associate II

Changed PC, now I need to transfer projects into the new workspace. I see that the export feature doesn't work on "modified examples". My question to ST is this : Why does it have to be that complicated ?

I also struggling on this. Still no solution.