AN4989 Rev 3
79/118
AN4989
Printf debugging
117
Figure 57. Enable ITM stimulus Port 0 in STM32CubeIDE
Click on “Start Trace” button
Figure 58. Start Trace button in STM32CubeIDE
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
®
target to communicate
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.
Содержание STM32 Series
Страница 46: ...Connecting to the board AN4989 46 118 AN4989 Rev 3 Figure 30 Keil hotplug step2 ...
Страница 91: ...AN4989 Rev 3 91 118 AN4989 Debug through hardware exploration 117 Figure 69 STM32F4 F7 dual MCO capabilities ...
Страница 103: ...AN4989 Rev 3 103 118 AN4989 Managing DBGMCU registers 117 Figure 78 Generator Options debug MCU in STM32CubeIDE ...