Flyswatter2 PIC32MX Windows How To

This guide will walk you through connecting the Flyswatter2 and the Olimex PIC-P32MX 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 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! 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_pic32mx.cfg

For general information on running OpenOCD, see Running OpenOCD on Windows. When you start OpenOCD, you should see this:
Openocd fs3 pic32mx 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 PIC-P32MX. The output of the Reset command should look like this:

Pic32mx reset win.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 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 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 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.

Pic32mx reg0 win.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 win.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 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 Beagleboard How To

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

 

Connecting the Flyswatter2 and the Beagleboard

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

  • Flyswatter2
    • USB Male A/Male B cable
    • 14-pin JTAG Ribbon Cable
  • Beagleboard
    • 5V1A Power Supply
  • Beagleboard Adapter Kit (product link)
    • 20-pin ARM to 14-pin TI JTAG Adapter Board
    • RS-232 Adapter Board
    • 10-pin Ribbon 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 RS-232 adapter board to the Flyswatter2.

Take the RS-232 adapter board provided in the Beagleboard adapter kit, and connect it to the Flyswatter2’s serial UART interface.
Flyswatter2 ti rs232 adapters.png

Connect the 10-pin cable to the Flyswatter2.

The adapter board above allows you to connect the 10-pin ribbon cable in the Beagleboard adapter kit to the Flyswatter2. Do that now. Pay careful attention to the position of the red stripe. The red stripe should line up with the “1” printed on the adapter board, as in the picture below.

Fs2 jtag14serial10.png

Connect the other end of the 10-pin cable to the Beagleboard.

Connect the 10-pin RS-232 cable to the pins to the side of the Beagleboard, the ones next to the power adapter. Make sure the cable is correctly centered over the pins, and again pay attention to the red stripe. It should match up with the “1” printed on the Beagleboard.

Fs2 Beagle 10pin.png

Connect the JTAG cable to the Beagleboard.

Connect the free end of the 14-pin ribbon cable to the diagonal pins on the Beagleboard. Make sure the red stripe lines up with the “1” printed next to the pins on the Beagleboard, like in the picture.

Fs2 beagle bothcables.png

Important: The JTAG pins on the Beagleboard have no plastic housing to force the cable into the correct position. If you connect the cable backwards, powering the board may damage the JTAG interface. Make sure the ribbon cable is connected correctly before proceeding!

Beagle jtag wrong.png Beagle jtag wrong2.png Beagle jtag correct.png

Connect the USB cable to the Flyswatter2.

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

Fs2 usb.png

Connect the power supply to the Beagleboard.

Connect the 5V1A power supply to the Beagleboard. (Your power supply may not look exactly like the one pictured.)

Beagle power.png

Plug the power cable into a surge protector or wall outlet.

Green LEDs should light up on the Beagleboard to indicate that it is receiving power.

Plug the USB cable into your PC’s USB port.

You should see the green LED on the Flyswatter2 light up, to indicate that the Flyswatter2 is receiving power through the USB connection.
 

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_beagleboard.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.cfg -c init -c "reset init"

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

Fs2 beagle linux ocdstartup.png

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 and TI Beagleboard XM. If you start OpenOCD without these commands, you will see errors like this:

Fs2 beagle linux ocderr.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 Beagleboard. When you exit OpenOCD you will need to disconnect and reconnect the power cable to the Flyswatter before OpenOCD will be able to communicate with the Beagleboard again.

JTAG Tap Unexpected Errors

On startup you may sometimes encounter this error:

Info : JTAG tap: omap3530.jrc tap/device found: 0x000000ff (mfg: 0x07f, part: 0x0000, ver: 0x0)
Warn : JTAG tap: omap3530.jrc       UNEXPECTED: 0x000000ff (mfg: 0x07f, part: 0x0000, ver: 0x0)
Error: JTAG tap: omap3530.jrc  expected 1 of 1: 0x0b7ae02f (mfg: 0x017, part: 0xb7ae, ver: 0x0)

This output means OpenOCD has failed to initialize the JTAG chain. The -c init -c “reset init” commands are a partial workaround for this error. Look for the following line later in the output:

 Info : JTAG tap: omap3530.jrc tap/device found: 0x0b7ae02f (mfg: 0x017, part: 0xb7ae, ver: 0x0)

If you see this line, everything is fine.

Troubleshooting

Getting OpenOCD to initialize JTAG correctly with the Beagleboard is sometimes difficult. If you are having difficulties beyond those described above, consult the troubleshooting page below.

Beagleboard Troubleshooting: JTAG Tap Unexpected

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. The output of the Reset command should look like this:

Reset.png

halt

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

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 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’s registers.

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.

Reg0.png

If you run reg while the Beagleboard 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:

Reg0 not halted.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 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.

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 Windows How To

This guide will walk you through connecting the Flyswatter2 and the Beagleboard 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

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

  • Flyswatter2
    • USB Male A/Male B cable
    • 14-pin JTAG Ribbon Cable
  • Beagleboard
    • 5V1A Power Supply
  • Beagleboard Adapter Kit (product link)
    • 20-pin ARM to 14-pin TI JTAG Adapter Board
    • RS-232 Adapter Board
    • 10-pin Ribbon 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 RS-232 adapter board to the Flyswatter2.

Take the RS-232 adapter board provided in the Beagleboard adapter kit, and connect it to the Flyswatter2’s serial UART interface.
Flyswatter2 ti rs232 adapters.png

Connect the 10-pin cable to the Flyswatter2.

The adapter board above allows you to connect the 10-pin ribbon cable in the Beagleboard adapter kit to the Flyswatter2. Do that now. Pay careful attention to the position of the red stripe. The red stripe should line up with the “1” printed on the adapter board, as in the picture below.

Fs2 jtag14serial10.png

Connect the other end of the 10-pin cable to the Beagleboard.

Connect the 10-pin RS-232 cable to the pins to the side of the Beagleboard, the ones next to the power adapter. Make sure the cable is correctly centered over the pins, and again pay attention to the red stripe. It should match up with the “1” printed on the Beagleboard.

Fs2 Beagle 10pin.png

Connect the JTAG cable to the Beagleboard.

Connect the free end of the 14-pin ribbon cable to the diagonal pins on the Beagleboard. Make sure the red stripe lines up with the “1” printed next to the pins on the Beagleboard, like in the picture.

Fs2 beagle bothcables.png

Important: The JTAG pins on the Beagleboard have no plastic housing to force the cable into the correct position. If you connect the cable backwards, powering the board may damage the JTAG interface. Make sure the ribbon cable is connected correctly before proceeding!

Beagle jtag wrong.png Beagle jtag wrong2.png Beagle jtag correct.png

Connect the USB cable to the Flyswatter2.

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

Fs2 usb.png

Connect the power supply to the Beagleboard.

Connect the 5V1A power supply to the Beagleboard. (Your power supply may not look exactly like the one pictured.)

Beagle power.png

Plug the power cable into a surge protector or wall outlet.

Green LEDs should light up on the Beagleboard to indicate that it is receiving power.

Plug the USB cable into your PC’s USB port.

You should see the green LED on the Flyswatter2 light up, to indicate that the Flyswatter2 is receiving power through the USB connection.
 

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.cfg -c init -c "reset init"

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

Fs2 beagle ocdstartup.png

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 and TI Beagleboard XM. If you start OpenOCD without these commands, you will see errors like this:

Fs2 beagle ocdstickyerr.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 Beagleboard. When you exit OpenOCD you will need to disconnect and reconnect the power cable to the Flyswatter before OpenOCD will be able to communicate with the Beagleboard again.

JTAG Tap Unexpected Errors

On startup you may sometimes encounter this error:

Info : JTAG tap: omap3530.jrc tap/device found: 0x000000ff (mfg: 0x07f, part: 0x0000, ver: 0x0)
Warn : JTAG tap: omap3530.jrc       UNEXPECTED: 0x000000ff (mfg: 0x07f, part: 0x0000, ver: 0x0)
Error: JTAG tap: omap3530.jrc  expected 1 of 1: 0x0b7ae02f (mfg: 0x017, part: 0xb7ae, ver: 0x0)

This output means OpenOCD has failed to initialize the JTAG chain. The -c init -c “reset init” commands are a partial workaround for this error. Look for the following line later in the output:

 Info : JTAG tap: omap3530.jrc tap/device found: 0x0b7ae02f (mfg: 0x017, part: 0xb7ae, ver: 0x0)

If you see this line, everything is fine.

Troubleshooting

Getting OpenOCD to initialize JTAG correctly with the Beagleboard is sometimes difficult. If you are having difficulties beyond those described above, consult the troubleshooting page below.

Beagleboard Troubleshooting: JTAG Tap Unexpected

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. The output of the Reset command should look like this:

Beagle reset win.png

halt

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

Beagle 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 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’s registers.

Beagle 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.

Beagle reg0 win.png

If you run reg while the Beagleboard 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:

Beagle 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 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.

Beagle 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 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.