Flash Magic Forum

In-System Programming Support => LPC9xx/LPC9xxx => Topic started by: Mike L on April 14, 2005, 12:17:58 AM

Title: LPC922 & Fash Magic-only writes once
Post by: Mike L 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
Title: Re: LPC922 & Fash Magic-only writes once
Post by: erikm 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
Title: Re: LPC922 & Fash Magic-only writes once
Post by: Andy Ayre 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.

Title: LPC931 & Flash Magic-only programs once
Post by: Randy Richardson 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.
Title: Re: LPC931 & Flash Magic-only programs once
Post by: wning 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?
Title: Re: LPC922 & Fash Magic-only writes once
Post by: erikm 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
Title: Re: LPC922 & Fash Magic-only writes once
Post by: erikm 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
Title: Re: LPC922 & Fash Magic-only writes once
Post by: Girish 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.
Title: Re: LPC922 & Fash Magic-only writes once
Post by: erikm 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
Title: Re: LPC922 & Fash Magic-only writes once
Post by: David Beaumont 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??
Title: Re: LPC922 & Fash Magic-only writes once
Post by: Bernhard 'Gustl' Bauer 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
Title: Re: LPC922 & Fash Magic-only writes once
Post by: erikm on October 26, 2005, 05:54:30 AM
answered in parallel post
Title: Re: LPC922 & Fash Magic-only writes once
Post by: Andy Ayre 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.

Title: Re: LPC922 & Fash Magic-only writes once
Post by: David Beaumont 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!
Title: Re: LPC922 & Fash Magic-only writes once
Post by: Andy Ayre 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.

Title: Re: LPC922 & Fash Magic-only writes once
Post by: erikm on October 27, 2005, 05:41:49 AM
re NoTouch

if you are to use the LPC NoTouch read the 89Cxx NoTouch anyhow.  The text is not copied to the LPC version.

Erik
Title: Re: LPC922 & Fash Magic-only writes once
Post by: mongkol on November 02, 2005, 06:22:35 AM
I have the same this problem too. And I cannot connect it after write it at the first.  

Andy?

I like to ask you about to set "Device configulation" in the ISP mode?
I think may be set RESET pin is not property at first.

Mongkol
Title: Re: LPC922 & Fash Magic-only writes once
Post by: Andy Ayre on November 02, 2005, 06:52:30 AM
Did you change the device configuration? It takes effect after a reset, and if you changed it to use an external clock/crystal, then the device won't do much until you attach one. Same with the reset.

Title: Re: LPC922 & Fash Magic-only writes once
Post by: mongkol on November 02, 2005, 07:57:26 AM
Thankyou for Andy

Now I get it at the "uraka"

In the Fash Magic set initial for device configuration as Input/Output pin for Reset Pin (Or not set Enable Reset Pin in ISP mode). So when you program it, you cannot reset it. Then it show that "Unable to connect... try changing baud rate...".

I suggest you that.

1. Before you write program it the LPCxxx chip by Fash Magic.
Check device configuration follow up 1) Enable Reset Pin and 2)Select clock at Internal RC Oscillator(7.373MHz+-2.5%)

2. If you write it yet. You use other programmer device (Exsample Parallel Programmer) and follow up 1) Enable Reset Pin 2)Select clock at Internal RC Oscillator(7.373MHz+-2.5%) at last 3) Set Including the ISP Code

3. When you able to connect with Fash Magic, Please check device configuration before write it any time.
Title: Re: LPC922 & Fash Magic-only writes once
Post by: Andy Ayre on November 02, 2005, 08:48:46 AM
It is always possible to use the pulse entry method to place the device into ISP mode, regardless of whether the reset pin is configured as reset or I/O. Likewise, ISP can be used with the internal RC oscillator or external crystal/clock.

Title: Re: LPC922 & Fash Magic-only writes once
Post by: mongkol on November 09, 2005, 08:22:50 AM
Andy?

I want to ask you any question.

1. In the IAP (In Aplication Program), there are many version. Some version is address FF00H for PGM_MTP and Other version is FF03H. What is it allright?
2. In the IAP service routine. Can I initial it or flash it's memory?
In the parallel program device (SuperProIII) limits at 1FFFH.
3. In the ISP (in system Program). Some version location of UCFG1,UCFG2 (Micro Config) and SEC0-SEC7 (Security Config) stay in FFF0H and FFF8H (IAP area) and other version stay in FD00H (ISP area) What is it collect?
Title: Re: LPC922 & Fash Magic-only writes once
Post by: Andy Ayre on November 09, 2005, 08:38:09 AM
1. I don't know anything about IAP beyond what is written in the user manuals. Later devices in the LPC9xx family had a different ISP entry point relative to the start of the memory used by the bootloader. Chances are Philips did the same thing with IAP. You need to check the user manual for the specific device you are using.

2. Sorry, I don't understand your question.

3. FFF0H. Use the latest start900.a51 from keil.com. Very old versions used a different (and incorrect) address.

Title: Re: LPC922 & Fash Magic-only writes once
Post by: mongkol on November 09, 2005, 09:00:02 AM
    I use the SuperPro III to flash program into chip P89LPC932. That it limits memory to flash about 0000H-1FFFH (8 block memory page). So I cannot to write UCFG (Micro config) in the IAP area (FFF0H). In fact, I want to config about FOSC,CLKR,BOV,PRHI,RPD,WDTE and other.
Title: Re: LPC922 & Fash Magic-only writes once
Post by: Andy Ayre on November 09, 2005, 09:03:07 AM
There is no memory at FFF0H. It's simply a way of being able to include those settings in a hex file. When Flash Magic sees that record it programs UCFG1, security bits, etc.

Title: Re: LPC922 & Fash Magic-only writes once
Post by: mongkol on November 09, 2005, 09:22:16 AM
At last, Now I cannot connect the chip via the Flash Magic. That is "Unable to connect... try changing baud rate...". So I cannot set anything.
Title: Re: LPC922 & Fash Magic-only writes once
Post by: Andy Ayre on November 09, 2005, 09:24:49 AM
Did you erase the bootloader using your parallel programmer? Did you program anything into UCFG1, UCFG1, BV, SB, etc. since it last worked?

Title: Re: LPC922 & Fash Magic-only writes once
Post by: Alessandro Rocchegiani on November 13, 2005, 11:11:17 AM
Hello Mongkol,

If you have a working parallel programming, you can try the following:

- download AN10337_1 "Adding ISP in source code" from philips website
- open the file LPC_ISP_8K_V04.A51 and add after the equate table
  a list of JMP 1F00h for all start page address
  .....
  CSEG AT 0000h
  JMP 1F00h
  CSEG AT 0100h
  JMP 1F00h
  .....    (repeat the sequence for all start page address)
- delete the line ORL AUXR1,#SRST following the RESET lable
- compile the file, full chip erase and program the device

In this way the MCU ( if isn't wrong) start in ISP whit any setting of BOOTVECT and BootStatusBit.

Then you can try use Flash Magic to restore correct setting.

(If don't work try whit external clock source)


Alessandro
:cheers:

Title: Re: LPC922 & Fash Magic-only writes once
Post by: ericinsomewhere on April 06, 2006, 08:49:51 PM
I have the same problem using LPC922.

I haven't download any code on the LPC922, just checked and changed device configuration only:

- Uncheck "Enable Reset Pin"
- Uncheck "Enable Brownout Detection"
- All other left it as default.
Title: Re: LPC922 & Fash Magic-only writes once
Post by: Je Gold on April 07, 2006, 09:13:07 AM
Hi All,

This my understanding - apologies to all for any mis-interpretation.

There are 4 ways to program CODE  SPACE in the LATEST 20 pin or larger LPC900 parts  eg P89LPC920, 922, 931, 932A1, 935, 936, 938 etc

1. ISP    (In System Programming)  via UART of the micro

2. ICP   (In Chip Programming) via a Synchronous CLK, Data lines

3. Parallel Programmer

4.  IAP  (In Applications Programming)  - Your program executes and makes calls to the erase, and programming function calls available from IAP bootcode.


1. ISP

This requires the UART of the micro and a stable Osc source.  If you programmed an external Osc source... and don't have it connected, the next time you program it....  well the UART won't clock and ISP wont work... so remember your Osc source to make it work... the next time.

1.a A Fresh Untouched chip
----------------------------------
A "fresh" untouched chip will jump in to ISP programming mode on powerup up  1st time
Title: Re: LPC922 & Fash Magic-only writes once
Post by: Je Gold on April 07, 2006, 09:23:34 AM
Appologies

Another one....

1.d  ISP   UART Break Dectect

In your startup code like in the NoTouch example  you set a register bit.

Break detect is reported in the status register (SSTAT). A break is detected when
11 consecutive bits are sensed LOW. The break detect can be used to reset the device
and force the device into ISP mode.


So   4 Methods of getting in to ISP mode, 1 for ICP


Joe Gold.
Title: Re: LPC922 & Fash Magic-only writes once
Post by: sanjayb on May 30, 2006, 10:47:56 PM
hello,

         I am working with p89lpc922 isp mode, I had use the circuit which is as given on flash magic web site,
         But from some hardware difficulties it cannot give the reset pulses to enter in isp mode,
        are any other method or circuit to enter in isp mode
Title: Re: LPC922 & Fash Magic-only writes once
Post by: Andy Ayre on May 31, 2006, 08:34:58 AM
Which circuit are you using? The Keil MCB900 one? If you take a look at the Flash Magic application note on ISP entry using COM port handshaking signals, there is a description of how the circuit works along with expected waveforms at various points. This should give you enough information to be able to debug your version and find out why it doesn't work.