The LPC2387 on the FEZ Panda is preprogrammed with a bootloader from GHI electronics as it's intended to be used with the Microsoft.NET embedded (or something) framework. It also has the JTAG port disabled, so the first thing I have to do is to get rid of bootloader and clear the chip. Helpfully, GHI provide a special firmware that erases the whole chip and removes all memory protections. You can currently get the file "USBizi_ERASE.zip" in from a directory on GHIs servers.
Steps to erase the FEZ Panda
The steps here are actually described in GHI's document Beginner's Guide to porting .NETMF, but I I'll summarize the steps as executed on a Linux machine:
USBizi_ERASE.zipand unpack. You'll have to install the
cuterminal emulator and the
lrzszx/y/z-modem protocol. Then write a short script (see below) to send "X" and then the included
USBizi_ERASE.GHIvia xmodem-1k-crc16. Connect the first UART of the FEZ-Panda to a suitable 3.3v CMOS serial port (e.g. a ft232 usb to serial module). Connect the
MODEpin on the unpopulated pads on the short edge of the PCB opposing the USB/Power connector side to
GND. Press the reset-button marked
RSTwhile holding the
LDRbutton next to it.
In the serial terminal, you should see the
BLprompt of the bootloader, start the script to send "X" followed by the xmodem-upload, then wait for the included software to erase the board.
[distress /home/chris/Downloads] $ cat erase.sh #!/bin/sh echo -n "X" sx -k -o -vv USBizi_ERASE/USBizi_ERASE.GHI [distress /home/chris/Downloads] $ cu -l ttyUSB0 -s 115200 BL BL BL BL ~+./erase.sh Sending ./erase.ghi, 2696 blocks: Give your local XMODEM receive command now. Bytes Sent: 345088 BPS:9933 Transfer complete File Transfer Finished Successfully USBizi Version: 188.8.131.52 Debug: COM1 LCD: 0x0 IP: 0.0.0.0 MAC: 00.00.00.00.00.00 Managed heap size: 64412 Custom heap size: 0 ~?çƄ
Now the USBizi is erased and the "usual" LPC bootloader takes over on the serial port, at 9600 bits per second:
[distress /home/chris/Downloads] $ cu -l ttyUSB0 -s 9600 Connected. Synchronized
JTAG now works:
[atrocity /home/chris/openocd] $ openocd Open On-Chip Debugger 0.3.1 (2010-01-18-18:43) $URL$ For bug reports, read http://openocd.berlios.de/doc/doxygen/bugs.html parport port = 0 OLD SYNTAX: DEPRECATED - use jtag_khz, not jtag_speed jtag_speed: 2 Error: Translation from jtag_speed to khz not implemented Info : interface specific clock speed value 2 Info : JTAG tap: lpc2387.cpu tap/device found: 0x4f1f0f0f (mfg: 0x787, part: 0xf1f0, ver: 0x4) Info : Embedded ICE version 7 Error: EmbeddedICE v7 handling might be broken