> For the complete documentation index, see [llms.txt](https://tk233.gitbook.io/notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tk233.gitbook.io/notes/stm32/getting-started-stm32-edition/changing-stm32cubeide-settings.md).

# Changing STM32CubeIDE Settings

## Set Code Style

Goto **Window** -> **Preferences**

![](https://1287130752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvVJ0h2a4qMIhB1I8GdV8%2Fuploads%2Fgit-blob-da6efd7e463b2812cb4eb1cc63727c1572418eaf%2Fimage.png?alt=media)

Goto **C/C++** -> **Formatter**, click the **Import** button.

![](https://1287130752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvVJ0h2a4qMIhB1I8GdV8%2Fuploads%2Fgit-blob-ec278ae7a4c31cccde413d7c87b8c25e03b21337%2Fimage.png?alt=media)

{% file src="/files/EdqsGkMM6dfK3JslVEfK" %}

In the popup window, select the formatter config file

![](https://1287130752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvVJ0h2a4qMIhB1I8GdV8%2Fuploads%2Fgit-blob-f31f64228a294cfc43a633b52eab26a779b0a266%2Fimage.png?alt=media)

Then, in the Name Style tab, change the following fields:

Variable: Lower Case, "\_" as delimiter

![](https://1287130752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvVJ0h2a4qMIhB1I8GdV8%2Fuploads%2Fgit-blob-b2a2bf01d8767baf179dc4e3130c7719f396e980%2Fimage.png?alt=media)

Class Field: Lower Case, "\_" as delimiter

![](https://1287130752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvVJ0h2a4qMIhB1I8GdV8%2Fuploads%2Fgit-blob-170208c46783c6c01e7ffb881b3bb0c31747ce24%2Fimage.png?alt=media)

Click **Apply and Close** button

![](https://1287130752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvVJ0h2a4qMIhB1I8GdV8%2Fuploads%2Fgit-blob-c54e29ef2491ca56531f467a79a6972576f7baf9%2Fimage.png?alt=media)

## Auto Format Code

Right-click on any file that needs to be formatted. Select **Source** -> **Format**.

![](https://1287130752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvVJ0h2a4qMIhB1I8GdV8%2Fuploads%2Fgit-blob-a50be058fec6497e0fbf33fa9e0db70f7b4105e3%2Fimage.png?alt=media)

## Change to Dark Mode

Goto **Window** -> **Preferences** -> **General** -> **Appearance**

Select **Dark** mode under Theme

![](https://1287130752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvVJ0h2a4qMIhB1I8GdV8%2Fuploads%2Fgit-blob-0d0ad9ec9ae37ecaa26c80c3702612af3fa6d38d%2Fimage.png?alt=media)

## Open Serial Monitor

At the bottom panel, click **Open Console** button -> **3 Command Shell Console**.

![](https://1287130752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvVJ0h2a4qMIhB1I8GdV8%2Fuploads%2Fgit-blob-fa510e2548c5cc7a0753f96e389d7eb222ab280d%2Fimage.png?alt=media)

Select "Serial Port", and click **New** button.

![](https://1287130752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvVJ0h2a4qMIhB1I8GdV8%2Fuploads%2Fgit-blob-35a58f1993d5d64f863e07df56343cc9e8c3576d%2Fimage.png?alt=media)

Select the correct COM port. Click **Finish**.

![](https://1287130752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvVJ0h2a4qMIhB1I8GdV8%2Fuploads%2Fgit-blob-8d6199315de3503bd2d9fc2f60a4c1183ef9a72f%2Fimage.png?alt=media)

Change Encoding to "UTF-8". Click **Ok**.

![](https://1287130752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvVJ0h2a4qMIhB1I8GdV8%2Fuploads%2Fgit-blob-cf93741796075bde2fe921f12dbfab5e0c683c93%2Fimage.png?alt=media)

## Enable Floating Point printf()

Goto **Project** -> **Properties**

![](https://1287130752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvVJ0h2a4qMIhB1I8GdV8%2Fuploads%2Fgit-blob-7d502eb3616a925445ce7e1074a9a3611d83d836%2Fimage.png?alt=media)

Goto **C/C++ Build** -> **Settings** -> **MCU Settings**, check the "Use float with printf from newlib-nano" setting.

![](https://1287130752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvVJ0h2a4qMIhB1I8GdV8%2Fuploads%2Fgit-blob-7981625a8a6b4eda860ab4163435c6b73bb3d3b9%2Fimage.png?alt=media)
