cancel
Showing results for 
Search instead for 
Did you mean: 

I hope that the STM32CubeMX code generation tool can add user-defined keywords to ensure that the user's own added code STM32CubeMX is not deleted when the code is generated.

JLee.0
Associate III

for example:​

/* USER CODE BEGIN Includes */

   ....

/* USER CODE END Includes */

/* USER CODE BEGIN 0 */

...

/* USER CODE END 0 */

�?

I found that these keywords only work for this definition in the generated code, but after I added them in the original location without these keywords,

Will still cover my own code when generating with STM32CubeMX,

I hope to improve these small problems and increase the ease of use of the Cube library.

7 REPLIES 7
JLee.0
Associate III

0690X000006C0sPQAS.png

JLee.0
Associate III

Will still cover my own code when generating with STM32CubeMX

JLee.0
Associate III

@Khouloud GARSI​ : I Hope ST to solve this problems�?

Khouloud GARSI
Lead II

Hi @JLee.0​ ,

Your request is forwarded internally. We will answer you ASAP.

Khouloud.

JLee.0
Associate III

Thanks very much�?​

Cyril FENARD
ST Employee

hi @JLee.0​ ,

As far the "Memory management macros" block of code is concerned, it is not intended to add a user code section in these generated lines of code.

Nevertheless, there is a section of user code at the beginning of the header file where part of the code can be added as you like, which prevents the modification of the generated lines.

Hoping that it clarifies the behavior of the tool; you can also get more details in UM1718 (Help/Help in toolbar of CubeMX tool), i.e. "Generated files options" section.

Regards.

Cyril

JLee.0
Associate III

@Cyril FENARD​ 

Thank you very much for your reply.

I mean this tool can provide user-defined keywords to avoid being overwritten by the CubeMX tool. The above image is just an example.​