Skip to main content
BTrem.1
Senior
Mar 28, 2021 4:54 PM UTC
Solved

How do I change the MCU in CubeIDE project

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

This topic has been closed for replies.
KnarfB
KnarfBBest answer
Super User
Mar 28, 2021 5:27 PM UTC

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

2 replies

KnarfB
KnarfBBest answer
Super User
Mar 28, 2021 5:27 PM UTC

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

BTrem.1
BTrem.1Author
Senior
Apr 2, 2021 10:28 PM UTC

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