2024-07-05 06:52 AM
I have a project with its ioc, the setup of the peripherals are ok.
Now I want to edit a file while cubeide is closed and have the change reloaded when I reopen the ioc.
Let say that I set the baudrate of UART5 to 115200: in some file I'll have the UART5 init and in that function I'll have a line of code to set the baudrate to 115200:
huart5.Init.BaudRate = 115200;
I was expecting that if I close the cubeide, change the code to:
huart5.Init.BaudRate = 57600;
and then reopen cubemx it would load the new setting, but it seems that it does not.
Am I wrong to expect that behaviour or there is something going on here?
STM32CubeIDE
Version: 1.16.0
Build: 21983_20240628_1741 (UTC)
Solved! Go to Solution.
2024-07-05 07:40 AM
@Pavel A. wrote:Yes this should 'work' as expected.
That depends on what you're expecting!
I think @Manuel Ferrero is expecting that changes made to the generated C source should be reflected in the .ioc file.
That expectation will not be met.
2024-07-05 07:01 AM - edited 2024-07-05 07:24 AM
The C code is generated from the .ioc file - not the other way around.
There's no mechanism to "back port" changes from the C code to the .ioc file.
EDIT:
If you edit a .c or .h file outside CubeIDE, then the edits to those files should show up in the IDE's source file editor.
But they won't be reflected back into the .ioc file.
2024-07-05 07:06 AM
Yes this should 'work' as expected. Does it show any error message?
2024-07-05 07:22 AM
>Am I wrong to expect that behaviour
Yes.
CubeMx is a code generator , not more.
So you can edit (also while IDE open, or in IDE) any setting in your main , to test something or...so.
But if you "generate code" , it will generate code to the settings in Cube , whatever they are.
Your changes in code - away. Except in the "user areas" , this will stay and be there again.
2024-07-05 07:40 AM
@Pavel A. wrote:Yes this should 'work' as expected.
That depends on what you're expecting!
I think @Manuel Ferrero is expecting that changes made to the generated C source should be reflected in the .ioc file.
That expectation will not be met.
2024-07-05 07:54 AM - edited 2024-07-05 07:57 AM
@Andrew Neil but the OP clearly wrote: "and then reopen cubemx". So it is not about generated code. Or wait... it was actually CubeIDE? Confused.
2024-07-06 07:27 AM
Pavel, look closely at the OP. He edited the generated code. He then expected the change to appear in his .ioc.
I'm still laughing (at the OP)... :face_with_tears_of_joy:
2024-09-26 04:58 AM
> I'm still laughing (at the OP)
Har har har
2024-09-26 05:02 AM
Welcome back, @Manuel Ferrero
Is your question now answered?
2024-09-26 05:56 AM
You can edit ioc offline. Then open it in MX and press generate code, the changes will be reflected in the c code.