Author Topic: LPC922 & Fash Magic-only writes once  (Read 21727 times)

Mike L

  • Guest
LPC922 & Fash Magic-only writes once
« on: April 14, 2005, 12:17:58 am »
Hi All
I am witing to an 89LPC922 in ISP mode from Flash Magic using the Keil MCB900 circuit. I can write to a fresh LPC922 ok, but only once. After that Flash Magic returns with "Unable to connect... try changing baud rate...".
The "Protect ISP Code" setting is active.

I hope I haven't wrecked the micro. If I have over-written the Boot ROM, is there away to reset it?

All assistance welcome.

Thanks
Mike L

erikm

  • Guest
Re: LPC922 & Fash Magic-only writes once
« Reply #1 on: April 14, 2005, 05:06:05 am »
"I can write to a fresh LPC922 ok, but only once."   That indicates that all is OK, EXCEPT your "kick the bugger into ISP mode" process.

Erik

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2124
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: LPC922 & Fash Magic-only writes once
« Reply #2 on: April 14, 2005, 09:28:36 am »
How are you entering ISP mode? Via break detect, ISP pulse entry or via ICP? Whatever method you are using is not working. If you left Protect ISP turned on the whole time, then the bootloader should still be in the device. If you turned that off any any point then you might have erased it. Also if you interrupted the programming with a reset or power glitch, then it is possible that the boot vector might have been corrupted. I think the most likely cause is that you are not entering ISP mode correctly.

Embedded Systems Academy, Inc.
support at esacademy dot com

Randy Richardson

  • Guest
LPC931 & Flash Magic-only programs once
« Reply #3 on: April 21, 2005, 02:13:41 pm »
I am having the same problem for 89LPC931 on a PCB with the equivalent ISP circuit to MCB900.  I have a logic analyzer connected to the processor lines for ISP.  Before programming the device, all blank checks, security bit reads and device signature reads work.  The waveforms match the Keil documents on applicable ISP lines.  The program is successful the first time and the test application runs correctly.  After the programming, I get the "unable to connect ..." message.  When I look at the signals on a logic analyzer all the inputs (RXD, RTS, DTR) from the comm port still look good,  The "U" is being sent on the data line, but the device is not echoing the character.   I have changed out the chip 2 times - same response.  I read the programmed devices on the parallel programmer.  The boot vector has been changed from 1Eh to 1Fh.  This makes the ISP fail on subsequent tries.  I can't see anything happening on the power line or reset that seems wrong during the programming.

wning

  • Guest
Re: LPC931 & Flash Magic-only programs once
« Reply #4 on: August 09, 2005, 03:33:21 am »
I have the same problem too!
I think there is some wrong in the boot vector or boor status bit.

But I heard there wont be problem in using flashmagic on the ISP program of some other Philips MCU.
So, is that indicate it's the disadventage of lpc931?

erikm

  • Guest
Re: LPC922 & Fash Magic-only writes once
« Reply #5 on: August 09, 2005, 07:31:17 am »
Guys, Guys

All this is SOLELY related to an incorrect "kick the bugger into ISP mode" method.  A 100% carbon copy (no modifications allowed) of the MCP900 circuit is required.

Now, why not just save all the trouble and install NoTouch at the first load and all this just fades away.

NoTouch must be installed the first time using "standard means" which is easy with a fresh chip.

Erik

erikm

  • Guest
Re: LPC922 & Fash Magic-only writes once
« Reply #6 on: August 09, 2005, 07:36:55 am »
clarification addition the above

once you have NoTouch installed, YOU have decided what is required to enter ISP mode for the rest of the time.  I have used it to start with a specific string on the serial port and, in another case, to start just by holding down Txd.

Erik

Girish

  • Guest
Re: LPC922 & Fash Magic-only writes once
« Reply #7 on: September 29, 2005, 02:54:19 am »
Erick,

Iam facing a similar problem with LPC920.

I have wired all the required signals(RXD,TXD and reset ) from the MCB900  board and fed to LPC920 controller that I want to program.

Iam still facing the problem after first programming.

Do you have NOTOUCH implementation for LPC920 and step by step procedure to use this.

erikm

  • Guest
Re: LPC922 & Fash Magic-only writes once
« Reply #8 on: September 29, 2005, 05:18:09 am »
Do you have NOTOUCH implementation for LPC920 and step by step procedure to use this.

read the basic NoTouch for general ingo
then verify the NoTouch for LPC93x will work for LPC92x, if it does, please post, if it does not make one - it's dead simple with a bit of datasheet reading.

DO REMEMBER NoTouch can NOT "rescue" chips, it only works if installed.

Erik

David Beaumont

  • Guest
Re: LPC922 & Fash Magic-only writes once
« Reply #9 on: October 26, 2005, 02:01:00 am »
Hi,
I have been following the above thread with some interest. I too am having some difficulties re-programming a LPC935 using Flash Magic - so I start reading (when all else fails?)

Can someone tell me why the user manual for LPC933/4/5 gives the boot vector as 1F and the startup code provided by Keil (START900.A51  Version 2) sets it as 1E  To quote form the startup code ..
BOOTVEC EQU 0x1E

Wouldn't this mean that after you have programmed once and you want to enter ISP mode again, it  vectors to 1E00H instead of 1F00H. Maybe I've been looking at too long??

Bernhard 'Gustl' Bauer

  • Guest
Re: LPC922 & Fash Magic-only writes once
« Reply #10 on: October 26, 2005, 03:33:12 am »
Hi,

I have this sort of behavior when I don't let flash magic control VDD. On MBC900 this means the run jumper is allways closed.

HTH

Gustl

erikm

  • Guest
Re: LPC922 & Fash Magic-only writes once
« Reply #11 on: October 26, 2005, 05:54:30 am »
answered in parallel post

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2124
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: LPC922 & Fash Magic-only writes once
« Reply #12 on: October 26, 2005, 08:42:10 am »
Some LPC9xx devices use a boot vector of 1FH. Some use a boot vector of 1EH. If you use the wrong start900.a51 file or you select the wrong device in FM, and therefore the wrong boot vector is programmed, then you will not be able to get the device back into ISP mode.

Embedded Systems Academy, Inc.
support at esacademy dot com

David Beaumont

  • Guest
Re: LPC922 & Fash Magic-only writes once
« Reply #13 on: October 26, 2005, 07:14:16 pm »
Thanks for the response Andy.

Yep, I realised the boot vector is device specific. What is a bit sus is that  none of the devices I have checked have a boot vector of 1E. (Admittedly I have only checked LPC922/3/4/5) and the serial loader starts at 1E00H. Thought somebody may have made a slipup - and whether this could explain some of the problems apparent in the discussions.

On a related matter - do you know why Erik says (in an 8052.com message forum) that "NoTouch when downloaded will work REGARDLESS of the boot vector". The '933 user manual says
"When the Boot Status Bit is set to a va one, the contents of the Boot Vector is used as the high byte of the execution address and the low byte is set to 00H."

Too clever by half I reckon!

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2124
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: LPC922 & Fash Magic-only writes once
« Reply #14 on: October 26, 2005, 07:44:17 pm »
On earlier devices in the LPC9xx family the boot vector pointed to the first memory location occupied by the bootloader. In later devices, the bootvector points to 256 bytes into the bootloader memory. This is so if for some reason your application goes crazy and the device starts executing through flash memory, when it reaches the first location used by the bootloader it will just run into an infinate loop (or something like that), rather than activating the bootloader.

I believe NoTouch uses a user configurable pin to activate the bootloader, thereby bypassing the built in mechanism that uses the boot vector and status bit. You have to add support for it in your code. You can download it from the Flash Magic web page.

Embedded Systems Academy, Inc.
support at esacademy dot com