You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: i18n/en/docusaurus-plugin-content-docs/current/code_gen/stm32/README.md
+76-2Lines changed: 76 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,6 +67,79 @@ After execution, your project directory will contain the following generated or
67
67
68
68
---
69
69
70
+
## app_main.cpp
71
+
72
+
The `app_main.cpp` file contains the LibXR initialization function `app_main()`.
73
+
74
+
You can safely insert your own code between the `User Code Begin xxx` and `User Code End xxx` sections; these parts will not be overwritten when the code is regenerated.
75
+
76
+
> **Note:**
77
+
> This function should **never return**. If it does, all peripheral objects (such as `usart1`) will be destructed and resources released, which will cause a crash if you try to access them afterwards.
78
+
79
+
It is recommended to pass base class pointers of peripheral objects to your threads or tasks and operate on them there.
80
+
A better way to implement this will be introduced in the section **"Integrate with XRobot"** later in this chapter.
clang compiler has better support for clangd, so we recommend using it.
44
44
45
+
2025-7-10:
46
+
STM32CubeMX 15.0 has added native support for the Clang compiler. There is no need to download LLVM separately; you can use it directly through the VSCode plugin. This section will be updated once an independently installable STARM-CLANG toolchain becomes available.
47
+
45
48
### Windows
46
49
47
50
Download and install [LLVM](https://github.com/llvm/llvm-project/tags). Make sure the version is 18.1 or above.
0 commit comments