Solved
STM32CubeIDE creates main.c but I am using main.cpp!
I converted project from C to C++ with right click on project-> Convert to C++. The problem occurs when I generate the code in graphic configurator . It creates main.c file. Which is also loaded to controller if I run it.
How to solve this problem?
