AN4989
Click on "Start Trace" button
Press "Resume" button, and your printf message is printed in SWV ITM Data Console.
7.4
Semihosting
Semihosting is a mechanism that enables code running on an Arm
and use the Input/Output facilities on a host computer that is running a debugger.
Examples of these facilities include keyboard input, screen output, and disk I/O. For
example, this mechanism can be used to enable functions in the C library, such as
printf() and scanf(). It can also allow to use the screen and keyboard of the host
instead of having a screen and keyboard on the target system.
This is useful because development hardware often does not have all the input and output
facilities of the final system. Semihosting enables the host computer to provide these
facilities.
However, the user has to be aware of the following drawbacks:
•
Semihosting only works during a debug session. Otherwise, the program gets stuck in
the first printf() routine reached.
•
Since semihosting uses breakpoint instruction and host dependent code, it has
significant and unpredictable impact on performance.
Figure 57. Enable ITM stimulus Port 0 in STM32CubeIDE
Figure 58. Start Trace button in STM32CubeIDE
AN4989 Rev 3
Printf debugging
®
target to communicate
79/118
117
Need help?
Do you have a question about the STM32 and is the answer not in the manual?