Freescale Semiconductor, Inc. Application Note AN2327/D Rev. 0, 9/2002 Freescale Semiconductor, Inc... M*Core EBDI Interface Application Note Alasdair Robertson TECD Applications, Scotland The Motorola enhanced background debug interface (EBDI) provides a cost effective background debug mode (BDM) interface to the Motorola M*Core and CPU32 microcontrollers. In order to provide a reliable BDM connection, there are some hardware design considerations and target system requirements that need to be observed. This document discusses these requirements as they pertain to the M*Core family of devices. 1. ONCE Module The M*Core ONCE module provides a mechanism for code debugging and run-time control, without utilising any of the MCU resources. Hardware breakpoints built into the MCU allow code to be debugged even when residing within the internal device Flash. The M*Core ONCE module consists of a state machine that is clocked from an external source such as the EBDI. This is asynchronous to the MCU core while internal logic ensures that all core/ONCE block data transfers are synchronised. Data is serially shifted between the EBDI and ONCE block using 2 data pins. For more information on the ONCE debug interface, refer to the appropriate implementation-specific user's manual. 2. EBDI The EBDI, shown in Figure 1, connects to any standard PC RS232 serial connection. An external 5v power supply is required if the voltage of the target system is less than 5 volts. Figure 1. EBDI Interface Box For More Information On This Product, Go to: www.freescale.com ONCE Signal Routing Freescale Semiconductor, Inc. Freescale Semiconductor, Inc... The latest EBDI, part number MMC14EBDI02, supports the following M*Core devices: * MMC2001 * MMC2080 * MMC2102 * MMC2103 * MMC2107 * MMC2111 * MMC2114 (requires the latest firmware) * MMC3401 (without Nexus) The firmware on EBDI revisions E and G is software re-programmable. For the latest firmware versions and for information on the current devices supported, refer to http://e-www.motorola.com/webapp/sps/site/prod_summary.jsp?code=MMC14EBDI02. 3. Target System Design Considerations In order to physically connect the EBDI to the target system, a 2 x 7 way, 0.1 inch pitch connector is required. The pinout for this connector is shown in Figure 2. Note that pin 8 is not connected and serves as a polarisation pin. The EBDI cable has the socket at position 8 closed off and, on the target system, this pin should be physically removed from the header. TDI 1 2 GND TDO 3 4 GND TCLK 5 6 GND GPI 7 8 Removed Pin RESET 9 10 TMS VDD1 11 12 DBEV GPO 13 14 TRST Notes: 1 ONCE Pin pad voltage, typically +3.3v Figure 2. ONCE Connector Pinout 3.1 ONCE Signal Routing It is critical that there are no glitches on the ONCE control signals because they can cause the ONCE state machine to enter an incorrect state and disrupt communication with the EBDI. Similarly, any signal problems on the TDI/TDO signals can result in incorrect data transmission. It is usually desirable to locate the ONCE connector at the edge of the PCB for easy connectivity with the EBDI; however, care should be taken to ensure that the track length between the connector and MCU is minimised. While the track length is not critical, longer tracks will result in possible signal degradation and unreliable ONCE operation. Low-impedance tracking should be used. Table 1 shows specific routing instructions for the ONCE signals. They should all be connected to 3.3 volts (or the ONCE pad voltage) via 10K pullup resistors. 2 M*Core EBDI Interface Application Note For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. ONCE Operation Table 1. Routing Instructions for ONCE Signals Signal Instructions TDI/TDO Test Data In/Out. Connect to corresponding signals on the MCU. Freescale Semiconductor, Inc... DBEV Debug Event. Connect to the MCU DBEV signal. This signal is not driven by the EBDI and MUST be tied high to ensure that the MCU does not enter background mode unexpectedly. GPI/GPO These signals are not routed to the MCU and should be pulled to 3.3 volts at the ONCE connector using 10K resistors. RESET ONCE Reset. Connect to the MCU Reset-In pin. Note that if there are multiple sources of reset connected to the Reset-In pin, it is recommended that they be gated together; otherwise, conflicts may occur in the case of non-open drain outputs and the EBDI, for example, would not be able to reset the MCU. TRST Test Access Port Reset. Connect to the MCU TRST pin. TMS Test Mode Select. Connect to the MCU TMS pin. TCLK Test Clock. Connect to the MCU TCLK pin. In order to reduce the harmonics and, therefore, the effect on EMI, a 47pf capacitor should be placed between this signal and the board ground plane, close to the ONCE connector. The signal quality can be further improved by placing a low value termination resistor on the TCLK line after it has gone to the MCU. Care should be taken to ensure that low impedance tracking is used on the TCLK signal to increase signal integrity. 3.2 ONCE Operation As previously mentioned, the EBDI does not implement the DBEV signal to place the M*Core into background debug mode. Instead, it asserts the MCU reset and then sends a command stream to the ONCE module (including assertion of TRST) to initiate BDM mode. The MCU reset is then released and the MCU can be controlled via the EBDI. The oscilloscope traces in Figure 3 show the reset sequence. MOTOROLA M*Core EBDI Interface Application Note For More Information On This Product, Go to: www.freescale.com 3 Freescale Semiconductor, Inc... ONCE Operation Freescale Semiconductor, Inc. Figure 3. ONCE Reset Sequence If any communication problems are encountered when using the EBDI, check that the reset sequence is as shown in Figure 3. As previously mentioned, any glitches on these signals can cause the ONCE module to lose communication with the EBDI. The traces in Figure 4 show a typical memory read via ONCE. Note the data on the TDO and TDI lines. The EBDI only clocks the TCLK signal when communication is in progress. This differs from some of the other BDM interfaces that continually clock the TCLK line. 4 M*Core EBDI Interface Application Note For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. Freescale Semiconductor, Inc... Target System Memory Map Figure 4. ONCE Data Read 4. Operational Requirements This section details the target and configuration requirements for successful use of the EBDI 4.1 Target System Memory Map As part of it's initialisation process, the EBDI reads target system memory at address 0x0. If the EBDI cannot read from 0x0, it's ONCE algorithms will not be correctly initialised and it will not function. The memory at address 0x0 can be RAM or Flash/ROM as long as it can be successfully read. This presents a problem for some M*Core parts that utilise a bootloader to configure the device from reset. Typically, this bootloader would be responsible for enabling the internal device Flash, normally located at address 0x0. A workaround for this is to allow the EBDI to reset the device as normal but immediately return control to the bootloader for a few seconds before the EBDI attempts to fully initialise the ONCE module. MOTOROLA M*Core EBDI Interface Application Note For More Information On This Product, Go to: www.freescale.com 5 TCLK Frequency Freescale Semiconductor, Inc. This workaround is controlled in the debugger startup script. An example for the SDS debugger follows: go -n sleep 5 stop # Return control to bootloader # Wait 5 seconds # Debugger interrupts bootloader and stops code execution. These commands should be placed at the very start of the configuration file so they are the first user commands executed after reset. NOTE The reset configuration word settings may require alteration to allow memory to be available or the bootloader to run from reset. Freescale Semiconductor, Inc... 4.2 TCLK Frequency The TCLK frequency must be less than 1/4 of the MCU system clock. This is typically controlled as a configuration setting in the debugger. 4.3 Debugger Support The EBDI for M*Core is currently supported by the following debuggers: * WindRiver Single Step www.windriver.com * Metrowerks CodeWarrior www.metrowerks.com NOTE The EBDI uses a software interface library (ESL) to interact with the debugger and, as such, the debugger does not directly control the EBDI, but uses the EBDI function calls. 6 M*Core EBDI Interface Application Note For More Information On This Product, Go to: www.freescale.com MOTOROLA Debugger Support Freescale Semiconductor, Inc. Freescale Semiconductor, Inc... THIS PAGE INTENTIONALLY LEFT BLANK 7 M*Core EBDI Interface Application Note For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. HOW TO REACH US: USA/EUROPE/LOCATIONS NOT LISTED: Motorola Literature Distribution P.O. Box 5405, Denver, Colorado 80217 1-303-675-2140 or 1-800-441-2447 JAPAN: Freescale Semiconductor, Inc... Motorola Japan Ltd. SPS, Technical Information Center 3-20-1, Minami-Azabu Minato-ku Tokyo 106-8573 Japan 81-3-3440-3569 Information in this document is provided solely to enable system and software implementers to use ASIA/PACIFIC: Motorola products. There are no express or implied copyright licenses granted hereunder to design Motorola Semiconductors H.K. Ltd. Silicon Harbour Centre, 2 Dai King Street Tai Po Industrial Estate, Tai Po, N.T., Hong Kong 852-26668334 or fabricate any integrated circuits or integrated circuits based on the information in this document. TECHNICAL INFORMATION CENTER: use of any product or circuit, and specifically disclaims any and all liability, including without 1-800-521-6274 limitation consequential or incidental damages. "Typical" parameters which may be provided in HOME PAGE: http://www.motorola.com/semiconductors Motorola reserves the right to make changes without further notice to any products herein. Motorola makes no warranty, representation or guarantee regarding the suitability of its products for any particular purpose, nor does Motorola assume any liability arising out of the application or Motorola data sheets and/or specifications can and do vary in different applications and actual performance may vary over time. All operating parameters, including "Typicals" must be validated for each customer application by customer's technical experts. Motorola does not convey any license under its patent rights nor the rights of others. Motorola products are not designed, intended, or authorized for use as components in systems intended for surgical implant into the body, or other applications intended to support or sustain life, or for any other application in which the failure of the Motorola product could create a situation where personal injury or death may occur. Should Buyer purchase or use Motorola products for any such unintended or unauthorized application, Buyer shall indemnify and hold Motorola and its officers, employees, subsidiaries, affiliates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if such claim alleges that Motorola was negligent regarding the design or manufacture of the part. Motorola and the Stylized M Logo are registered in the U.S. Patent and Trademark Office. digital dna is a trademark of Motorola, Inc. All other product or service names are the property of their respective owners. Motorola, Inc. is an Equal Opportunity/Affirmative Action Employer. (c) Motorola, Inc. 2002 AN2327/D For More Information On This Product, Go to: www.freescale.com