Skip to main content
KYin.2
Associate II
March 9, 2021
Solved

Porting Project to Pin Compatible MCU in STM32CubeIDE

  • March 9, 2021
  • 2 replies
  • 5867 views

I am currently working on a motor controller project with the STM32G473RE.

I am trying to get more prototype boards made but the STM32G473RE is not in stock anywhere with long lead time

I see that the STM32G474RC has plenty of stock in multiple locations and I want to port my project from the STM32G473RE to the STM32G474RC.

The MCUs are entirely pin-to-pin compatible, the only difference being the STM32G474RC having half as much flash memory (which I am fine with and in fact prefer the lower cost) and the HR Timer (unused).

How would I go about doing this in an effective manner?

Thank you.

This topic has been closed for replies.
Best answer by KnarfB

Close STM32CubeIDE, open just the .ioc in CubeMX, leaving your project as is. After switching the MCU, you can generate code in either tool as usual. If you have put your code within USER BEGIN / END blocks, there is no need for copy and paste. You should, of course, have a backup ready for just in case.

hth

KnarfB

2 replies

KnarfB
Super User
March 9, 2021

When you open the .ioc in STM32CubeMX stand-alone tool, under Pinout there is a drop-down menu with a List Pinout Compatible MCUs entry (Alt+L). You should be able to pick the MCU of your choice and press OK, Import to switch to the new MCU. The same view within STM32CubeIDE didn't work for me, however.

hth

KnarfB

KYin.2
KYin.2Author
Associate II
March 9, 2021

So would have to port the project in steps? use CubeMX to create a new configuration project, then create a new project in cubeide from that new configuration and copy paste the relevant code files?

Thanks.

KnarfB
KnarfBBest answer
Super User
March 9, 2021

Close STM32CubeIDE, open just the .ioc in CubeMX, leaving your project as is. After switching the MCU, you can generate code in either tool as usual. If you have put your code within USER BEGIN / END blocks, there is no need for copy and paste. You should, of course, have a backup ready for just in case.

hth

KnarfB

Cchas.1
Visitor II
May 26, 2023

That doesn't work. It just creates a new project that needs to be imported