Skip to main content
SFuch.1
Associate II
June 17, 2021
Solved

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 Cube

  • June 17, 2021
  • 3 replies
  • 2022 views

..

This topic has been closed for replies.
Best answer by SFuch.1

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.

3 replies

Houda GHABRI
ST Employee
June 24, 2021

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

Tesla DeLorean
Guru
June 24, 2021

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 VenmoUp vote any posts that you find helpful, it shows what's working..
Tesla DeLorean
Guru
June 24, 2021

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 VenmoUp vote any posts that you find helpful, it shows what's working..
SFuch.1
SFuch.1AuthorBest answer
Associate II
June 24, 2021

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
Visitor II
June 29, 2021

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.