2026-03-16 8:46 AM
I've read other posts and the relevant app notes about this and tried some testing on my side but still not finding an easy or even effective way to do this.
I have a CubeIDE project built on a CubeMX ioc file for STM32G0B1KEU6 and want to change to STM32G0B1KCU6 (smaller flash). Same package, same core, same pinout, just smaller flash size. Should be easy.
CubeIDE 2.1.0
CubeMX 6.17.0
I open the CubeIDE project and then the existing ioc file within that.
I click Pinout -> List Pinout Compatible MCU's and select new the MCU. I click Import.
It creates a new ioc file (instead of updating the existing file within this project which is what I actually want) and attempts to import all of the existing ioc project settings.
It fails to import DAC and USB settings for some reason which I now need to go and manually edit and hope that everything else is correct. It is completely unclear what has and has not ported over successfully so I'll need to very carefully review everything.
Now I want to change the CubeIDE project to compile and run from this new file.
Do I really need to completely re-make a new project and carefully copy everything over? Is there no way to easily change the target MCU in CubeIDE? it seems to be a very common use case.
Solved! Go to Solution.
2026-03-16 10:04 AM
> Will this change be overwritten every time I re-generate from the ioc file since it still references the old MCU KEU6?
No
> Can I safely rename the files in the project since they are currently STM32G0B1KEUX_FLASH.ld etc?
You can, but you will also need to update project settings to refer to the new names.
> Is it not possible to import a new ioc into an existing CubeIDE project and then refer to that?
STM32CubeIDE doesn't deal with IOC files at all. It doesn't know or care about what's in your IOC.
2026-03-16 9:42 AM
No, it's not a supported use case to change the MCU on an already existing project because peripherals and settings vary between devices. It would be near impossible to ensure seamless changes to the MCU between arbitrary chips.
If you're just changing the flash size, you can edit the linker script (*.ld) with the new size and it will work. No other update is necessary.
Alternatively, do a diff of the code and/or IOC file before/after changes to ensure everything has been imported correctly. WinMerge is a good tool for this.
2026-03-16 9:59 AM
Understood, this is a situation where the MCU's in discussion are identical package, pinout, peripherals and within the same single datasheet. Only the flash size is changed. That's why I was hoping for a more integrated method of changing targets.
Will this change be overwritten every time I re-generate from the ioc file since it still references the old MCU KEU6?
Can I safely rename the files in the project since they are currently STM32G0B1KEUX_FLASH.ld etc?
Is it not possible to import a new ioc into an existing CubeIDE project and then refer to that?
2026-03-16 10:04 AM
> Will this change be overwritten every time I re-generate from the ioc file since it still references the old MCU KEU6?
No
> Can I safely rename the files in the project since they are currently STM32G0B1KEUX_FLASH.ld etc?
You can, but you will also need to update project settings to refer to the new names.
> Is it not possible to import a new ioc into an existing CubeIDE project and then refer to that?
STM32CubeIDE doesn't deal with IOC files at all. It doesn't know or care about what's in your IOC.