cancel
Showing results for 
Search instead for 
Did you mean: 

Is there any way to read the current configuration of a STM32 controller currently running or being debugged and store it in an ioc file? The purpose is to migrate a running non-CubeMX project to CubeMX so that more functions can be added using CubeMX.

SFuch.1
Associate III
 
1 ACCEPTED SOLUTION

Accepted Solutions

Thank you so much for informing me.

That was what I finally ended up doing, going through an existing project's init procedures by debugger, noting down all settings, and then reproducing them in CubeMX, so that now I can add functionality there.

Thought there might be a more simple way such as compile the existing project, start it in debug mode, stop after init, and have a tool read the config registers and store the information as an ioc file, which unmodified would create code to reach the same init state, or after being modified in CubeMX would add more functionality to the project, while all can be maintained in CubeMX.

View solution in original post

6 REPLIES 6
Houda GHABRI
ST Employee

Hi @SFuch.1​ ,

Let me be sure that I understand the question, you want to convert a STM32 project to an ioc supported by CubeMX ,am I right?

Houda

No, that's called reverse engineering.

They'd have a hard time magicing an IOC from source code or a project file from a competing tool chain..

If you have a working project, you'll want to pull the pin level utilization into CubeMX manually, and hope when you press the button the framework/boilerplate is close enough that you can merge in your hand-crafted working code.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Pulling pin utilization and functionality out at a minimum would seem to be the ask.

Most tools don't keep this detail unless auto-generated. Human generated one might hope for comments/tables, and a singular or contained abstraction where all the pins and subsequently peripherals are instantiated.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Yes, converting a STM32 project to ioc supported by CubeMX is what I wanted to do.

Thank you so much for informing me.

That was what I finally ended up doing, going through an existing project's init procedures by debugger, noting down all settings, and then reproducing them in CubeMX, so that now I can add functionality there.

Thought there might be a more simple way such as compile the existing project, start it in debug mode, stop after init, and have a tool read the config registers and store the information as an ioc file, which unmodified would create code to reach the same init state, or after being modified in CubeMX would add more functionality to the project, while all can be maintained in CubeMX.

Ggvrf.1
Associate

If you've got a running venture, you may need to drag the pin level utilization into CubeMX manually, and wish whilst you press the button the framework/boilerplate is near enough that you could merge in your home made running code.