Sterling
DIIDevHeads IoT Integration Server
•Created by Sterling on 8/29/2024 in #pcb-and-analog
SWV printf Output Issue in C++ on STM32G431KB
I am currently utilizing an STM32G431KB board that differs from other boards in the STM32 Nucleo series as it has a wired SWO. While setting up SWV printf on a Nucleo variant of the same product, I encountered an inquiry and implemented suggestions given by its first answer which allowed me to enable functioning SWV under C programming language.
However, upon switching over to C++, no output is visible during usage of this feature.
For the C project, I created a new project, switched Debug to "Trace Asynchronous SW," and added the following code:
In the main loop, I added:
Upon activating SWV in the Debug Configuration, adjusting the core clock to 170 MHz, deactivating timestep in SWV settings and empowering port 0; executing C yields optimal results with expected output.
On renaming
main.c
to main.cpp
, the project operates in C++, but there is no result. What could be the reason for this problem?3 replies