Hello,
I have a project based on STM32F103RGT6 microcontroller, using µVision V5.13.00. Everything is fine building, debugging etc.
Now, i want to change the microncontroller to STM32F072RBT6. Is there any easy way to do that through the µVision?
I tried to change the target Device to STM32F072RB from the options of the project, but still the includes in the source code refer to stm32f10x.h and NOT in stm32f0xx.h.
Is there any automatic way to change the target controller on my prject assuming that both controllers fulfill the requirements of it?
Thanks in advance for your help.
No, I don't think there's an automagic way of porting your project. Frankly I think there are significant architectural differences between the F1 and F0 series, that you can't just wave a magic wand anyway.
Suggest you create a NEW project for the NEW architecture, this can be a simple shell project. Confirm you can build that. Then use a merge tool, like WinMerge, to migrate portions of your existing project to the new project, and do what ever porting or adaption that is required.
I tried that ages ago, and it didn't work - so I haven't tried it since. Sounds like it still doesn't work.
But, as Clive One says, it's not so easy to see what "work" would actually mean here.
Therefore I second the motion to start with a new, clean, "skeleton" project for your new device - and then merge-in your other code.
How easy that will be will, of course, depend on how well you have written your code for portability ...
I always go the "merge" route, using a new project.
The advantage here is that it allows me to use the same design methods as when the project was originally written. I.e. activating one sub-block at a time. So testing basic clock setup while "blinking" some GPIO pin. Then testing the code for a specific UART. Then testing the code for more UART. Then test the code for a SPI device. Then for further SPI devices. When something fails, I then have an idea where to start looking.
Only when someone have very extensive knowledge of multiple target processsors and having already implemented separate projects running on them might it be meaningful to try to directly write code with conditional compilation etc to have the code directly movable between multiple processors by just switching processor configuration, include files and maybe one or more startup files.