2025-09-01 8:03 PM - edited 2025-09-01 11:43 PM
Does anyone have experience with integrating hierarchical state machines (C-code) with a STM32CubeIDE project?
For example, the QP/C software by Quantum Leaps generates state machine C-code based on a graphical modeling tool. If the state machine diagram changes the C-code is re-generated: https://www.state-machine.com/qpc/index.html
How can this capability be integrated with the STM32CubeIDE?
Any feedback will be appreciated. Thank you!
Solved! Go to Solution.
2025-09-03 1:17 AM - edited 2025-09-03 1:22 AM
As far as CubeIDE is concerned, it's all just source files - it neither knows nor cares how those files were created.
So it's no different to files that you create manually yourself.
Place the files in a folder away from the CubeMX stuff to be sure that CubeMX won't mess with it.
PS:
for example, see:
and:
2025-09-03 1:17 AM - edited 2025-09-03 1:22 AM
As far as CubeIDE is concerned, it's all just source files - it neither knows nor cares how those files were created.
So it's no different to files that you create manually yourself.
Place the files in a folder away from the CubeMX stuff to be sure that CubeMX won't mess with it.
PS:
for example, see:
and:
2025-09-03 3:41 PM
@Kmax18 IMHO your question basically is: how to integrate Cube-generated code with your own code and/or code generated by other tools.
As @Andrew Neil wrote, there are BKMs for that. Unfortunate glitches in the Cube re-regeneration may happen, so keep your valuable code protected by version control.
2025-09-03 7:44 PM
Thank you, @Andrew Neil ! Your articles are very helpful.
2025-09-03 7:45 PM
Thank you @Pavel A., much appreciated. ("BKM" is Best Known Method, right?)
2025-09-04 1:44 PM
Correct!