LPC2378 programs only once

Started by kunok, February 14, 2008, 08:56:33 AM

Previous topic - Next topic

kunok

Hi,

I use FlashMagic 4.17.273; Target: LPC2378 chip; OSC = 12MHz;

When the Flash is cleared (done with the ULINK debugger) then it's no problem to enter ISP mode with Flashmagic to program the LPC2378.
But once programmed it's not possible to enter ISP mode again.
For example: to read the device ID FlashMagic says "operation failed to autobaud, step1". Osc shows that the chip isn't responding any more.

The code read protection location at 1FC is disabled (set to FFFFFFFF) in the programmed application.

I tryed to set OSC to 14.748 or 12Mhz, lowered the baudrate, increased the times T1 and T2 but no result until now. If someone knows what I'm doing wrong it would be great to know.
                                      Kuno

Andy Ayre

Once you program a hex file Flash Magic places the interrupt vector checksum at location 14H. This causes the device to execute your firmware on reset rather than the bootloader. You need to reset the device while holding the ISP entry pin to place the device back into ISP mode. Check the user manual for exact details.

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

kunok

Hi Andy, thanks for your statement.
The IENIT0 Pin of the LPC2378 (that is used to set the device into ISP mode) is driven by RTS and IRESET is driven by DTR signals done with 2 transistors; I found this in the MCB2300 eval board drawings and made the same in my design. The bootloader version of LPC2378 is V3.2.
This morning when I powered up the whole stuff, I could read the device ID but minutes later the chip didn't respond again. Sometime it was possible to communicate and program the device, but I didn't find out what's wrong.

Andy Ayre

Sounds like there is an intermittent electrical problem.

Do you have the DTR/RTS option enabled in the Advanced Options in Flash Magic?

Next thing would be to put a scope on the reset and ISP entry pin to make sure that is working. After that check for glitches and ripple on the power supply, reset XTAL pins, etc.

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

kunok

Hi Andy,

yes, the DTR/RTS option  is enabled. Also I monitored the TTL signals directly on the chip and didn't find strange things. FlashMagic applies the reset for some time while IEINT0 pin is set low, after T2 the communication starts, but in error case the chip gives no answer. When I had luck and the system runs the signals look like in error case but the chip will answer to FlashMagic tool. At this point all runs well.

So, now I will leave to the weekend, thanks an enyoy your weekend too.  Kuno

Andy Ayre

Put your scope on the RxD pin of the device and make sure you see the bit pattern for a '?' each time you attempt to communicate with the device. If you do, put your scope on the TxD pin and make sure the bit pattern for an 'S' is always transmitted in response to the '?'. If not then the device is not in ISP mode for some reason.

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

kunok

Hi Andy,
I did what you said: The device seems not to be in ISP mode in error case.
But I can't see any difference when the system works except that the LPC2378 is responding when all runs well. The IEINT0 and RESET behaviour is identical in both cases.
This is very spooky, It seems to be a difference if the system powers up or only the RESET was active with all voltages already present. The POR (power on reset) seems to have some impact.

Andy Ayre

Do you have another device to test with? Are you letting the reset voltage drop to 0V during resets? Or something close to 0V?

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

kunok

Hi Andy,

yes, I tried another device and the behaviour was the same. But I found out something:
In my application I have a power fail circuit that uses the external interrupt 1. If this becomes active some parameters will be saved into the internal flash memory and normally after that the system dies. But for some reasons (when there only was a dropout for examle, or for testing) I use the watchdog to active shut down the whole system (same as when power was lost).

Now I take an completely erased hardware and the ISP FlashMagic tool works fine until I use this watchdog for the first time, after that I can't enter the boot loader mode again. Also after disconnecting the power for some minutes It's not possible to read the device ID.
The only way is to short the EINT0 pin for some seconds and then to short the reset pin. (that is exactly what the FlashMagic tool does, but there must be a difference I didn't see yet). At this time the flash holds the application program and FlashMagic is able to read the device ID for example.
It seems like the boot loader sees the watchdog flag and a valid application and starts the application.
Spooky, a reset doesn't clear this watchdog flag.
If I know more, I will tell you, it's an amazing problem.

Kuno


Andy Ayre

Interesting. I haven't come across a problem like this before. My only suggestion at this point is to contact your local NXP FAE for assistance. Sorry :(

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

rahul

Quote from: kunok on February 15, 2008, 10:21:32 AM
Hi Andy, thanks for your statement.
The IENIT0 Pin of the LPC2378 (that is used to set the device into ISP mode) is driven by RTS and IRESET is driven by DTR signals done with 2 transistors; I found this in the MCB2300 eval board drawings and made the same in my design. The bootloader version of LPC2378 is V3.2.
This morning when I powered up the whole stuff, I could read the device ID but minutes later the chip didn't respond again. Sometime it was possible to communicate and program the device, but I didn't find out what's wrong.


hi friend 

he friend i m rahul from india
i want to use LPC2378 for one of my projects.
i m new to ARM.
i want to make an isp device for my LPC2378.
I want some circuit for that.
do u have any working circuit for that.
can u send me at my mail id: er_rahulkapoor@yahoo.co.in
.
also i want to ask one more thing. do we definitely need a bootloader for programming the arm. or it is only needed when we want to program it in c.I mean that is it possible to program arm in assembly language without bootloader

Andy Ayre

Go to http://www.keil.com/mcb2300/ and click on "Schematics" on the left for an example. Note that the circuit design is copyrighted, but perhaps it will give you inspiration.

The bootloader takes binary data and stores it in flash. It doesn't care what language was used to generate the data. It doesn't even have to be executable.

You can also program the device using JTAG or a parallel programmer.

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

jcasey


Kuno -

Did you ever resolve this?  This sounds very similar to a problem I'm having
with an LPC2103...although it does the "only program once" only when using
an FTDI USB-serial chip for the interface...when I use my standard tool, a
MAX232 and two transistors (I think we used the same circuit), it works fine.

See the thread elsewhere on this forum to catch up.  I'd love to hear anything
that you resolved from NXP....I'm trying to talk to Andy here, an engineer at
FTDI, and NXP....but I suspect the problem is at the NXP end.

Thanks !!


Barny

Hi,

I have been having a similar problem with LPC2387 processors.
We have been using LPC2364, LPC2366 and LPC2368 for years with no problems, then when we started using the LPC2387 processor, we found we could only load the hex file the once, then loading afterwards is very intermittant. We have looked at scope traces when loading is successful and unsuccessful and we can't see any differences.
Have you any suggestions on the cause of this.
Thanks in advance.
Barny

Andy Ayre

Did you put your scope on the reset and ISP entry pin? Correct waveform shape and timing is needed to enter ISP mode. If you have a new board design for the LPC2387 then I would suspect that first.

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