cancel
Showing results for 
Search instead for 
Did you mean: 

CubeMX generate code made my code disppear

tonbaebae
Associate II

I am using the Wireless Connectivity software pack, which automatically generates Wi-Fi and bluetools code files. Due to specific requirements, I have made some modifications to parts of the code files and configured additional pins using CubeMX's IOC. However, every time I press the "Generate Code" button, the compiler regenerates the code files from the software pack, causing my changes to disappear.

*I  already know that I need to place my code between /* user code begin */ and /* user code end */, but these tags are not present in the code generated by the software pack.

Is there any way to preserve the changes I made in the code files after using CubeMX to generate code? Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

No, only code within the USER CODE BEGIN and USER CODE END comments is preserved. If those aren't there, your code won't be preserved. You can't add your own USER CODE sections.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

1 REPLY 1
TDK
Guru

No, only code within the USER CODE BEGIN and USER CODE END comments is preserved. If those aren't there, your code won't be preserved. You can't add your own USER CODE sections.

If you feel a post has answered your question, please click "Accept as Solution".