Guidelines For Connecting Via Jtag Protocol To The str71x Microcontroller Stmicroelectronics
Guidelines For Connecting Via Jtag Protocol To The str71x Microcontroller Stmicroelectronics
APPLICATION NOTE
Guidelines for connecting via JTAG protocol to the STR71x
microcontroller
INTRODUCTION
This application note provides guidelines on how to connect a Host debugger to a target
STR71x board via a JTAG protocol converter, taking into account the internal features of the
STR71x microcontroller product family.
This document is targeted for third party tool suppliers or application engineers interested in
connecting to the STR71x using the JTAG connector. For basic references on the JTAG tar-
geted for the ARM core, please refer to the ARM7TDMI Technical Reference manual
HOST PC
POWER
STR71x BOARD SUPPLY
Rev. 1
AN2099/0405 1/8
1
Guidelines for connecting via JTAG protocol to the STR71x microcontroller
1 OVERVIEW
One of the features of the STR71x is to allow the user to boot an application from internal
RAM, which could be used for debugging purposes. However, that system configuration may
potentially result in a hang-up when the debugger attempts to initiate the JTAG communica-
tion with the microcontroller. This could be caused by some random code in RAM that could
set the STR71x in an unpredictable mode and prevent JTAG connection to the target.
Section 2 of this application note describes the inherent features of the STR71x affecting the
JTAG connection. Section 3 presents a set of solutions for overcoming all the connection is-
sues. Finally, Section 4, gives a detailed description of the JTAG connection sequence from
the point of view of the JTAG protocol converter.
2/8
Guidelines for connecting via JTAG protocol to the STR71x microcontroller
3 CONNECTION METHODS
3/8
Guidelines for connecting via JTAG protocol to the STR71x microcontroller
CK
255TCK
2048TCK
RSTIN
JTAG_EN
~20µs 16TCK
RSTARM
MCLK
PHASE 1 2 3 4 5 6
4/8
Guidelines for connecting via JTAG protocol to the STR71x microcontroller
3 in Figure 2.) initiate connection before the code starts executing from memory. The de-
bugger should connect before any code is executed from memory, because as seen previ-
ously, random code in RAM could result in undefined behaviour by the core. The Standby pro-
gram is as follows:
3.4 CONCLUSION
Connection could be performed as soon as possible:
– after flash initialization
– when MCLK is running internally
– before the code execution starts.
The host debugger should assert DBGRQ after the flash initialization phase and needs to wait
2048 TCK periods before asserting DBGACK, which puts the CPU in Halt mode. This puts the
host debugger in full control of the STR71x CPU before it executes any code from memory.
5/8
Guidelines for connecting via JTAG protocol to the STR71x microcontroller
– The ICE debug control comms register is read (via scan chain2). This register is read in order
to determine whether the processor or the debugger can write to this register to initiate the
handshaking DBGRQ/DBGACK.
– The ICE debug status register is read to check DBGACK . This is to make sure the core is
not already halted in debug mode.
– DBGACK is set to 1, the system is in debug mode.
– The first instructions are passed to the core via scan chain 1 in debug mode.
– DBGACK is deasserted by writing to the ICE debug control register.
– Read back DBGACK = 0 from the ICE debug status register.
– NJTRST and SYSNRST are asserted, TAP is in RESTART (exit from debug mode).
– SYSNRST is deasserted.
6/8
Guidelines for connecting via JTAG protocol to the STR71x microcontroller
7/8
Guidelines for connecting via JTAG protocol to the STR71x microcontroller
“THE PRESENT NOTE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH INFORMATION
REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. AS A RESULT, STMICROELECTRONICS
SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO
ANY CLAIMS ARISING FROM THE CONTENT OF SUCH A NOTE AND/OR THE USE MADE BY CUSTOMERS OF
THE INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.”
Information furnished is believed to be accurate and reliable. However, STMicroelectronics assumes no responsibility for the consequences
of use of such information nor for any infringement of patents or other rights of third parties which may result from its use. No license is granted
by implication or otherwise under any patent or patent rights of STMicroelectronics. Specifications mentioned in this publication are subject
to change without notice. This publication supersedes and replaces all information previously supplied. STMicroelectronics products are not
authorized for use as critical components in life support devices or systems without express written approval of STMicroelectronics.
8/8