
AT32 Printf Debug Demo
2019.08.05
17
Rev 1.0.2
2.5
Redirect Printf as serial ports in Keil (not use MicroLIB)
2.5.1 Introduction
The Keil environment has a MicroLIB that contains some codes supporting Printf function.
When the Printf is redirected to the serial ports and the MicroLIB option box is not ticked, the
information interaction can be done through the serial port debugging assistant after adding the
codes that supports Printf to the engineering project files.
2.5.2 Example code
005_Printf_Test_Keil_USART2__Without_MicroLIB\Project
2.5.3 Environment and hardware
2.5.3.1 Development environment
This method is used in the Keil environment. The compiling environment used in the example code
is Keil_V4/Keil_V5 with the hardware board AT-START-F403_V1.2.
2.5.3.2 Hardware connection
2.5.3.2.1
J-Link/AT-Link&... connection
Table 8. Hardware connection table -- (without JTDO)
Hardware connection table--(without JTDO)
No.
AT-START-F403_V1.2
J-Link/AT-
Link&…
Attention
1
3.3V
3.3V
None
2
PA13
SWDIO
Must Pull up external
3
PA14
SWCLK
Must Pull down external
4
NRST
RSTn
None
5
GND
GND
None
2.5.3.2.2
USART2 connection
Table 9.
Hardware connection table
--(USART)
Hardware connection table--(USART)
No.
AT-START-F403_V1.2
USB_To_TTL(CH340)
Attention
1
GND
GMD
None
2
PA2
RXD
None
3
PA3
TXD
None