
AT32 Printf Debug Demo
2019.08.05
14
Rev 1.0.2
2.4
Redirect Printf as serial ports in Keil (using MicroLIB)
2.4.1 Introduction
The Keil environment comes with a MicroLIB that contains some codes supporting Printf function.
Tick the MicroLIB option to implement information interaction through the serial port debugging
assistant when the Printf is redirected to the serial ports.
2.4.2 Example code
004_Printf_Test_Keil_USART2_MicroLIB\Project
2.4.3 Environment and hardware
2.4.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.4.3.2 Hardware connection
2.4.3.2.1
J-Link/AT-Link&... connection
Table 6. 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.4.3.2.2
USART2 connection
Table 7. 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