
AT32 Printf Debug Demo
2019.08.05
20
Rev 1.0.2
2.6
Printf via JLinkRTT
2.6.1 Introduction
JLink has its own debug output function that can debug the code and output to the corresponding
window according to the specified instructions after the JLink RTT library code is added.
2.6.2 Example code
006_Printf_Test_Jlink_RTT\Project
2.6.3 Environment and hardware
2.6.3.1 Development environment
This method can be used in both the IAR and Keil environment. The compiling environment
supported by the example code is IAR_V6/7/8 and Keil_V4/Keil_V5 with the hardware board used
AT-START-F403_V1.2.
2.6.3.2 Hardware connection
J-Link connection
Table 10. Hardware connection table -- (without JTDO)
Hardware connection table
-
-(without JTDO)
No.
AT-START-F403_V1.2
J-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.6.4 Software
2.6.4.1 Header files
Add the
“
stdio.h
” to the code project files.
2.6.4.2 Add the JLink RTT library code
Add the SEGGER_RTT.c and SEGGER_RTT_printf.c in the JLink RTT library code to the
project files;
Add either SEGGER_RTT_Syscalls_IAR.c or SEGGER_RTT_Syscalls_KEIL.c to the project
files according to the compiling environment;