Author Topic: Flash Magic issue with lpc-p2148  (Read 7706 times)

bhavinpshah

  • Jr. Member
  • **
  • Posts: 3
    • View Profile
Flash Magic issue with lpc-p2148
« on: June 06, 2009, 03:02:23 am »
Hi,

I have lpc2148 board from Olimex - lpc-p2148 Rev D. I have download latest flashmagic - 5.01.1656.

1> Firstly when I pull BSL/ICSP switch 1 towards ICSP and press reset button, the board goes in to ISP mode only when it is connected with hyperterminal. If it is connected with FlashMagic, it does not go in ISP mode and keeps executing the program that I downloaded through JTAG (OLIMAX - ARM - USB - OCD)

2> So, I open the hyper terminal, and let the board come in ISP mode. Then close the hyperterminal and open the FlashMagic.

3> With FlashMagic, it shows me everything like Device signature, Blank Check, memory details etc.

4> When I try to erase the Flash (Block 1 & Block 2) It shows me that it has erased the blocks but when I check the memory again, I see the contents there. Means it is not erasing the blocks.

5> I even tried flashing the HEX file. It shows me that it has flashed the file but when I run the program again putting the ISP switch back to OFF condition, it runs the same old program that I flashed with JTAG.  Which means it is not written in the Floash.

Can someone tell me what am I missing here? I use straight serial cable. Is there any setting on the board that I m missing or some option of FlashMagic? Your help is highly appreciated, thanks in advance.

Bhavin Shah

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2160
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: Flash Magic issue with lpc-p2148
« Reply #1 on: June 08, 2009, 09:20:31 am »
That is very strange. In order for an erasing or programming operation to complete without any errors, the device must send back to Flash Magic responses that indicate the commands were accepted and processed. In addition everything that Flash Magic sends must be echoed back correctly. A single problem anywhere will trigger retries and then an error message.

Please send us a debug file and reference this topic so we can see what the communications looks like. Instructions are here:

  http://www.flashmagictool.com/debugfile.html

Andy
Embedded Systems Academy, Inc.
support at esacademy dot com

bhavinpshah

  • Jr. Member
  • **
  • Posts: 3
    • View Profile
Re: Flash Magic issue with lpc-p2148
« Reply #2 on: June 09, 2009, 04:18:39 am »
Hi,

Please find two debug files attached. As the name suggested, I performed two operations -

1> Erase the Flash - flashmagic_erase_flash.fmd
2> Write .hex file in flash - flashmagic_write_hex_file.fmd

Warm Regards,
Bhavin

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2160
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: Flash Magic issue with lpc-p2148
« Reply #3 on: June 09, 2009, 09:38:09 am »
What I see is erasing of blocks 0 and 1 and programming of data to locations 0H -> 800H. There are no errors or problems. All commands are echoed back correctly and all commands are accepted by the bootloader.

Sorry, I have no idea what the problem is. You might want to check with Olmex to see if there is something else that needs to be done.

Andy

Embedded Systems Academy, Inc.
support at esacademy dot com

bhavinpshah

  • Jr. Member
  • **
  • Posts: 3
    • View Profile
Re: Flash Magic issue with lpc-p2148
« Reply #4 on: June 10, 2009, 02:55:04 am »
Hi,

I found one setting file for FlashMagic from some example code. I have attached that file. With that file setting now My FlashMagic has started flashing the .hex files in the flash and erasing the flash blocks. I guess the differrence with this file and what I was doing was Crystal Frequency. Previously, I was keeping it blank. Now I have it as 16 MHz as a part of attached config file.

Thanks Andy for your help. I thought of uploading it so that people who face same problem can get help.

Regards,
Bhavin Shah

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2160
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: Flash Magic issue with lpc-p2148
« Reply #5 on: June 10, 2009, 08:45:23 am »
I looked again at your previous debug files and Flash Magic was sending a crystal frequency of zero to the device. I guess this caused the bootloader to quietly accept but not process all the commands it received.

Thanks for posting back the solution and the settings file for the benefit of others!

Andy
Embedded Systems Academy, Inc.
support at esacademy dot com