My preferred environment for firmware development is VSCode with PlatformIO. However, for one of my projects, I needed to develop on an STM32, and for this MCU family, STM32CubeIDE is the manufacturer’s recommended tool. Read more
5 Likes
Hi,
Tip for STM32CubeIde to rename main .c ( or *.c ) to main.cpp for C++ projects.
- Create file ‘before.sh’ in project’s root directory as:
mv ./Core/Src/main.cpp ./Core/Src/main.c - Create file ‘after.sh’ in project’s root directory as:
mv ./Core/Src/main.c ./Core/Src/main.cpp - Start IOC configurator
- In IOC ‘ProjectManager’ → ‘Code Generation’
- Fill ‘User actions’ → ‘Before Code Generation’ and ‘After Code Generation’ browsing scripts generated in 1. and 2.
- Now the renaming is automated and user changes in main.cpp are preserved during code generation.
1 Like
Thank you, that’s good to know!