Skip to main content
BTrem.1
Senior
March 28, 2021
Solved

How do I change the MCU in CubeIDE project

  • March 28, 2021
  • 1 reply
  • 10050 views

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.
Best answer by KnarfB

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

1 reply

KnarfB
KnarfBBest answer
Super User
March 28, 2021

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
April 2, 2021

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