cancel
Showing results for 
Search instead for 
Did you mean: 

How do I change the MCU in CubeIDE project

BTrem.1
Senior II

I created the project initially using CubeMX using a 128k STM32G431. I've ended up actually using a 64k ram part instead. The CubeIDE project calls out the wrong part now.

Because of extensive changes in the source code I do NOT want to re-run CubeMX with the new part. I'd like to manually change the necessary files so CubeIDE reports a 64k ram part.

Thanks,

Brian

1 ACCEPTED SOLUTION

Accepted Solutions
KnarfB
Principal III

If only the RAM is bothering you, you can simply compare the .ld files for both chips and copy over the correct lines. A cleaner way is described here: https://community.st.com/s/question/0D53W00000cyiAcSAI/porting-project-to-pin-compatible-mcu-in-stm32cubeide

View solution in original post

2 REPLIES 2
KnarfB
Principal III

If only the RAM is bothering you, you can simply compare the .ld files for both chips and copy over the correct lines. A cleaner way is described here: https://community.st.com/s/question/0D53W00000cyiAcSAI/porting-project-to-pin-compatible-mcu-in-stm32cubeide

I ended up creating a new dummy project in CubeMX using the target MCU, STM32G431C8Ux.

I then put the resulting *.LD file in my target project folder in place of the old LD file.

Next, I opened the project and under Project->Properties->C/C++ Build->Settings->Tool Settings->MCU GCC Linker I changed the linker script to the new name: STM32G431C8UX_FLASH.ld

Then I rebuilt and got the desired results.

Brian