Difference between revisions of "JTAG"

From PaparazziUAV
Jump to navigation Jump to search
 
(27 intermediate revisions by 8 users not shown)
Line 1: Line 1:
=Introduction=
=Introduction=
A JTAG interface is designed for on-chip debugging. It is used to program that do not have a means to upload software via USB already. For short; if you want to upload your own software or want to do serious paparazzi development work, the you need a cable like this.


=JTAG Cable overview=
A JTAG interface is designed for on-chip debugging. It can also be used to flash your firmware if you do not have a means to upload software via USB already. If you want to upload your own software or want to do serious Paparazzi development work, you will need a JTAG adapter like this.
There are multiple Paparazzi-compatible devices available that support JTAG. Below you find a list of JTAG devices that you can use in combination with e.g. a Paparazzi Lisa/M board.  


== FLOSS JTAG ==
See also:
* [[FirmwareFlashing#JTAG|firmware flashing via JTAG]]
The FLOSS JTAG is based on an FTDI chip that allows two simultaneous USB connections, which means that FLOSS JTAG allows JTAG and UART/COM connections.
* [[DevGuide/GDB_OpenOCD_Debug|debugging with JTAG]]


Let's take a look at upper side of the board. It contains JTAG connector (which is connected on photo) and two sets of RX/TX LEDs for JTAG and UART/COM interface separately. The JTAG connector is 2x5 pins, 0.05-inch pitch, and is compatible with the Samtec FFSD-05-D-06.00-01-N-RW-R ribbon cable.
=JTAG Adapters=
There are multiple Paparazzi-compatible devices available that support JTAG.


[[Image:Jtag-up.jpg]]
Below you will find a list of JTAG devices that you can use in combination with Paparazzi UAV Hardware like the [[Lisa/MX]] boards.


On the other side of the board there is 4 pin UART/COM connector, which contains: Ground (black), TX (yellow), RX (orange) and +5V (red)


[[Image:Jtag-down.jpg]]
== Black Magic Probe ==


Usage of board is pretty simple: JTAG can be used to upload firmware into the board and/or repair board with broken bootloader, and UART/COM interfaced can be used to make "COM port style" connection to the board. COM connection can be used for example for telemetry debug.
[[Image:BMPM_1_top.jpg|500x500px]][[Image:BMPM_1_bottom.jpg|500x500px]]


More info available on the [http://randomprojects.org/wiki/Floss-JTAG randomprojects.org wiki].
This is the original [http://www.blacksphere.co.nz/main/blackmagic Black Magic Probe] from [http://www.blacksphere.co.nz Black Sphere Technologies], a JTAG and SWD Adapter used for programming and debugging ARM Cortex MCUs.
The Black Magic Probe is available for purchase in the [http://1bitsquared.com/products/black-magic-probe 1BitSquared Store].  


== Black Magic Probe ==


[[Image:BMPM_1_top.jpg|500x500px]]
To use Black Magic Probe instead of FLOSS-JTAG or Luftboot for firmware flashing, append the following string to the upload command:


[[Image:BMPM_1_bottom.jpg|500x500px]]
On Linux:
FLASH_MODE=JTAG_BMP BMP_PORT=/dev/ttyACM0
On Mac OS:
FLASH_MODE=JTAG_BMP BMP_PORT=/dev/cu.usbmodem<serial>


Full info about the Black Magic Probe is available at the [http://www.blacksphere.co.nz/main/blackmagic Black Sphere Technology website].
To make this the default flash method add this in the airframe file firmware section:
    <configure name="FLASH_MODE" value="JTAG_BMP"/>
    <configure name="BMP_PORT" value="/dev/ttyACM0"/>


To use Black Magic Probe instead of FLOSS-JTAG or Luftboot, append the following string to the upload command:
See the [[FirmwareFlashing]] page for other methods.


On Linux:
=== Benefits ===
FLASH_MODE=JTAG BMP_PORT=/dev/ttyACM0
On Mac OS:
FLASH_MODE=JTAG BMP_PORT=/dev/cu.usbmodem<serial>


There are good Reasons to use Black Magic Probe Mini instead of FLOSS-JTAG: It just has much more options and cost less.
There are good reasons to use the Black Magic Probe Mini instead of FLOSS-JTAG:


*Lower cost
*No need for OpenOCD as BMPM has a built in GDB server
*No need for OpenOCD as BMPM has a built in GDB server
*Orders of magnitude faster as all the high speed protocol logic happens on the built-in STM32
*Orders of magnitude faster as all the high speed protocol logic happens on the built-in STM32
Line 44: Line 45:
*No need for loading and unloading of FTDI drivers on Mac OS X
*No need for loading and unloading of FTDI drivers on Mac OS X


===How to use Debugging features===
===UART port===
The pinout for the UART port on the back side of the BMP as seen on the image above and starting from the top is ground,rx,tx,3.3v . You can use this for receiving telemetry.


A page describing on how to start debugging using the BlackMagic probe cable can be found here JTAG: [[DevGuide/JTAG-Debug]]
===Upgrade BMP firmware===


===Upgrade BMP firmware===
Check firmware version:
  git clone git://blackmagicdebug.git.sourceforge.net/gitroot/blackmagicdebug/blackmagicdebug
$ sudo /usr/bin/arm-none-eabi-gdb
  cd blackmagicdebug/src
(gdb)  target extended-remote /dev/ttyACM0
   make CROSS_COMPILE=~/sat/bin/arm-none-eabi-
(gdb)  monitor version
  ../scripts/stm32_mem.py blackmagic.bin
 
To upgrade the brain of your Black Magic Probe, a.k.a. its firmware:
 
- Download the compiled firmware from http://blacksphere.co.nz/builds/  (more info at https://github.com/blacksphere/blackmagic/wiki/Frequently-Asked-Questions)
- Connect the Black Magic Probe while pressing the button
- Download and run the stm32_mem.py script:
  $ git clone git://blackmagicdebug.git.sourceforge.net/gitroot/blackmagicdebug/blackmagicdebug
  $ cd blackmagicdebug/scripts
  $ ./stm32_mem.py blackmagic-XXXX.bin   (this is the .bin file you downloaded in previous step)
 
===Where to Purchase===
 
The Black Magic Probe is available through the [[File:1bitsquared_logo.png|50px|link=http://1bitsquared.com/products/black-magic-probe]] [http://1bitsquared.com/products/black-magic-probe 1BitSquared Store].
 
== FLOSS JTAG ==
The FLOSS JTAG is based on an FTDI chip that allows two simultaneous USB connections, which means that FLOSS JTAG allows JTAG and UART/COM connections.
 
Let's take a look at upper side of the board. It contains JTAG connector (which is connected on photo) and two sets of RX/TX LEDs for JTAG and UART/COM interface separately. The JTAG connector is 2x5 pins, 0.05-inch pitch, and is compatible with the Samtec FFSD-05-D-06.00-01-N-RW-R ribbon cable.
 
[[Image:Jtag-up.jpg]]
 
On the other side of the board there is 4 pin UART/COM connector, which contains (from top to bottom in the image below): Ground (black), RX (orange), TX (yellow), and +5V (red)
 
[[Image:Jtag-down.jpg]]
 
Usage of board is pretty simple: JTAG can be used to upload firmware into the board and/or repair board with broken bootloader, and UART/COM interfaced can be used to make "COM port style" connection to the board. COM connection can be used for example for telemetry debug.
 
More info available on the [http://randomprojects.org/wiki/Floss-JTAG randomprojects.org wiki].
 
=== Availability ===


== FT2232 Dev Board ==
Floss JTAG is currently discontinued and not in production. We recommend buying the [http://1bitsquared.com/products/black-magic-probe Black Magic Probe] instead.


Use ftdi prog to change the Description String into: FLOSS-JTAG
== FT2232H Mini Module ==


[[File:AlternativeFlossJtag.png]]
Use ftdi prog to change the Description String into: FLOSS-JTAG. <br/>
More information for this board at [[Serial_Adapter]].


= Related articles =
[[Image:AlternativeFlossJtag.png|400px]]
* [[DevGuide/JTAG-Debug]] - Developer's guide JTAG debugging
* [[Dev/Debugging]] - General debugging information


[[Category:Hardware]] [[Category:Software]] [[Category:Developer_Documentation]]
[[Category:Hardware]] [[Category:Software]] [[Category:Developer_Documentation]]
----
(*(oo)*), ,~

Latest revision as of 05:35, 4 March 2016

Introduction

A JTAG interface is designed for on-chip debugging. It can also be used to flash your firmware if you do not have a means to upload software via USB already. If you want to upload your own software or want to do serious Paparazzi development work, you will need a JTAG adapter like this.

See also:

JTAG Adapters

There are multiple Paparazzi-compatible devices available that support JTAG.

Below you will find a list of JTAG devices that you can use in combination with Paparazzi UAV Hardware like the Lisa/MX boards.


Black Magic Probe

BMPM 1 top.jpgBMPM 1 bottom.jpg

This is the original Black Magic Probe from Black Sphere Technologies, a JTAG and SWD Adapter used for programming and debugging ARM Cortex MCUs. The Black Magic Probe is available for purchase in the 1BitSquared Store.


To use Black Magic Probe instead of FLOSS-JTAG or Luftboot for firmware flashing, append the following string to the upload command:

On Linux:

FLASH_MODE=JTAG_BMP BMP_PORT=/dev/ttyACM0

On Mac OS:

FLASH_MODE=JTAG_BMP BMP_PORT=/dev/cu.usbmodem<serial>

To make this the default flash method add this in the airframe file firmware section:

   <configure name="FLASH_MODE" value="JTAG_BMP"/>
   <configure name="BMP_PORT" value="/dev/ttyACM0"/>

See the FirmwareFlashing page for other methods.

Benefits

There are good reasons to use the Black Magic Probe Mini instead of FLOSS-JTAG:

  • Lower cost
  • No need for OpenOCD as BMPM has a built in GDB server
  • Orders of magnitude faster as all the high speed protocol logic happens on the built-in STM32
  • Supports Serial Wire Debug (SWD)
  • Supports tracing using the SWD trace pin
  • No need for loading and unloading of FTDI drivers on Mac OS X

UART port

The pinout for the UART port on the back side of the BMP as seen on the image above and starting from the top is ground,rx,tx,3.3v . You can use this for receiving telemetry.

Upgrade BMP firmware

Check firmware version:

$ sudo /usr/bin/arm-none-eabi-gdb
(gdb)  target extended-remote /dev/ttyACM0
(gdb)  monitor version

To upgrade the brain of your Black Magic Probe, a.k.a. its firmware:

- Download the compiled firmware from http://blacksphere.co.nz/builds/  (more info at https://github.com/blacksphere/blackmagic/wiki/Frequently-Asked-Questions)
- Connect the Black Magic Probe while pressing the button
- Download and run the stm32_mem.py script:
  $ git clone git://blackmagicdebug.git.sourceforge.net/gitroot/blackmagicdebug/blackmagicdebug
  $ cd blackmagicdebug/scripts
  $ ./stm32_mem.py blackmagic-XXXX.bin   (this is the .bin file you downloaded in previous step)

Where to Purchase

The Black Magic Probe is available through the 1bitsquared logo.png 1BitSquared Store.

FLOSS JTAG

The FLOSS JTAG is based on an FTDI chip that allows two simultaneous USB connections, which means that FLOSS JTAG allows JTAG and UART/COM connections.

Let's take a look at upper side of the board. It contains JTAG connector (which is connected on photo) and two sets of RX/TX LEDs for JTAG and UART/COM interface separately. The JTAG connector is 2x5 pins, 0.05-inch pitch, and is compatible with the Samtec FFSD-05-D-06.00-01-N-RW-R ribbon cable.

Jtag-up.jpg

On the other side of the board there is 4 pin UART/COM connector, which contains (from top to bottom in the image below): Ground (black), RX (orange), TX (yellow), and +5V (red)

Jtag-down.jpg

Usage of board is pretty simple: JTAG can be used to upload firmware into the board and/or repair board with broken bootloader, and UART/COM interfaced can be used to make "COM port style" connection to the board. COM connection can be used for example for telemetry debug.

More info available on the randomprojects.org wiki.

Availability

Floss JTAG is currently discontinued and not in production. We recommend buying the Black Magic Probe instead.

FT2232H Mini Module

Use ftdi prog to change the Description String into: FLOSS-JTAG.
More information for this board at Serial_Adapter.

AlternativeFlossJtag.png