Flash Magic

Installing and Setting up Flash Magic within Eclipse

Flash Magic provides a flash downloader onto the LPC2378 flash memory via serial. It is an alternate method if downloading over JTAG fails. For example, if buggy initialization code is programmed into the LPC’s Flash, this may be the only method that will erase the flash. For this to work:

  • The serial cable has to be attached between the LPC-2378-STK and ARM-USB-OCD
  • The ISP_E and RST_E jumpers located next to the LPC-2378-STK serial ports have to be installed.
  • The JTAG cable should be removed from the LPC-2378-STK.
  • Note that installing ISP_E and RST_E will disable JTAG and TRACE functionality after a target reset. Therefore make sure to uninstall (open) them after using FlashMagic.
  1. Install Flash Magic from the <UW PATH>packages directory Note: you may find newer version on http://www.flashmagictool.com/
  2. Double-click on FlashMagic.exe
  3. Follow the flash magic install procedure
  4. Bring-up the Control Panel double click on System
  5. Select the Advance tab
  6. Click on Environment Variables...
  7. Find path and check that it has the following: C:Program FilesFlash Magic
  8. Open Eclipse
  9. Select menu Run | External Tools | External Tools Configurations...
  10. Click the new icon and fill in the form as follows:
  11. Click Apply
  12. Click Run (make sure all the hardware is connected)

Flash Magic Configuration

  1. Determine the COM port assigned to the Olimex OpenOCD by Windows.

  2. Connect the serial cable up to the LPC-2378-STK RS232_0 connector and ARM_USB_OCD serial port.

  3. Verify the LPC-2378-STK is powered down (for example unplug the USB connector that powers it)

  4. Verify the jumpers near to the serial connector are linked (marked ISP_E and RST_E).

  5. Verify the JTAG cable is removed from the LPC-2378-STK’s JTAG connector.

  6. Power up the LPC-2378-STK.

  7. In the Flash Magic windows make sure the following is set:

    • COM Port: Use the COM port assigned to the Olimex OpenOCD (shown in Windows Device Manager)
    • Baud Rate: 9600 (can use higher but start with slower)
    • Device: LPC2378
    • Interface: None (ISP) Oscillator (MHz): 12 Check Erase all Flash+Code
    • Rd Prot Hex File: Browse for the hex file generated in your project.
  8. Verify there is a connection by selecting from menu ISP | Read Device Signature... You should see: Note: this shows FlashMagic was able to read the LPC2378 Device signature.

  9. Select Close on the Device Signature dialog box.

Transferring an image to FlashROM via FlashMagic

  1. Complete the Flash Magic Configuration steps.
  2. Press Start on the main Flash Magic window (this will download the file to the board)
  3. Once complete (double check that the download is complete) exit Flash Magic.

Erasing FlashROM via FlashMagic

  1. Complete the Flash Magic Configuration steps.
  2. Go to menu ISP | Erase Flash...
  3. The Erase Flash window should open.
  4. Check Erase all Flash+Code Rd Prot.
  5. Click Erase.
  6. If the erase was successful, the dialog should show:
  7. Click OK.
  8. Exit Flash Magic.
  9. If you are done using FlashMagic, power down the LPC-2378-STK, reconfigure the ISP_E and RST_E jumpers and reconnect the JTAG cable.