Flyswatter2 Beagleboard XM How To

 

Connecting the Flyswatter2 and the Beagleboard XM

To hook up the Flyswatter2 and the Beagleboard XM, you will need:

  • 20-pin ARM to 14-pin TI JTAG Adapter Board
  • 14-pin JTAG Ribbon Cable
  • RS-232 Serial Cable with one male, one female head
  • USB Male A/Male B Cable
  • 5V1A Power Cable

Set the EMU pins on the JTAG Adapter Board.

Ti adapter.png

The EMU0 and EMU1 pins should be set to 1. Set both jumpers to the position closest to the 14-pin interface, as in the picture.

 

Connect the JTAG Adapter Board to the Flyswatter2.

Fs2 ti adapter.png

Connect the 20-pin end of the adapter board to the Flyswatter2’s JTAG interface.

 

Connect the 14-pin Ribbon Cable to the JTAG Adapter Board.

Fs2 ti jtag.png

Your cable most likely has a notch on the head to force it into the correct position. If it doesn’t, align Pin 1 on the ribbon cable with the side of the board opposite the EMU pins. (In the picture, Pin 1 is marked by the red stripe on the cable.)

 

Connect the 10-pin Ribbon Cable to the RS-232 Adapter Board.

Fs2 jtag14serial10.png

Connect the Other End of the Ribbon Cable to the Beagleboard XM.

Fs2 beaglexm jtag.png

Be sure to align the ribbon cable correctly. Pin 1 on the Beagleboard XM is the pin closest to the center of the board.

 

Plug in the Serial Cable.

Fs2 beaglexm bothcables.png

Connect the Flyswatter2 and the Beagleboard XM with the RS-232 serial cable.

 

Connect the USB cable to the Flyswatter2.

Fs2 beaglexm usb.png

Find the USB cable that comes with the Flyswatter2. Connect the B end (the square end, not the flat end) to the Flyswatter2.

 

Connect the Power Cable to the Beagleboard XM.

Fs2 beaglexm power.png

The Beagleboard XM’s power adapter is next to the serial port.

 

Plug the Power Adapter into a Wall Outlet.

The green power LED on the Beagleboard XM should come on and remain on.

Plug the USB Cable into your PC.

The green power LED on the Flyswatter2 should come on and remain on.
 

Installing OpenOCD

OpenOCD (Open On-Chip Debugger) is open-source software that interfaces with the Flyswatter3. OpenOCD provides debugging and in-system programming for embedded target devices. You will need to compile OpenOCD from source, and patch the source with one of the OpenOCD Patches for Flyswatter 3 support.

Whichever guide you use, be sure to install the patch! Both guides include instructions on downloading and installing the patch.
Compiling OpenOCD Linux

Compiling OpenOCD Linux D2XX
The first set of instructions uses libFTDI, an open-source driver library for FTDI devices. The second set uses FTD2XX, a closed-source driver library from Future Technology Devices International.

 

Running OpenOCD

Now you are ready to run OpenOCD. If you installed the OpenOCD Ubuntu package, open a terminal window and type the following from any directory:

openocd -f interface/flyswatter2.cfg -f board/ti_beagleboard_xm.cfg -c init -c "reset init"

If you compiled OpenOCD yourself, navigate to the openocd-bin directory you created in the compile guide and type:

cd ~/openocd-bin
sudo ./openocd -f interface/flyswatter2.cfg -f board/ti_beagleboard_xm.cfg -c init -c "reset init"

For more information, see Running OpenOCD on Linux. When you start OpenOCD, its output should look like this:

Beaglexm ocdstartup.png

JTAG-DP_STICKY_ERROR on startup

You may see one or more JTAG-DP_STICKY_ERROR immediately on startup. This is caused by a bug in OpenOCD, but don’t worry. OpenOCD will still be able to communicate with the board. The errors look like this.

Beaglexm ocderr.png

The -c init -c “reset init” commands at the end of the OpenOCD startup is a workaround for this error. If you don’t include the init and reset init commands, you will still be able to use OpenOCD with the Beagleboard XM. However, if you exit and restart OpenOCD, it will fail to connect unless you unplug the Flyswatter and plug it back in.

Telnet Connection

You cannot enter commands directly to OpenOCD. Open a new terminal window and type:

telnet localhost 4444

You will should see this prompt:

Telnet.png

You can give commands to OpenOCD through this prompt.

 

Common OpenOCD Commands

To see a full list of OpenOCD commands, enter help in the telnet window.

reset

Resets the Beagleboard XM. The output of the Reset command should look like this:

Beaglexm reset.png

halt

Sends a halt request to the Beagleboard XM. If the Beagleboard XM halts, you will see text output in the telnet window. (If the Beagleboard XM is already halted, you will see no output.)

Beaglexm halt.png

halt [timeout]

You can also use halt followed by a time in milliseconds. OpenOCD waits for the target to halt the specified amount of time, then gives up if the target has not halted. You can use this to avoid OpenOCD hanging because the Beagleboard XM fails to halt. For example, to send a halt command with a timeout of one second, type:

halt 1000

resume

Enter resume to end a halt. You will not see any text output in the telnet window.

reg

Displays a numbered list of all of the Beagleboard XM’s registers.

Beaglexm reg.png

reg [entry]

Run reg with a register number to display the contents of a register, in hexadecimal. The register number corresponds to the output of the reg command with no arguments, above. You must run the halt command before reading registers.

Beaglexm reg0.png

If you run reg while the Beagleboard XM is not halted, you will still see the value stored in the register. However, registers change contents very quickly while the device is running; by the time you see the value, the value actually in the register may be different. If you try to run reg while the device is not halted, you will see this:

Beaglexm reg0 nothalted.png

 

reg [entry] [value]

Sets the value of a register. The register number corresponds to the output of the reg command with no arguments, above. Make sure the Beagleboard XM is halted (with the halt command) before you change the value of a register!

You can enter registry values in either decimal, by typing a number by itself, or in hexadecimal, by prefacing the value with 0x.

Beaglexm regset.png

 

GDB Debugger

GDB, the GNU Project Debugger is a debugging tool provided with the GNU Compiler Collection (GCC). GDB allows you to stop and start a running program, examine its functioning, and make changes. GDB is installed on Ubuntu 10.04 by default, but you will need a different version of GDB build for embedded targets. Follow the instructions on the GDB Debugger page below.

GDB Debugger

The GDB debugger page will walk you through installing GDB for use with OpenOCD, and loading and testing a simple program.

Flyswatter2 Beagleboard XM Windows How To

This guide will walk you through connecting the Flyswatter2 and the TI Beagleboard XM to your Windows PC, and installing and running OpenOCD. This guide was tested with Windows XP and Windows 7. Instructions are identical on 32-bit and 64-bit versions of Windows unless otherwise noted.

 

Connecting the Flyswatter2 and the Beagleboard XM

To hook up the Flyswatter2 and the Beagleboard XM, you will need:

  • 20-pin ARM to 14-pin TI JTAG Adapter Board
  • 14-pin JTAG Ribbon Cable
  • RS-232 Serial Cable with one male, one female head
  • USB Male A/Male B Cable
  • 5V1A Power Cable

Set the EMU pins on the JTAG Adapter Board.

Ti adapter.png

The EMU0 and EMU1 pins should be set to 1. Set both jumpers to the position closest to the 14-pin interface, as in the picture.

 

Connect the JTAG Adapter Board to the Flyswatter2.

Fs2 ti adapter.png

Connect the 20-pin end of the adapter board to the Flyswatter2’s JTAG interface.

 

Connect the 14-pin Ribbon Cable to the JTAG Adapter Board.

Fs2 ti jtag.png

Your cable most likely has a notch on the head to force it into the correct position. If it doesn’t, align Pin 1 on the ribbon cable with the side of the board opposite the EMU pins. (In the picture, Pin 1 is marked by the red stripe on the cable.)

 

Connect the 10-pin Ribbon Cable to the RS-232 Adapter Board.

Fs2 jtag14serial10.png

Connect the Other End of the Ribbon Cable to the Beagleboard XM.

Fs2 beaglexm jtag.png

Be sure to align the ribbon cable correctly. Pin 1 on the Beagleboard XM is the pin closest to the center of the board.

 

Plug in the Serial Cable.

Fs2 beaglexm bothcables.png

Connect the Flyswatter2 and the Beagleboard XM with the RS-232 serial cable.

 

Connect the USB cable to the Flyswatter2.

Fs2 beaglexm usb.png

Find the USB cable that comes with the Flyswatter2. Connect the B end (the square end, not the flat end) to the Flyswatter2.

 

Connect the Power Cable to the Beagleboard XM.

Fs2 beaglexm power.png

The Beagleboard XM’s power adapter is next to the serial port.

 

Plug the Power Adapter into a Wall Outlet.

The green power LED on the Beagleboard XM should come on and remain on.

Plug the USB Cable into your PC.

The green power LED on the Flyswatter2 should come on and remain on.
 

Installing OpenOCD

OpenOCD (Open On-Chip Debugger) is open-source software that interfaces with the Flyswatter2. OpenOCD provides debugging and in-system programming for embedded target devices. You will need to compile OpenOCD from source, and patch the source with one of the OpenOCD Patches for Flyswatter 3 support.

Whichever guide you use, be sure to install the patch! All four guides include instructions on downloading and installing the patch.

Windows 7

Use Windows 7 guides if compiling for Windows Vista.

Compiling OpenOCD Win7

Compiling OpenOCD Win7 D2XX

 

Windows XP

Compiling OpenOCD WinXP

Compiling OpenOCD WinXP D2XX
The first set of instructions uses libFTDI, an open-source driver library for FTDI devices. The second set uses FTD2XX, a closed-source driver library from Future Technology Devices International.

 

Running OpenOCD

Now you are ready to run OpenOCD. Open a command line window; if you’re not sure how to do this, see Running OpenOCD on Windows. Navigate to the folder containing openocd.exe (the openocd-bin folder you created in the compile guide) and type:

cd C:\openocd-bin
openocd -f interface/flyswatter2.cfg -f board/ti_beagleboard_xm.cfg -c init -c "reset init"

For more information, see Running OpenOCD on Windows. When you start OpenOCD, its output should look like this:

Beaglexm ocdstartup win.png

JTAG-DP_STICKY_ERROR on startup

You may see one or more JTAG-DP_STICKY_ERROR immediately on startup. This is caused by a bug in OpenOCD, but don’t worry. OpenOCD will still be able to communicate with the board. The errors look like this.

Beaglexm ocderr win.png

The -c init -c “reset init” commands at the end of the OpenOCD startup is a workaround for this error. If you don’t include the init and reset init commands, you will still be able to use OpenOCD with the Beagleboard XM. However, if you exit and restart OpenOCD, it will fail to connect unless you unplug the Flyswatter and plug it back in.

Telnet Connection

You cannot enter commands directly to OpenOCD. Open a new command window and type:

telnet localhost 4444

You will should see this prompt:

Telnet win.png

You can give commands to OpenOCD through this prompt. If you don’t see the prompt on Windows 7, you may need to enable the Telnet client. See Configuring Windows 7 for OpenOCD.

 

Common OpenOCD Commands

To see a full list of OpenOCD commands, enter help in the telnet window.

reset

Resets the Beagleboard XM. The output of the Reset command should look like this:

Beaglexm reset win.png

halt

Sends a halt request to the Beagleboard XM. If the Beagleboard XM halts, you will see text output in the telnet window. (If the Beagleboard XM is already halted, you will see no output.)

Beaglexm halt win.png

halt [timeout]

You can also use halt followed by a time in milliseconds. OpenOCD waits for the target to halt the specified amount of time, then gives up if the target has not halted. You can use this to avoid OpenOCD hanging because the Beagleboard XM fails to halt. For example, to send a halt command with a timeout of one second, type:

halt 1000

resume

Enter resume to end a halt. You will not see any text output in the telnet window.

reg

Displays a numbered list of all of the Beagleboard XM’s registers.

Beaglexm reg win.png

reg [entry]

Run reg with a register number to display the contents of a register, in hexadecimal. The register number corresponds to the output of the reg command with no arguments, above. You must run the halt command before reading registers.

Beaglexm reg0 win.png

If you run reg while the Beagleboard XM is not halted, you will still see the value stored in the register. However, registers change contents very quickly while the device is running; by the time you see the value, the value actually in the register may be different. If you try to run reg while the device is not halted, you will see this:

Beaglexm reg0 nothalted win.png

 

reg [entry] [value]

Sets the value of a register. The register number corresponds to the output of the reg command with no arguments, above. Make sure the Beagleboard XM is halted (with the halt command) before you change the value of a register!

You can enter registry values in either decimal, by typing a number by itself, or in hexadecimal, by prefacing the value with 0x.

Beaglexm regset win.png

 

GDB Debugger

GDB, the GNU Project Debugger is a debugging tool provided with the GNU Compiler Collection (GCC). GDB allows you to stop and start a running program, examine its functioning, and make changes. To install and use GDB with OpenOCD, follow the instructions on the Windows GDB Debugger page below.

Windows GDB Debugger

The GDB debugger page will walk you through installing GDB for use with OpenOCD, and loading and testing a simple program.

Flyswatter2 Pandaboard How To

This guide will walk you through connecting the Flyswatter2 and the TI Pandaboard to your Linux PC, and installing and running OpenOCD. This guide was written with Ubuntu 10.04.

 

Connecting the Flyswatter2 and the Pandaboard

To hook up the Flyswatter2 and the Pandaboard, you will need:

  • 20-pin ARM to 14-pin TI JTAG Adapter Board
  • 14-pin JTAG Ribbon Cable
  • RS-232 Serial Cable with one male, one female head
  • USB Male A/Male B Cable
  • 5V1A Power Cable

Set the EMU pins on the JTAG Adapter Board.

Ti adapter.png

The EMU0 and EMU1 pins should be set to 1. Set both jumpers to the position closest to the 14-pin interface, as in the picture.

 

Connect the JTAG Adapter Board to the Flyswatter2.

Fs2 ti adapter.png

Connect the 20-pin end of the adapter board to the Flyswatter2’s JTAG interface.

 

Connect the 14-pin Ribbon Cable to the JTAG Adapter Board.

Fs2 ti jtag.png

Your cable most likely has a notch on the head to force it into the correct position. If it doesn’t, align Pin 1 on the ribbon cable with the side of the board opposite the EMU pins. (In the picture, Pin 1 is marked by the red stripe on the cable.)

 

Connect the Other End of the Ribbon Cable to the Pandaboard.

Fs2 panda jtag.png

Be sure to align the ribbon cable correctly. Pin 1 on the Pandaboard is the pin closest to the center of the board.

 

Plug in the Serial Cable.

Fs2 panda bothcables.png

Connect the Flyswatter2 and the Pandaboard with the RS-232 serial cable.

 

Connect the USB cable to the Flyswatter2.

Fs2 panda usb.png

Find the USB cable that comes with the Flyswatter2. Connect the B end (the square end, not the flat end) to the Flyswatter.

 

Connect the Power Cable to the Pandaboard.

Fs2 panda power.png

The Pandaboard’s power adapter is next to the USB and ethernet ports.

 

Plug the Power Adapter into a Wall Outlet.

The green power LED on the Pandaboard should come on and remain on.

Plug the USB Cable into your PC.

The green power LED on the Flyswatter2 should come on and remain on.
 

Installing OpenOCD

OpenOCD (Open On-Chip Debugger) is open-source software that interfaces with the Flyswatter2. OpenOCD provides debugging and in-system programming for embedded target devices. You will need to compile OpenOCD from source, and patch the source with one of the OpenOCD Patches for Flyswatter 3 support.

Whichever guide you use, be sure to install the patch! Both guides include instructions on downloading and installing the patch.
Compiling OpenOCD Linux

Compiling OpenOCD Linux D2XX
The first set of instructions uses libFTDI, an open-source driver library for FTDI devices. The second set uses FTD2XX, a closed-source driver library from Future Technology Devices International.

 

Running OpenOCD

Now you are ready to run OpenOCD. If you installed the OpenOCD Ubuntu package, open a terminal window and type the following from any directory:

openocd -f interface/flyswatter2.cfg -f board/ti_pandaboard.cfg

If you compiled OpenOCD yourself, navigate to the openocd-bin directory you created in the compile guide and type:

cd ~/openocd-bin
sudo ./openocd -f interface/flyswatter2.cfg -f board/ti_pandaboard.cfg

For more information, see Running OpenOCD on Linux. When you start OpenOCD, its output should look like this:

Panda ocdstartup.png

Telnet Connection

You cannot enter commands directly to OpenOCD. Open a new terminal window and type:

telnet localhost 4444

You will should see this prompt:

Telnet.png

You can give commands to OpenOCD through this prompt.

 

Common OpenOCD Commands

To see a full list of OpenOCD commands, enter help in the telnet window.

reset

Resets the Pandaboard. The output of the Reset command should look like this:

Panda reset.png

halt

Sends a halt request to the Pandaboard. If the Pandaboard halts, you will see text output in the telnet window. (If the Pandaboard is already halted, you will see no output.)

Panda halt.png

halt [timeout]

You can also use halt followed by a time in milliseconds. OpenOCD waits for the target to halt the specified amount of time, then gives up if the target has not halted. You can use this to avoid OpenOCD hanging because the Pandaboard fails to halt. For example, to send a halt command with a timeout of one second, type:

halt 1000

resume

Enter resume to end a halt. You will not see any text output in the telnet window.

reg

Displays a numbered list of all of the Pandaboard’s registers.

Panda reg.png

reg [entry]

Run reg with a register number to display the contents of a register, in hexadecimal. The register number corresponds to the output of the reg command with no arguments, above. You must run the halt command before reading registers.

Panda reg0.png

If you run reg while the Pandaboard is not halted, you will still see the value stored in the register. However, registers change contents very quickly while the device is running; by the time you see the value, the value actually in the register may be different. If you try to run reg while the device is not halted, you will see this:

Panda reg0 nothalted.png

 

reg [entry] [value]

Sets the value of a register. The register number corresponds to the output of the reg command with no arguments, above. Make sure the Pandaboard is halted (with the halt command) before you change the value of a register!

You can enter registry values in either decimal, by typing a number by itself, or in hexadecimal, by prefacing the value with 0x.

Panda regset.png

 

GDB Debugger

GDB, the GNU Project Debugger is a debugging tool provided with the GNU Compiler Collection (GCC). GDB allows you to stop and start a running program, examine its functioning, and make changes. GDB is installed on Ubuntu 10.04 by default, but you will need a different version of GDB build for embedded targets. Follow the instructions on the GDB Debugger page below.

GDB Debugger

The GDB debugger page will walk you through installing GDB for use with OpenOCD, and loading and testing a simple program.

Flyswatter2 Pandaboard Windows How To

This guide will walk you through connecting the Flyswatter2 and the TI Pandaboard to your Windows PC, and installing and running OpenOCD. This guide was tested with Windows XP and Windows 7. Instructions are identical on 32-bit and 64-bit versions of Windows unless otherwise noted.

 

Connecting the Flyswatter2 and the Pandaboard

To hook up the Flyswatter2 and the Pandaboard, you will need:

  • 20-pin ARM to 14-pin TI JTAG Adapter Board
  • 14-pin JTAG Ribbon Cable
  • RS-232 Serial Cable with one male, one female head
  • USB Male A/Male B Cable
  • 5V1A Power Cable

Set the EMU pins on the JTAG Adapter Board.

Ti adapter.png

The EMU0 and EMU1 pins should be set to 1. Set both jumpers to the position closest to the 14-pin interface, as in the picture.

 

Connect the JTAG Adapter Board to the Flyswatter2.

Fs2 ti adapter.png

Connect the 20-pin end of the adapter board to the Flyswatter2’s JTAG interface.

 

Connect the 14-pin Ribbon Cable to the JTAG Adapter Board.

Fs2 ti jtag.png

Your cable most likely has a notch on the head to force it into the correct position. If it doesn’t, align Pin 1 on the ribbon cable with the side of the board opposite the EMU pins. (In the picture, Pin 1 is marked by the red stripe on the cable.)

 

Connect the Other End of the Ribbon Cable to the Pandaboard.

Fs2 panda jtag.png

Be sure to align the ribbon cable correctly. Pin 1 on the Pandaboard is the pin closest to the center of the board.

 

Plug in the Serial Cable.

Fs2 panda bothcables.png

Connect the Flyswatter2 and the Pandaboard with the RS-232 serial cable.

 

Connect the USB cable to the Flyswatter2.

Fs2 panda usb.png

Find the USB cable that comes with the Flyswatter2. Connect the B end (the square end, not the flat end) to the Flyswatter.

 

Connect the Power Cable to the Pandaboard.

Fs2 panda power.png

The Pandaboard’s power adapter is next to the USB and ethernet ports.

 

Plug the Power Adapter into a Wall Outlet.

The green power LED on the Pandaboard should come on and remain on.

Plug the USB Cable into your PC.

The green power LED on the Flyswatter2 should come on and remain on.
 

Installing OpenOCD

OpenOCD (Open On-Chip Debugger) is open-source software that interfaces with the Flyswatter2. OpenOCD provides debugging and in-system programming for embedded target devices. You will need to compile OpenOCD from source, and patch the source with one of the OpenOCD Patches for Flyswatter 3 support.

Whichever guide you use, be sure to install the patch! All four guides include instructions on downloading and installing the patch.

Windows 7

Use Windows 7 guides if compiling for Windows Vista.

Compiling OpenOCD Win7

Compiling OpenOCD Win7 D2XX

 

Windows XP

Compiling OpenOCD WinXP

Compiling OpenOCD WinXP D2XX
The first set of instructions uses libFTDI, an open-source driver library for FTDI devices. The second set uses FTD2XX, a closed-source driver library from Future Technology Devices International.

 

Running OpenOCD

Now you are ready to run OpenOCD. Open a command line window; if you’re not sure how to do this, see Running OpenOCD on Windows. Navigate to the folder containing openocd.exe (the openocd-bin folder you created in the compile guide) and type:

cd C:\openocd-bin
openocd -f interface/flyswatter2.cfg -f board/ti_pandaboard.cfg

When you start OpenOCD you should see something like this:

Panda ocdstartup win.png

Telnet Connection

You cannot enter commands directly to OpenOCD. Open a new command window and type:

telnet localhost 4444

You will should see this prompt:

Telnet win.png

You can give commands to OpenOCD through this prompt. If you don’t see the prompt on Windows 7, you may need to enable the Telnet client. See Configuring Windows 7 for OpenOCD.

 

Common OpenOCD Commands

To see a full list of OpenOCD commands, enter help in the telnet window.

reset

Resets the Pandaboard. The output of the Reset command should look like this:

Panda reset win.png

halt

Sends a halt request to the Pandaboard. If the Pandaboard halts, you will see text output in the telnet window. (If the Pandaboard is already halted, you will see no output.)

Panda halt win.png

halt [timeout]

You can also use halt followed by a time in milliseconds. OpenOCD waits for the target to halt the specified amount of time, then gives up if the target has not halted. You can use this to avoid OpenOCD hanging because the Pandaboard fails to halt. For example, to send a halt command with a timeout of one second, type:

halt 1000

resume

Enter resume to end a halt. You will not see any text output in the telnet window.

reg

Displays a numbered list of all of the Pandaboard’s registers.

Panda reg win.png

reg [entry]

Run reg with a register number to display the contents of a register, in hexadecimal. The register number corresponds to the output of the reg command with no arguments, above. You must run the halt command before reading registers.

Panda reg0 win.png

If you run reg while the Pandaboard is not halted, you will still see the value stored in the register. However, registers change contents very quickly while the device is running; by the time you see the value, the value actually in the register may be different. If you try to run reg while the device is not halted, you will see this:

Panda reg0 nothalted win.png

 

reg [entry] [value]

Sets the value of a register. The register number corresponds to the output of the reg command with no arguments, above. Make sure the Pandaboard is halted (with the halt command) before you change the value of a register!

You can enter registry values in either decimal, by typing a number by itself, or in hexadecimal, by prefacing the value with 0x.

Panda regset win.png

 

GDB Debugger

GDB, the GNU Project Debugger is a debugging tool provided with the GNU Compiler Collection (GCC). GDB allows you to stop and start a running program, examine its functioning, and make changes. To install and use GDB with OpenOCD, follow the instructions on the Windows GDB Debugger page below.

Windows GDB Debugger

The GDB debugger page will walk you through installing GDB for use with OpenOCD, and loading and testing a simple program.

Flyswatter2 RouterStationPro Windows How To

This guide will walk you through connecting the Flyswatter2 and the Ubiquiti RouterStation Pro to your Windows PC, and installing and running OpenOCD. This guide was tested with Windows XP and Windows 7. Instructions are identical on 32-bit and 64-bit versions of Windows unless otherwise noted.

 

Connecting the Flyswatter2 and the RouterStation Pro

To hook up the Flyswatter2 and the RouterStation Pro, you will need:

  • Flyswatter2
    • 20-pin ARM to 14-pin MIPS JTAG Adapter Board
    • USB Male A/Male B Cable
    • 14-pin JTAG Ribbon Cable
  • RouterStationPro
    • RS-232 Serial Cable with two female connectors
    • CAT6 Cable
    • Power Over Ethernet Injector (with power cable)

The items listed under RouterStationPro are included with the MIPS Linux Starter Kit.

Connect the MIPS JTAG Adapter Board to the Flyswatter2.

Fs2 mips adapter.png

The 14-pin end of the adapter board should face up toward the top of the board, as in the picture.

 

Connect the 14-pin ribbon cable to the Adapter Board.

Fs2 mips jtag.png

The ribbon cable should have a notch on the connector to force it into the correct position. If it doesn’t, make sure to align Pin 1 as shown in the image to the left. (Pin 1 is on the side of the cable with the red stripe.)

 

Connect the Other End of the Ribbon Cable to the RouterStation Pro.

Fs2 rspro jtag.png

Again, be sure to align the red stripe with Pin 1, as shown in the picture. Pin 1 is toward the outer edge of the board. It is also marked on the bottom of the RouterStation Pro.

 

Connect the RS-232 Serial Cable.

Fs2 rspro bothcables.png

Connect the cable as shown in the picture.

 

Connect the USB Cable to the Flyswatter2.

Fs2 rspro usb.png

Connect the Male B adapter to the Flyswatter 3. (The Male B end is the squarish end, not the flat end.)

 

Connect the CAT6 Cable to the Power Over Ethernet Injector.

Poe cat6.png

Leave the boards alone for now. Find the Power Over Ethernet Injector in the MIPS Linux Starter Kit, and connect the CAT6 cable. The PoE injector has two ethernet ports, but only one supplies power. Be sure to use the correct one. The correct ethernet port is labeled.

 

Connect the Power Adapter to the Power Over Ethernet Injector.

Poe power.png

Connect the power cable to the other side of the PoE injector.

 

Connect the Other End of the CAT6 Cable to the RouterStation Pro.

Rspro poe.png

Connect the CAT6 cable to the RouterStation Pro’s Power Over Ethernet port. Warning: The RouterStation Pro has three ethernet ports in addition to the PoE port. Connecting the PoE injector to one of the regular ethernet ports may damage the board. The PoE port is the closest to the center of the board, to the right of the three ethernet ports as shown in the picture. It is labeled POE on the board.

 

Plug the Power Adapter into a Wall Outlet.

The green LEDs on the RouterStation Pro should briefly flash, and the leftmost LED should remain on.

Plug the USB Cable into your PC.

The green power LED on the Flyswatter2 should come on and remain on.
 

Installing OpenOCD

OpenOCD (Open On-Chip Debugger) is open-source software that interfaces with the Flyswatter2. OpenOCD provides debugging and in-system programming for embedded target devices. You will need to compile OpenOCD from source, and patch the source with one of the OpenOCD Patches for Flyswatter 3 support.

Whichever guide you use, be sure to install the patch! All four guides include instructions on downloading and installing the patch.

Windows 7

Use Windows 7 guides if compiling for Windows Vista.

Compiling OpenOCD Win7

Compiling OpenOCD Win7 D2XX

 

Windows XP

Compiling OpenOCD WinXP

Compiling OpenOCD WinXP D2XX
The first set of instructions uses libFTDI, an open-source driver library for FTDI devices. The second set uses FTD2XX, a closed-source driver library from Future Technology Devices International.

 

Running OpenOCD

Now you are ready to run OpenOCD. Open a command line window; if you’re not sure how to do this, see Running OpenOCD on Windows. Navigate to the folder containing openocd.exe (the openocd-bin folder you created in the compile guide) and type:

cd C:\openocd-bin
openocd -f interface/flyswatter2.cfg -c "jtag_khz 15000" -f target/ar71xx.cfg

When you start OpenOCD you should see something like this:

rspro ocdstartup win.png

Telnet Connection

You cannot enter commands directly to OpenOCD. Open a new command window and type:

telnet localhost 4444

You will should see this prompt:

Telnet win.png

You can give commands to OpenOCD through this prompt. If you don’t see the prompt on Windows 7, you may need to enable the Telnet client. See Configuring Windows 7 for OpenOCD.

 

Common OpenOCD Commands

To see a full list of OpenOCD commands, enter help in the telnet window.

reset

Resets the RouterStation Pro. The output of the Reset command should look like this:

Rspro reset win.png

halt

Sends a halt request to the RouterStation Pro. If the RouterStation Pro halts, you will see text output in the telnet window. (If the RouterStation Pro is already halted, you will see no output.)

Rspro halt win.png

halt [timeout]

You can also use halt followed by a time in milliseconds. OpenOCD waits for the target to halt the specified amount of time, then gives up if the target has not halted. You can use this to avoid OpenOCD hanging because the RouterStation Pro fails to halt. For example, to send a halt command with a timeout of one second, type:

halt 1000

resume

Enter resume to end a halt. You will not see any text output in the telnet window.

reg

Displays a numbered list of all of the RouterStation Pro’s registers.

Rspro reg win.png

If the board is not halted, the board registers will be displayed but not their values.

reg [entry]

Run reg with a register number to display the contents of a register, in hexadecimal. The register number corresponds to the output of the reg command with no arguments, above. You must run the halt command before reading registers.

Rspro reg0 win.png

If you run reg while the RouterStation Pro is not halted, you will still see the value stored in the register. However, registers change contents very quickly while the device is running; by the time you see the value, the value actually in the register may be different. If you try to run reg while the device is not halted, you will see this:

Rspro reg0nothalted win.png

Note that the RouterStation Pro does not show any warning if you run the reg command while the board is running.

 

reg [entry] [value]

Sets the value of a register. The register number corresponds to the output of the reg command with no arguments, above. Make sure the RouterStation Pro is halted (with the halt command) before you change the value of a register!

You can enter registry values in either decimal, by typing a number by itself, or in hexadecimal, by prefacing the value with 0x.

Rspro regset win.png

 

GDB Debugger

GDB, the GNU Project Debugger is a debugging tool provided with the GNU Compiler Collection (GCC). GDB allows you to stop and start a running program, examine its functioning, and make changes. To install and use GDB with OpenOCD, follow the instructions on the Windows GDB Debugger page below.

Windows GDB Debugger

The GDB debugger page will walk you through installing GDB for use with OpenOCD, and loading and testing a simple program.

Flyswatter2 LPC2214 How To

This guide will walk you through connecting the Flyswatter2 and the mikroElektronika mikroBoard for ARM 144-pin to your Linux PC, and installing and running OpenOCD. The mikroBoard used in this guide is mounted on the MikroElektronika UNI-DS6 development system.

This guide was written for Ubuntu 12.04 LTS.

 

Connecting the Flyswatter2 and the LPC2214 mikroBoard

To hook up the Flyswatter2 and the LPC2214 mikroBoard, you will need:

  • Flyswatter2
    • USB Male A/Male B Cable
    • 20-pin JTAG Ribbon Cable
  • MikroElektronika mikroBoard for ARM 144-Pin (LPC2214)
  • MikroElektronika UNI-DS6 development system
    • 9V DC Power Cable

 

Mount the mikroBoard LPC2214 on the UNI-DS6 motherboard

uni-ds6 top.jpg

Look for the silkscreen “mikroBoard Socket” on your UNI-DS6. Carefully align the pins on the bottom of the mikroBoard with the socket, and press firmly on all four corners to secure the connection. Make sure the 20-pin JTAG and mini-USB connectors are oriented to the top of the board.

Your UNI-DS6 and mikroBoard may have shipped with the mikroBoard already mounted, as shown in the picture to the left. If so, skip this step.

Check the Jumper Settings on the UNI-DS6 motherboard.

unids6 power jumper.png

The LPC2214 mikroBoard has 3.3V I/O so you must set the UNI-DS6 motherboard to 3.3V I/O as well. Set the J16 jumper to 3.3V as shown in the picture. This is located in the upper left corner of the motherboard in the POWER SUPPLY section.

 

Check the Jumper Settings on the mikroBoard.

mikroboard jumpers .png

The J1 “ENABLE” jumper should be connected (shorted) and the J2 “STANDALONE” jumper should be left open, as shown in the image to the left.

Note: You can leave the J2 jumper installed at a 90 degree angle so you will not loose the yellow jumper.

Connect the JTAG cable to the Flyswatter2.

fs2 jtag20.png

Plug the 20-pin ribbon cable into the Flyswatter2’s JTAG interface. Note the position of PIN 1, indicated by the red stripe on the cable in the image.

 

Connect the Flyswatter2’s 20-pin JTAG cable to the mikroBoard.

fs2 ribbon jtag.jpg

Connect the Flyswatter2’s 20-pin JTAG ribbon cable to the mikroBoard’s JTAG interface. The mikroBoard’s JTAG interface does not have a shrouded header to prevent connecting the cable “backwards”, so take careful note of the position of the pins. Pin #1 on the mikroBoard is on the inner left, marked on the board with a small white triangle. Make sure it aligns with Pin #1 on the ribbon cable. In the picture to the left, Pin #1 is marked with a red stripe on the cable.

 

 

unids6 fs2a.jpg

Notice the “loop” in the JTAG ribbon cable. This “loop” helps align Pin #1 on the JTAG ribbon cable connector to Pin #1 on the mikroBoard’s JTAG connector.

 

Connect the USB Cable to the Flyswatter2.

unids6 fs2 usb.png

Find the USB cable that comes with the Flyswatter2. Connect the B end (the square end, not the flat end) to the Flyswatter2.

 

Connect the Other End of the USB Cable to your PC.

Plug the USB cable into your PC, connecting it to the Flyswatter 2. You should see the green “Power” LED light up on the Flyswatter2.

Connect the Power Cable to the UNI-DS6.

unids6 fs2 power.jpg

Connect the 9V-DC power cable to the Uni-DS6’s power jack (connector). The power jack is at the UNI-DS6’s upper left corner.

 

Plug the Power Cable into a Wall Outlet.

The UNI-DS6 has a power switch, so if the power is OFF you won’t see anything happen.

Set the UNI-DS6’s Power Switch to ON.

unids6 power labeled.jpg

The power switch is just below the power adapter. Slide the switch to the right to turn power ON. The power LED should illuminate.

 

 

Installing OpenOCD

OpenOCD (Open On-Chip Debugger) is open-source software that interfaces with the Flyswatter2. OpenOCD provides debugging and in-system programming for embedded target devices. You will need to compile OpenOCD from source. For instructions, see the guide below:

Compiling OpenOCD v07 Linux

 

The LPC2214 Config File

OpenOCD uses specific configuration files for different devices. The config file for the Flyswatter2 is included with OpenOCD, but you will need to download or create a config file for the mikroBoard LPC2214. You can download the file here:

Download lpc2214.cfg (Right Click and “Save As”)

 

Or you can create the file yourself. Open a text editor and create a new file called lpc2214.cfg. Select the following text and copy it all into the file:

jtag_rclk 500
source [find target/lpc2xxx.cfg]
reset_config trst_and_srst srst_pulls_trst

proc init_targets {} {
	echo "Warning - assuming default core clock 14MHz! Flashing may fail if actual core clock is different."
	setup_lpc2xxx lpc2214 0x4f1f0f0f 0x40000 lpc2000_v1 0x4000 14000 1666
}

Save the file into OpenOCD’s /target/ directory. If you followed the compile guides above, you can find the /target/ directory
at
~/openocd-bin/target.

 

Running OpenOCD

Now you are ready to run OpenOCD. If you installed the OpenOCD Ubuntu package, open a terminal window and type the following from any directory:

openocd -f interface/flyswatter2.cfg -f target/lpc2214.cfg -c init -c "reset init"

If you compiled OpenOCD yourself, navigate to the openocd-bin directory you created in the compile guide and type:

cd ~/openocd-bin
sudo ./openocd -f interface/flyswatter2.cfg -f target/lpc2214.cfg -c init -c "reset init"

Your terminal window should now look something like this:

ocdstartup lpc2214.png

Pay careful attention to this line:

Info : JTAG tap: lpc2214.cpu tap/device found: 0x4f1f0f0f (mfg: 0x787, part: 0xf1f0, ver: 0x4)

If you don’t see that, you’ve got an error of some kind. Check the connections on the JTAG ribbon cable or refer to OpenOCD Troubleshooting, and try again.

Telnet Connection

You cannot enter commands directly into OpenOCD. Open a new terminal window and start a telnet session by typing:

telnet localhost 4444

You will should see this prompt:

Telnet.png

You can give commands to OpenOCD through this prompt.

Common OpenOCD Commands

To see a full list of OpenOCD commands, enter help in the telnet window.

reset

Resets the mikroBoard. The output of the Reset command should look like this:

lpc2214 ocdreset.png

Notice the two warnings about slow performance. If you want to speed up the board, you can enable fast memory access and DCC downloads by entering:

> arm7_9 fast_memory_access enable
> arm7_9 dcc_downloads enable

LPC2214 fastenable.png

With fast memory access and DCC downloads enabled, you should be able to reset the board with no warnings:

LPC2214 reset.png

halt

Sends a halt request to the mikroBoard. If the mikroBoard halts, you will see text output in the telnet window. (If the mikroBoard is already halted, you will see no output.)

lpc2214 ocdhalt.png

halt [timeout]

You can also use halt followed by a time in milliseconds. OpenOCD waits for the target to halt the specified amount of time, then gives up if the target has not halted. You can use this to avoid OpenOCD hanging because the mikroBoard fails to halt. For example, to send a halt command with a timeout of one second, type:

halt 1000

resume

Enter resume to end a halt. You will not see any text output in the telnet window.

reg

Displays a numbered list of all of the mikroBoard’s registers.

lpc2214 ocdreg.png

reg [entry]

Run reg with a register number to display the contents of a register, in hexadecimal. The register number corresponds to the output of the reg command with no arguments, above. You must run the halt command before reading registers.

lpc2214 reg0.png

If you run reg while the mikroBoard is not halted, you will still see the value stored in the register. However, registers change contents very quickly while the device is running; by the time you see the value, the value actually in the register may be different. If you try to run reg while the device is not halted, you will see this:

lpc2214 reg0 nothalted.png

 

reg [entry] [value]

Sets the value of a register. The register number corresponds to the output of the reg command with no arguments, above. Make sure the mikroBoard is halted (with the halt command) before you change the value of a register!

You can enter registry values in either decimal, by typing a number by itself, or in hexadecimal, by prefacing the value with 0x.

lpc2214 ocdregset.png

 

Setting up Eclipse for ARM Cross-Development and Debugging

For information on setting up cross-development toolchain, Eclipse, and GDB Debugger for use with the UNI-DS6 and mikroBoard, see the following guide:

LPC2214 Eclipse and GDB

Flyswatter2 PIC32MX How To

This guide will walk you through connecting the Flyswatter2 and the Olimex PIC-P32MX board to your Linux PC, and installing and running OpenOCD. This guide was written with Ubuntu 10.04.

 

Connecting the Flyswatter2 and the Olimex Development Board

To hook up the Flyswatter2 and the PIC-P32MX board, you will need:

 

Connect the MIPS JTAG Adapter Board to the Flyswatter2.

Fs2 mips adapter.png

The 14-pin end of the adapter board should face up toward the top of the board, as in the picture.

 

Connect the 14-pin ribbon cable to the Adapter Board.

Fs2 mips jtag.png

The ribbon cable should have a notch on the connector to force it into the correct position. If it doesn’t, make sure to align Pin 1 as shown in the image to the left. (Pin 1 is on the side of the cable with the red stripe.)

 

Connect the JTAG cable to the PIC-P32MX.

Fs2 pic32mx jtagcable.png

The PIC-32MX has a 10-pin and a 14-pin port. Connect the ribbon cable to the 14-pin port, the one closest to the printed word “Olimex.” If your cable doesn’t have a notch to force it into the correct position, be sure to align Pin 1 as shown in the picture.

 

Connect the RS232 Serial Cable.

Fs2 pic32mx connected.png

Plug the serial cable into the Flyswatter2 and the Olimex board’s RS232 ports. Tighten the screws on either side of the cable heads to hold the connections in place.

 

Connect the USB cable to the Flyswatter2.

Fs2 pic32mx usb.png

Connect the Male B head of the USB cable to the Flyswatter2. The Male B head is the squarish head, not the flat one.

 

Plug the 9V power adapter into a wall outlet.

9vdc.png 9vdc walloutlet.png

Plug the power adapter into the PIC-P32MX.

Fs2 pic32mx 9vpowered.png

There are two LEDs next to the board’s power adapter. You should see the red one light up.

 

Connect the USB cable to your PC.

You should see a green LED light up on the Flyswatter2.
 

Installing OpenOCD

OpenOCD (Open On-Chip Debugger) is open-source software that interfaces with the Flyswatter2. OpenOCD provides debugging and in-system programming for embedded target devices. You will need to compile OpenOCD from source, and patch the source with one of the OpenOCD Patches for Flyswatter 3 support.

Whichever guide you use, be sure to install the patch! Both guides include instructions on downloading and installing the patch.
Compiling OpenOCD Linux

Compiling OpenOCD Linux D2XX
The first set of instructions uses libFTDI, an open-source driver library for FTDI devices. The second set uses FTD2XX, a closed-source driver library from Future Technology Devices International.

 

Running OpenOCD

Now you are ready to run OpenOCD. If you installed the OpenOCD Ubuntu package, open a terminal window and type the following from any directory:

openocd -f interface/flyswatter2.cfg -f board/olimex_pic32mx.cfg

If you compiled OpenOCD yourself, navigate to the openocd-bin directory you created in the compile guide and type:

cd ~/openocd-bin
sudo ./openocd -f interface/flyswatter2.cfg -f board/olimex_pic32mx.cfg

For general information on running OpenOCD, see Running OpenOCD on Linux. When you start OpenOCD, you should see this:
Openocd fs3 pic32mx.png

Telnet Connection

You cannot enter commands directly to OpenOCD. Open a new terminal window and type:

telnet localhost 4444

You will should see this prompt:

Telnet.png

You can give commands to OpenOCD through this prompt.

 

Common OpenOCD Commands

To see a full list of OpenOCD commands, enter help in the telnet window.

reset

Resets the PIC-P32MX. The output of the Reset command should look like this:

Pic32mx reset.png

halt

Sends a halt request to the PIC-P32MX. If the PIC-P32MX halts, you will see text output in the telnet window. (If the PIC-P32MX is already halted, you will see no output.)

Pic32mx halt.png

halt [timeout]

You can also use halt followed by a time in milliseconds. OpenOCD waits for the target to halt the specified amount of time, then gives up if the target has not halted. You can use this to avoid OpenOCD hanging because the PIC-P32MX fails to halt. For example, to send a halt command with a timeout of one second, type:

halt 1000

resume

Enter resume to end a halt. You will not see any text output in the telnet window.

reg

Displays a numbered list of all of the PIC-P32MX’s registers.

Pic32mx reg.png

reg [entry]

Run reg with a register number to display the contents of a register, in hexadecimal. The register number corresponds to the output of the reg command with no arguments, above. You must run the halt command before reading registers.

Pic32mx reg0.png

If you run reg while the PIC-P32MX is not halted, you will still see the value stored in the register. However, registers change contents very quickly while the device is running; by the time you see the value, the value actually in the register may be different. If you try to run reg while the device is not halted, you will see this:

Pic32mx reg0 nothalted.png

Note that unlike with some other boards, OpenOCD provides no warning that the device is not halted. Be careful.

 

reg [entry] [value]

Sets the value of a register. The register number corresponds to the output of the reg command with no arguments, above. Make sure the PIC-P32MX is halted (with the halt command) before you change the value of a register!

You can enter registry values in either decimal, by typing a number by itself, or in hexadecimal, by prefacing the value with 0x.

Pic32mx regset.png

 

GDB Debugger

GDB, the GNU Project Debugger is a debugging tool provided with the GNU Compiler Collection (GCC). GDB allows you to stop and start a running program, examine its functioning, and make changes. GDB is installed on Ubuntu 10.04 by default, but you will need a different version of GDB build for embedded targets. Follow the instructions on the GDB Debugger page below.

GDB Debugger

The GDB debugger page will walk you through installing GDB for use with OpenOCD, and loading and testing a simple program.

Flyswatter2 BeagleBone Black How To

This guide will walk you through connecting the Flyswatter2 and the BeagleBone Black board to your Linux PC, and installing and running OpenOCD. This guide was written with Ubuntu 12.04 LTS.

Connecting the Flyswatter2 to the BeagleBone Black

To connect the Flyswatter2 and the BeagleBone Black, you will need the following:

  • Flyswatter2 USB JTAG Debugger
  • ARM20cTI20 – ARM 20-pin to cTI 20-pin JTAG Adapter Board
  • 20-pin ribbon cable
  • USB Male A/Male B Cable (included with the Flyswatter2)
  • mini USB Cable assembly (included with the BeagleBone Black)

Locate the connector pads for P2 on the back side of the BeagleBone Black board

black P2 backside.jpg

Locate P2 on the back side of the BeagleBone Black board.

The BeagleBone Black board comes from the factory without the 20-pin male JTAG header installed. In order to use JTAG with the BeagleBone Black board you must hand solder the cTI 20-pin male JTAG header onto the back of the BeagleBone Black board at location P2 (circled in yellow).

 

Take note of P2 pin numbers

black P2 zoom.jpg

Note the locations of the following pins: pin #1 and especially pin #6 which is marked: “KEY–“. You will use the “KEY” pin to correctly position the 20-pin unshrouded male header (cTI 20-pin).

 

Center the cTI 20-pin male header pins on the P2 pads.

black P2 zoom2.jpg

Align the cTI 20-pin unshrouded male header so that the missing pin on the male header is aligned with pin #6 marked as “KEY–“.

Make sure the connector pins are centered on the P2 surface mount pads on the pcb.

Ensure the missing pin is aligned to the key pad

black P2 zoom3.jpg

Notice how the missing pin on the male header is positioned to align with the 3rd pad from the bottom right (the key pad).

 

Solder each pin of the male header to the board

black P2 soldered.jpg

Make sure each pin of the 20-pin male header is centered on each surface mount pad on P2. Then using a low wattage soldering iron, heat each individual pin at the junction of the male pin and the P2 surface mount pad and apply a small amount of lead-free solder. You must use lead-free solder to maintain the board’s RoHS (lead-free) status. Use the minimum amount of heat to get the solder flowing and make a good electrical connection. Over heating the pin can cause the male header plastic base to melt and ruin the connector. There is no need to heat pin #6 (the key pin) since it is not connected.

After you complete soldering all of the pins, double check each pin and make sure there is no solder shorts between adjacent pins. You can use a cotton tipped swab or small toothbrush dipped in isopropyl alcohol to clean and remove any residual solder flux. Removing the sold flux from the board is optional. The solder flux will not cause any electrical problems with the board. Cleaning the board is simply to improve the looks of the board.

 

Double check the cTI 20-pin connector and make sure it is vertical to the surface of the BeagleBone Black

black cTI20 soldered.jpg

The cTi 20-pin male header should be positioned vertically on the BeagleBone Black board like it is shown in this photo.

Make sure there are no solder shorts between any pins on the male header. Also, if you cleaned the board with isopropyl alcohol, make sure all of the isopropyl alcohol has evaporated and the the BeagleBone Black board is completely dry before applying any power to the board.

Attach the four standoffs to the back of the BeagleBone Black board

black 4 standoffs.jpg

To protect the unshrouded 20-pin male JTAG header from damage we must raise the BeagleBone Black board up off the surface. This is accomplished by attaching the four standoffs to the back of the BeagleBone Black board using the four #4-40 machine screws.

The four hex standoffs are 1 inch long. This raises up the BeagleBone Black board up high enough so that the ARM20cTI20 JTAG Adapter board will clear the surface.

Connect the ARM20cTI20 JTAG Adapter to the BeagleBone Black Board.

black cTi20 4 attached.jpg

Plug the ARM20cTI20 JTAG adapter board into the male header at location P2. Make sure you align the key to the missing pin on the cTI20 male header.

 

Connect the 20-pin ribbon cable to the ARM20cTI20 JTAG Adapter

ARM20cTI20 ribbon cable.jpg

Plug the 20-pin ribbon cable into the ARM20cTI20 JTAG adapter board.

 

Position the 20-pin ribbon cable coming from the ARM20cTI20 JTAG Adapter

black ribbon folded.jpg

Flip the BeagleBone Black board over so that its upright. Fold the 20-pin ribbon cable so that its positioned as shown in the photo to the left. This will orient the ribbon cable connector so that it will easily plug into the Flyswatter2’s JTAG connector.

 

Connect the 20-Pin Ribbon Cable to the Flyswatter2.

black fs2 20pin ribbon.jpg

Plug the 20-pin ribbon cable into the Flyswatter2.

Plug the mini USB cable into the BeagleBone Black and the other end into the PC.

Plug the USB cable into the Flyswatter2 and the other end into the PC. The green LED should illuminate and indicate power is on.
 

Installing OpenOCD

OpenOCD (Open On-Chip Debugger) is open-source software that interfaces with the BeagleBone Black. OpenOCD provides debugging and in-system programming for embedded target devices. You will need to compile OpenOCD from source. For instructions, see the guide below:

Compiling OpenOCD v07 Linux

 

The BeagleBone Black Config File

OpenOCD uses specific configuration files for different devices. The config file for the Flyswatter2 is included with OpenOCD. A config file for the Beaglebone Black is also included, but it isn’t compatible with the file for the Flyswatter2. Download the config file below:

Download ti_beaglebone_with_fs2.cfg (Right Click and “Save As”)

Save the file into OpenOCD’s /board/ directory. If you followed the compile guide above, you can find the /board/ directory at
~/openocd-bin/board.

 

Running OpenOCD

Now you are ready to run OpenOCD. If you compiled OpenOCD yourself following the guide above, open a terminal window and enter:

cd ~/openocd-bin
sudo ./openocd -f interface/flyswatter2.cfg -f board/ti_beaglebone_with_fs2.cfg -c init -c "reset init"

Your terminal window should now look something like this:

bbone ocdstartup.png

Pay careful attention to this line:

Info : JTAG tap: am335x.jrc tap/device found: 0x1b94402f (mfg: 0x017, part: 0xb944, ver: 0x1)

If you don’t see that, you have an error of some kind. Refer to [OpenOCD Troubleshooting] and try again.

 

JTAG-DP_STICKY_ERROR on startup

The -c init -c “reset init” commands in the OpenOCD startup are a workaround for a bug in OpenOCD that affects the Beagleboard product line. If you start OpenOCD without these commands, you will see errors like this:

bbone jtag dp sticky.png

If you see these errors, then the next time you try to start OpenOCD it will give an error the next time it tries to communicate with the BeagleBone Black. When you exit OpenOCD you will need to disconnect and reconnect the power cable to the Flyswatter2 before OpenOCD will be able to communicate with the board again.

 

Telnet Connection

You cannot enter commands directly into OpenOCD. Open a new terminal window and start a telnet session by typing:

telnet localhost 4444

You will should see this prompt:

Telnet.png

You can give commands to OpenOCD through this prompt.

 

Common OpenOCD Commands

To see a full list of OpenOCD commands, enter help in the telnet window.

reset

Resets the BeagleBone Black. The output of the Reset command should look like this:

bbone ocdreset.png

halt

Sends a halt request to the BeagleBone Black. If the BeagleBone Black halts, you will see text output in the telnet window. (If the BeagleBone Black is already halted, you will see no output.)
bbone ocdhalt.png

halt [timeout]

You can also use halt followed by a time in milliseconds. OpenOCD waits for the target to halt the specified amount of time, then gives up if the target has not halted. You can use this to avoid OpenOCD hanging because the BeagleBone Black fails to halt. For example, to send a halt command with a timeout of one second, type:

halt 1000

resume

Enter resume to end a halt. You will not see any text output in the telnet window.

reg

Displays a numbered list of all of the BeagleBone Black’s registers.

bbone ocdreg.png

reg [entry]

Run reg with a register number to display the contents of a register, in hexadecimal. The register number corresponds to the output of the reg command with no arguments, above. You must run the halt command before reading registers.

bbone ocdreg0.png

If you run reg while the BeagleBone Black is not halted, you will still see the value stored in the register. However, registers change contents very quickly while the device is running; by the time you see the value, the value actually in the register may be different. If you try to run reg while the device is not halted, you will see this:

bbone ocdreg0 nothalted.png

 

reg [entry] [value]

Sets the value of a register. The register number corresponds to the output of the reg command with no arguments, above. Make sure the BeagleBone Black is halted (with the halt command) before you change the value of a register!

You can enter registry values in either decimal, by typing a number by itself, or in hexadecimal, by prefacing the value with 0x.

bbone ocdregset.png

 

shutdown

Shuts down OpenOCD cleanly. Also ends your Telnet session. Use this to exit OpenOCD instead of Ctrl-C.

bbone shutdown.png

 

Setting up Eclipse for ARM Cross-Development and Debugging

For information on setting up cross-development toolchain, Eclipse, and GDB Debugger for use with the BeagleBone Black, see the following guide:

BeagleBone Black Eclipse and GDB

Flyswatter2 LPC2148 How To

This guide will walk you through connecting the Flyswatter2 and the Olimex LPC-P2148 Prototype Board to your Linux PC, and installing and running OpenOCD. This guide was written with Ubuntu 10.04.

 

Connecting the Flyswatter2 and the LPC2148 board

To hook up the Flyswatter2 and the LPC2148 board, you will need:

 

Connect the RS-232 Cable to the Flyswatter2.

Fs2 rs323.png

 

Connect the Other End of the Ribbon Cable to the LPC2148 board.

Fs2 lpc2148 rs323.png

There are two serial ports on the LPC2148. Either will work. If you use the port on the left (not the one shown in the picture), be sure the two switches in the blue housing near the port are set to OFF.

 

Connect the JTAG Cable.

Fs2 lpc2148 connected.png

Your cable should have a notch on each end to force it into correct alignment on the pins. If it doesn’t align Pin 1 as shown in the image to the left. The red stripe on the cable marks Pin 1.

 

Connect the USB cable to the Flyswatter2.

Fs2 lpc2148 usb.png

Find the USB cable that comes with the Flyswatter2. Connect the B end (the square end, not the flat end) to the Flyswatter2.

 

Connect the Power Adapter to the LPC2148 board.

Fs2 lpc2148 power.png

The LPC2148 board’s power supply is next to the right serial port.

 

Plug the Power Adapter into a Wall Outlet.

The red LED next to the LPC2148 board’s power supply should come on and remain on.

Plug the USB Cable into your PC.

The green power LED on the Flyswatter2 should come on and remain on.

Installing OpenOCD

OpenOCD (Open On-Chip Debugger) is open-source software that interfaces with the Flyswatter2. OpenOCD provides debugging and in-system programming for embedded target devices. You will need to compile OpenOCD from source, and patch the source with one of the OpenOCD Patches for Flyswatter 3 support.

Whichever guide you use, be sure to install the patch! Both guides include instructions on downloading and installing the patch.
Compiling OpenOCD Linux

Compiling OpenOCD Linux D2XX
The first set of instructions uses libFTDI, an open-source driver library for FTDI devices. The second set uses FTD2XX, a closed-source driver library from Future Technology Devices International.

 

Running OpenOCD

Now you are ready to run OpenOCD. If you installed the OpenOCD Ubuntu package, open a terminal window and type the following from any directory:

openocd -f interface/flyswatter2.cfg -f board/olimex_lpc_h2148.cfg

If you compiled OpenOCD yourself, navigate to the openocd-bin directory you created in the compile guide and type:

cd ~/openocd-bin
sudo ./openocd -f interface/flyswatter2.cfg -f board/olimex_lpc_h2148.cfg

For general information on running OpenOCD, see Running OpenOCD on Linux. When you start OpenOCD, you should see this:

LPC2148 ocdstartup.png

You should also hear a high-pitched beep from the buzzer on the LPC2148 board.

Telnet Connection

You cannot enter commands directly to OpenOCD. Open a new terminal window and type:

telnet localhost 4444

You will should see this prompt:

Telnet.png

You can give commands to OpenOCD through this prompt.

 

Common OpenOCD Commands

To see a full list of OpenOCD commands, enter help in the telnet window.

reset

Resets the LPC2148 board. The output of the Reset command should look like this:

Lpc2148 reset warnings.png

You should also hear a high-pitched beep from the board’s buzzer.

Notice the two warnings about slow performance. If you want to speed up the board, you can enable fast memory access and DCC downloads by entering:

> arm7_9 fast_memory_access enable
> arm7_9 dcc_downloads enable

LPC2148 fastenable.png

With fast memory access and DCC downloads enabled, you should be able to reset the board with no warnings:

LPC2148 reset.png

halt

Sends a halt request to the LPC2148 board. If the LPC2148 board halts, you will see text output in the telnet window. (If the LPC2148 board is already halted, you will see no output.)

Lpc2148 halt.png

halt [timeout]

You can also use halt followed by a time in milliseconds. OpenOCD waits for the target to halt the specified amount of time, then gives up if the target has not halted. You can use this to avoid OpenOCD hanging because the LPC2148 board fails to halt. For example, to send a halt command with a timeout of one second, type:

halt 1000

resume

Enter resume to end a halt. You will not see any text output in the telnet window.

reg

Displays a numbered list of all of the LPC2148 board’s registers.

Lpc2148 reg.png

reg [entry]

Run reg with a register number to display the contents of a register, in hexadecimal. The register number corresponds to the output of the reg command with no arguments, above. You must run the halt command before reading registers.

Lpc2148 reg0.png

If you run reg while the LPC2148 board is not halted, you will still see the value stored in the register. However, registers change contents very quickly while the device is running; by the time you see the value, the value actually in the register may be different. If you try to run reg while the device is not halted, you will see this:

Lpc2148 reg0 nothalted.png

 

reg [entry] [value]

Sets the value of a register. The register number corresponds to the output of the reg command with no arguments, above. Make sure the LPC2148 board is halted (with the halt command) before you change the value of a register!

You can enter registry values in either decimal, by typing a number by itself, or in hexadecimal, by prefacing the value with 0x.

Lpc2148 regset.png

 

GDB Debugger

GDB, the GNU Project Debugger is a debugging tool provided with the GNU Compiler Collection (GCC). GDB allows you to stop and start a running program, examine its functioning, and make changes. GDB is installed on Ubuntu 10.04 by default, but you will need a different version of GDB build for embedded targets. Follow the instructions on the GDB Debugger page below.

GDB Debugger

The GDB debugger page will walk you through installing GDB for use with OpenOCD, and loading and testing a simple program.

Flyswatter2 LPC2148 Windows How To

This guide will walk you through connecting the Flyswatter2 and the Olimex LPC-P2148 Prototype Board to your Windows PC, and installing and running OpenOCD. This guide was tested with Windows XP and Windows 7. Instructions are identical on 32-bit and 64-bit versions of Windows unless otherwise noted.

 

Connecting the Flyswatter2 and the LPC2148 board

To hook up the Flyswatter2 and the LPC2148 board, you will need:

 

Connect the RS-232 Cable to the Flyswatter2.

Fs2 rs323.png

 

Connect the Other End of the Ribbon Cable to the LPC2148 board.

Fs2 lpc2148 rs323.png

There are two serial ports on the LPC2148. Either will work. If you use the port on the left (not the one shown in the picture), be sure the two switches in the blue housing near the port are set to OFF.

 

Connect the JTAG Cable.

Fs2 lpc2148 connected.png

Your cable should have a notch on each end to force it into correct alignment on the pins. If it doesn’t align Pin 1 as shown in the image to the left. The red stripe on the cable marks Pin 1.

 

Connect the USB cable to the Flyswatter2.

Fs2 lpc2148 usb.png

Find the USB cable that comes with the Flyswatter2. Connect the B end (the square end, not the flat end) to the Flyswatter2.

 

Connect the Power Adapter to the LPC2148 board.

Fs2 lpc2148 power.png

The LPC2148 board’s power supply is next to the right serial port.

 

Plug the Power Adapter into a Wall Outlet.

The red LED next to the LPC2148 board’s power supply should come on and remain on.

Plug the USB Cable into your PC.

The green power LED on the Flyswatter2 should come on and remain on.

Installing OpenOCD

OpenOCD (Open On-Chip Debugger) is open-source software that interfaces with the Flyswatter2. OpenOCD provides debugging and in-system programming for embedded target devices. You will need to compile OpenOCD from source, and patch the source with one of the OpenOCD Patches for Flyswatter 3 support.

Whichever guide you use, be sure to install the patch! All four guides include instructions on downloading and installing the patch.

Windows 7

Use Windows 7 guides if compiling for Windows Vista.

Compiling OpenOCD Win7

Compiling OpenOCD Win7 D2XX

 

Windows XP

Compiling OpenOCD WinXP

Compiling OpenOCD WinXP D2XX
The first set of instructions uses libFTDI, an open-source driver library for FTDI devices. The second set uses FTD2XX, a closed-source driver library from Future Technology Devices International.

 

Running OpenOCD

Now you are ready to run OpenOCD. Open a command line window; if you’re not sure how to do this, see Running OpenOCD on Windows. Navigate to the folder containing openocd.exe (the openocd-bin folder you created in the compile guide) and type:

cd C:\openocd-bin
openocd -f interface/flyswatter2.cfg -f board/olimex_lpc_h2148.cfg

For general information on running OpenOCD, see Running OpenOCD on Windows. When you start OpenOCD, you should see this:

LPC2148 ocdstartup win.png

You should also hear a high-pitched beep from the buzzer on the LPC2148 board.

Telnet Connection

You cannot enter commands directly to OpenOCD. Open a new command window and type:

telnet localhost 4444

You will should see this prompt:

Telnet win.png

You can give commands to OpenOCD through this prompt. If you don’t see the prompt on Windows 7, you may need to enable the Telnet client. See Configuring Windows 7 for OpenOCD.

 

Common OpenOCD Commands

To see a full list of OpenOCD commands, enter help in the telnet window.

reset

Resets the LPC2148 board. The output of the Reset command should look like this:

LPC2148 reset warnings win.png

You should also hear a high-pitched beep from the board’s buzzer.

Notice the two warnings about slow performance. If you want to speed up the board, you can enable fast memory access and DCC downloads by entering:

> arm7_9 fast_memory_access enable
> arm7_9 dcc_downloads enable

LPC2148 fastenable win.png

With fast memory access and DCC downloads enabled, you should be able to reset the board with no warnings:

LPC2148 reset win.png

halt

Sends a halt request to the LPC2148 board. If the LPC2148 board halts, you will see text output in the telnet window. (If the LPC2148 board is already halted, you will see no output.)

LPC2148 halt win.png

halt [timeout]

You can also use halt followed by a time in milliseconds. OpenOCD waits for the target to halt the specified amount of time, then gives up if the target has not halted. You can use this to avoid OpenOCD hanging because the LPC2148 board fails to halt. For example, to send a halt command with a timeout of one second, type:

halt 1000

resume

Enter resume to end a halt. You will not see any text output in the telnet window.

reg

Displays a numbered list of all of the LPC2148 board’s registers.

LPC2148 reg win.png

If the board is not halted, you will see a list of the registers but not their values.

reg [entry]

Run reg with a register number to display the contents of a register, in hexadecimal. The register number corresponds to the output of the reg command with no arguments, above. You must run the halt command before reading registers.

LPC2148 reg0 win.png

If you run reg while the LPC2148 board is not halted, you will still see the value stored in the register. However, registers change contents very quickly while the device is running; by the time you see the value, the value actually in the register may be different. If you try to run reg while the device is not halted, you will see this:

LPC2148 reg0 nothalted win.png

 

reg [entry] [value]

Sets the value of a register. The register number corresponds to the output of the reg command with no arguments, above. Make sure the LPC2148 board is halted (with the halt command) before you change the value of a register!

You can enter registry values in either decimal, by typing a number by itself, or in hexadecimal, by prefacing the value with 0x.

LPC2148 regset win.png

 

GDB Debugger

GDB, the GNU Project Debugger is a debugging tool provided with the GNU Compiler Collection (GCC). GDB allows you to stop and start a running program, examine its functioning, and make changes. To install and use GDB with OpenOCD, follow the instructions on the Windows GDB Debugger page below.

Windows GDB Debugger

The GDB debugger page will walk you through installing GDB for use with OpenOCD, and loading and testing a simple program.