Computer Solutions Ltd
Whats New | Advanced Search
Downloads | Exchange Rates

Celebrating 38 years
supplying all your CAN and Embedded Development Tool needs

 


On-Chip-Debug using - BDM - JTAG & SWD


 

How does On-Chip- Debugging work ?

The following is a simplification to help new users with the concepts..........

Each and every chip of a family ( eg ARM or NXP/Freescale ColdFire ) allocates a few pins to communicate between a special Control Module within the microprocessor chip and an application program normally running on a PC. To minimise the number of pins and circuitry used on the chip this communication typically employs a non standard communications link so we need a specialist interface at the PC end.

When the micro powers up it examines some of these pins and if set in a particular way the Control Module takes over and the micro is said to have started in On-Chip-Debug mode (we will use the abbreviation BDM short for Background Debug Mode interchangeably).  If not set for BDM the Control Module simply starts the micro running at the power up location and has no more to do --- the pins being assigned to their standard I/O functions.  

If set for BDM then the Control Module not the CPU decides what will happen next. The Control Module has access to all the memory busses and once in BDM mode it can, for example, read and write all the memory and registers and send their contents to the PC for the engineer to look at. The engineer may decide to send fresh code from the PC to be loaded into the targets RAM. The Control Module can also force the microprocessor to execute a single instruction, or to run until the microprocessor hits a predefined location whose address corresponds to the contents of  the Control Modules "breakpoint registers". With just these few functions the engineer operating the PC has all the facilities needed to control the target system and debug code on the Microcontroller.

In short BDM provides 90% of the functionality of an In Circuit Emulator (ICE) at <1% of the cost. 

N.B. when JTAG is used to control On-Chip debugging it uses the signal standards specified by the Joint Test Action Group (JTAG the common name for the IEEE 1149.1) for communications but this does not automatically imply that the chip can be tested via boundary scan techniques and tools.

 

Using BDM to program Flash ?

The secret is that the BDM interface is used to load a small application into RAM plus as much of the data to be loaded into the flash as will fit in the remainder of the RAM.  The BDM then starts that application which "burns" the flash and then goes back to the PC for more data until the task is finished.

 

 


 

The following describe P & E's range of BDM & JTAG products

 

PEmicro are leaders in this field and their products are included in many NXP/Freescale EVB packages.  P & E's tools, including interfaces, software such as programmers (PROG), in-circuit debuggers (ICD), assembler/editors and register file displays (REGxx) all available off the shelf. They work via P & E's interfaces, which connect the PC to the target's, header by USB or Ethernet. These products are available as full 32/64 bit windows app for W95/98/2K/NT/XP/W7 and W8 for the following target processor families:

 

ARM Cortex M0-M4 Kinetis NXP LPC
  STM 32 TI / Stellaris
STMicroelectronics,           Renesas      and      Hitachi Families
All Freescale families :-  .. Kinetis,  Coldfire,   Qorivva,   PPC,   68K,   HCS08,   HC12 .. etc

 

 

BDM, JTAG and SWD Interfaces

PEmicros latest USB Universal Cables are the hardware interfaces between a standard PC and the header on any of a wide range of target system. Depending on the chip they provide access to the Background Debug Mode (BDM), JTAG and SWD interfaces of the microcontroller. By employing the BDM/JTAG/SWD Cable the user can take advantage of "On-Chip-Debugging" to program internal or external FLASH memory devices and to  test the application code in the micro.

A range of price performance points are available with the low cost Universal, the high performance Universal FX and the production Cyclone as alternatives.

Flash memory programming tools are available both for the development and production environments.  See below for details of how they work.

 

 
BDM Schematic

Full control of the on-chip resources via BDM/JTAG/SWD

Full speed in-circuit emulation at a reasonable price

Programming for internal or external EEPROM/FLASH memory devices

Execute until hardware breakpoint

Work with PROG programmer software packages as well as a wide range
Compiler debug environments such as CodeWarrior, KDS, Keil, IAR, Atollic, GDB

1.8 to 5 volt versions are available see chip specific information

Very fast downloads and stepping

Interface library and demo for custom testers and software

Using  the Universal FX Synchronous target architectures such as the Kinetis,  Qorivva,  Coldfire V2-V4, 683xx, HC16, Power Architecture PX Series and the DSC the communications can run at 4 to 10 times faster than the older Multilink interfaces.

         

 

Cyclone Pro develoment tool for Motorola 8 bit MicrosCyclone Family

These boxes will connect a PC via Serial, USB or Ethernet to provide a super fast interactive Flash programmer under manual or automatic control.  They can even be disconnected from the PC and used as a standalone Flash programmer.  If you are developing applications for any of the NXP/Freescale devices they are the only CPU specific hardware development tool you will ever need to buy.  They will work with all the software packages shown below:

  Cyclone Universal   For use with 68HC08,  HCS08, HC12, HCS12 families. Interfaces to PEmicro, CodeWarrior and Cosmic debug environments.  As well as  For use with Arm cortex, Kinetis, 55xx/56xx/57xx Qorivva, ColdFire, PPC 5xx/8xx and MAC 71xx,72xx (ARM) families. Interface to ARM GDB server

Also these will program the following devices

  Cyclone for ARM Cortex devices   For programming ARM Cortex M0-4 based devices from  STMicro, NXP, TI Stellaris and NXP/Freescale Kinetis.
  Cyclone For STMicro   For programming STM32,  STM8 and SPC56  families.
  Cyclone For Renesas   For programming M32C,  M16C, M16C/80,  R8C,  H8 and H8S/Tiny families.

 

The Cyclones are provided with a full set of flash programming algorithms and are particularly popular in production environments where they can be used with a range of automation options designed for full scale production line programming.

 

BDM Flash Programmer

An interactive flash EEPROM programming software package that allows you to program/reprogram both internal and external flash devices in-circuit, via a PEmicro interface cable. Perfect for development, production line programming, or field firmware upgrades. PEmicros products contains our entire library of setup files for a particular processor, and includes both interactive and command-line versions for use in development and production. 

To see which Flash devices PEmicro support follow this link .

Flash memory functions are : 

Program P&E Programmer screen shot
Verify
Blank check
Upload
Display
Erase

 

In-Circuit Debugger

PEmicro's In-Circuit Debugger software - ICD for Windows is a powerful tool for debugging . It uses the processor's background code debug mode, via an interface cable, to give the user direct access to all on-chip resources.

 
  • C source-level debugging support for IEEE695 & GNU
  • Full-speed in-circuit emulator
  • Breakpoints with counters for breaking on Nth execution
  • Variables window showing bytes, words, strings, and long words
  • Real-time execution as well as multiple tracing modes
  • Startup and Macro files for automating the debug process
  • Context-sensitive help for all commands
  • Timing measurement and execution count functions
  • Hot keys for setting breakpoints and counters
  • Support for symbolic register files

P & Es Debugger screen shot

Integrated Development Environment 

WinIDE allows you to run external programs including assemblers, C compilers, debuggers, and flash programmers from within one environment, with a single hot key for each. WinIDE comes optionally installed with a PEmicro assembler. 

Editor Features:  Assembler Features: 

Fully reconfigurable

Allows execution of external programs

On-screen help



Macro support

S19, HEX, IEEE695 objects

Conditional assembly

Include files (its not a relocating assembler)

Full listing control with cycle counter

 

Register File

REGxx allows the user, via the BDM, to view and modify the processor's register fields in both symbolic and numeric format, which removes the tedious process of searching through manual pages for register descriptions. When the user selects a register, the actual processor's memory is read and displayed. The register files work with PEmicro's In-Circuit Debugger software.

P&Es register display screen shot

PACKAGE with Assembler  

A full 32 bit windows software package consisting of Integrated Development Environment, In Circuit Debugger, Assembler, Programmer, Register File is now available for all CPUs  --  just add the cable of your choice. 

PACKAGE Pro  with C 

PEmicro's package Pros provide all the engineer needs to start using the Gnu Cross Compiler.  It has a version of the GNU/GCC compiler toolset precompiled by PEmicro to operate directly under the Windows environment without requiring the installation of a Unix shell. The compiler is integrated into WinIDE and allows for one-touch compilation of a C-level project. The package includes startup code and linker scripts for the most popular devices. The compiler produces both the Elf/Dwarf 2.0 and S19 output formats; The Elf/Dwarf format is loadable by PEmicro’s in-circuit debugger and the S19 is loadable by PEmicro’s in-circuit flash programmer all of which, along with a suitable BDM/JTAG interface, are included.   The Pro versions of the package are now available for ColdFire and Power PC  Qorivva 55xx/56xx/57xx (AKA NEXUS)

Unit Library

A library of calls that allow the PC to directly drive the BDM cable.  Ideal if you want to create your own production line test programs.  For an example of the C and Pascal API follow this link. Two versions are available  Windows and Linux x86 (not ARM).

 

For PEmicro products indexed by chip family Summary of PEmicro tools for programming NXP/Freescale,  Arm Cortex, Renesas and STMicro devices

 


Home Shop Products Supported Chips Information Zone Contact Site Map
 
Computer Solutions Ltd
3 b Claremont Road,   West Byfleet,  Surrey  KT14 6DY
 
Telephone: +44 (0) 1932 355630    
Email: sales@computer-solutions.co.uk      Web: www.computer-solutions.co.uk
 
Copyright 2017 Computer Solutions Ltd