world leader in high performance signal processing
Trace: » jtag-console

Linux JTAG Console

The Blackfin JTAG provides a method for passing data to and from the Blackfin core while it is still running. Basically, a gdbproxy process will listen via TCP/IP and take care of passing data via JTAG to/from the core. For more backend details, see this page.

Linux provides a standard tty driver so that you can use this channel to talk to the board without a serial cable. The tty driver will typically show up as /dev/ttyBFJC0, so you can use that like any other tty device.

This document assumes you already have a supported JTAG cable connected to your development host and the board and that it works.

Enabling JTAG Console

In the kernel configuration menu:

Device Drivers  --->
  Character devices  --->
    <*> Blackfin JTAG Communication
    [*]   Console on Blackfin JTAG

Using JTAG Console

Linux Devices

If you built it as a module, simply load it as:

root:/> modprobe bfin_jtag_comm

You can use the driver as a normal console device (console=) and use to it like a normal tty device (open/read/write it like /dev/ttyBF0).

Host Machine

First you have to launch bfin-gdbproxy. This will connect to the board via JTAG and set up the communication channel automatically. The italizaed output below shows that gdbproxy is now listening via TCP/IP on port 2001.

$ bfin-gdbproxy -q bfin
Found USB cable: gnICE+
Connected to libftdi driver.
IR length: 5
Chain length: 1
Device Id: 00110010011111001000000011001011 (0x327C80CB)
  Manufacturer: Analog Devices, Inc. (0x0CB)
  Part(0):      BF537 (0x27C8)
  Stepping:     3
  Filename:     /usr/local/src/blackfin/toolchains/20100424/bfin-elf/bin/../share/urjtag/analog/bf537/bf537
warning:   bfin: no board selected, BF537 is detected
notice:    bfin: jc: waiting on TCP port 2001
notice:    bfin-gdbproxy: waiting on TCP port 2000

Now you can connect with telnet or netcat to that port and data will be sent to the U-Boot console. Any output from U-Boot will be sent back via the network. There is also a jtagconsole helper script include in the U-Boot source tree.

$ ./tools/jtagconsole
NOTE: the interrupt signal (normally ^C) has been remapped to ^T
console [ttyBFJC0] enabled, bootconsole disabled
console [ttyBF0] enabled
Calibrating delay loop... 987.13 BogoMIPS (lpj=493568)
Mount-cache hash table entries: 512
Blackfin Scratchpad data SRAM: 4 KB
Blackfin L1 Data A SRAM: 16 KB (16 KB free)
Blackfin L1 Data B SRAM: 16 KB (16 KB free)
Blackfin L1 Instruction SRAM: 48 KB (36 KB free)
NET: Registered protocol family 16
Blackfin DMA Controller
stamp_init(): registering device resources
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
msgmni has been set to 105
bfin-jtag-comm: initialized
bfin-uart: Blackfin serial driver
bfin-uart.0: ttyBF0 at MMIO 0xffc00400 (irq = 18) is a BFIN-UART
bfin_mii_bus: probed
bfin_mac: attached PHY driver [SMSC LAN83C185] (mii_bus:phy_addr=0:01, irq=-1, mdc_clk=2500000Hz(mdc_div=24)@sclk=125MHz)
bfin_mac bfin_mac.0: Blackfin on-chip Ethernet MAC driver, Version 1.1
rtc-bfin rtc-bfin: rtc core: registered rtc-bfin as rtc0
bfin-wdt: initialized: timeout=20 sec (nowayout=0)
TCP cubic registered
NET: Registered protocol family 17
rtc-bfin rtc-bfin: setting system clock to 1970-01-06 18:14:49 UTC (497689)
IP-Config: Gateway not on directly connected network.
Freeing unused kernel memory: 1664k freed



                           _____________________________________
        a8888b.           / Welcome to the uClinux distribution \
       d888888b.         /       _     _                         \
       8P"YP"Y88        /       | |   |_|            __  __ (TM)  |
       8|o||o|88  _____/        | |    _ ____  _   _ \ \/ /       |
       8'    .88       \        | |   | |  _ \| | | | \  /        |
       8`._.' Y8.       \       | |__ | | | | | |_| | /  \        |
      d/      `8b.       \      \____||_|_| |_|\____|/_/\_\       |
     dP   .    Y8b.       \   For embedded processors including   |
    d8:'  "  `::88b        \    the Analog Devices Blackfin      /
   d8"         'Y88b        \___________________________________/
  :8P    '      :888
   8a.   :     _a88P         For further information, check out:
 ._/"Yaa_:   .| 88P|            - http://blackfin.uclinux.org/
 \    YP"    `| 8P  `.          - http://docs.blackfin.uclinux.org/
 /     \.___.d|    .'           - http://www.uclinux.org/
 `--..__)8888P`._.'  jgs/a:f    - http://www.analog.com/blackfin

Have a lot of fun...


BusyBox v1.16.1 (2010-04-09 15:23:22 EDT) hush - the humble shell

root:/> PHY: 0:01 - Link is Up - 100/Full
root:/> uname -a
Linux blackfin 2.6.33.3-ADI-2010R1-pre #21 Mon Apr 26 17:03:15 EDT 2010 blackfin GNU/Linux
root:/>