LPC2378 programs only once

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

Previous topic - Next topic

Barny

Hi Andy,

Thank you so much for your help.
Yes we put a scope on the ISP and RST pins and could see the correct timing.
The board is an old design, we have 3 different designs which were all using the 2368 processor, then we decided to upgrade to the 2387, (2368 and 2387 pin compatiable), The boards ran fine with the new 2387 processor, but then when we wanted to do an upgrade of firmware we couldn't download.
We found that we can download to a fresh processor but after that we can't download, we also found that if we then cleared the processor memory using JTAG we can then download.
We will do some more investigation and let you know if we find anything, if you have any new ideas that would be great.
Thanks

Andy Ayre

ISP can be disabled by programming a specific value at location 0x000002FC. This is called "CRP" in the NXP user manual for the device. Are you making sure you are reserving this location in your project and not accidentally putting one of the magic numbers there?

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

Barny

Hi Andy,

Yes we checked this and we are not putting anything in this location.

Just to keep you posted, we set up a simply test (Flash Magic was NOT part of the test).
The test had a simple program and a reset circuit, the RST pulled to 3.3v through a 47K and a switch to ov.
We ran this test on a range of processors, LPC2364, LPC2366, LPC2368 and LPC2387.
We found that only the LPC2387 would not reset externally and more so, only revision D of the LPC2387 processor.

This suggests that the problem is in the LPC2387 processors. Are you aware of any issues with LPC2387 Revision D processors.

Also with Flash Magic you can read the boot loader version in the processor, we found that versions 3.3 and below and everything was OK. 3.4 boot loader was on the processors with the problem.

Any feedback would be appreciated.

Thanks

Barny

Andy Ayre

Thanks for the detailed testing. Unfortunately we don't know anything about the internal details of the bootloader - only NXP will be able to answer your questions.

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

Barny

Hi Andy,
I have been doing some investigation with the LPC2387 processor (i know other people have experienced problems with the PLC2364, LPC2368 and LPC2378). I found that when you download to a fresh device it downloads OK, but when you download again after a power cycle it will not download. The problem appears to be the actual reset of the processor as i found that when i try and reset the processor by connecting the rst line to 0v nothing happens.
I found the solution to the problem was to turn the ISP line on for about 1 second before doing a download then do a download in the normal way.
Is there some where in the configuration of flash magic where you can set ISP delay, if not is it possible you can do an update to the driver so the ISP line turns on 1 second or more before turning the reset line on then doing a download. IF it is possible and you would like me to test it for you let me know.
Thanks
Barny

Andy Ayre

#20
It's hard for me to understand exactly what you mean. Please see the diagrams for DTR/RTS on pages 49 and 50 of the manual. You can control how long the ISP pin is pulled low before ISP starts by setting the values of T1 and T2 in the advanced options.

If you are talking about something else can you please post your own version of those diagrams so I can better understand where the one second needs to be?

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

Barny

HI Andy,

Find attached a basic timing diagram.
Basically Flash Magic works OK when the ISP line is turned on 1 second or longer before turning the RST line on. The ISP line is kept on during the whole of the download.
I hope this helps.
Thanks Barny

Andy Ayre

Next release will have a hard-coded delay of 1.2s at this point. When it is released please check with a scope and report back on if the problem you are seeing is solved.

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

Barny

That's great, thank you so much. I will check it once it has been released.
Do you have an approx release date, so i can make some time available.
Thanks

Andy Ayre

Embedded Systems Academy, Inc.
support at esacademy dot com

Barny

Hi Andy,

Can you advise me whether Version 8.82 has the changes as above. If so is there any setting etc i need to do?

Thanks for you help.

Barny

Andy Ayre

Yes it does. No settings to change.
Embedded Systems Academy, Inc.
support at esacademy dot com

Barny

Dear Andy,

Unfortunately i couldn't get it to work. I tried various settings but still had no luck.
Find attached the scope trace i took.
I would expect the ISP line to be low for 1.2 seconds before any action from the RST line and the ISP line to stay low during the whole download period.

Thanks
Barny

Andy Ayre

#28
Here is the test I just performed with the current version of Flash Magic (8.95).

Keil MCB2300 board populated with a LPC2388.
Genuine FTDI USB to RS232 cable
FM advanced settings:

  - Use DTR and RTS to control RST and ISP pin
  - Keep RTS asserted while COM port open
  - T1 = 300ms, T2 = 300ms

Everything else is unchecked.

Note: I do see a bug in FM: checking "Keep RTS asserted..." and clicking OK *does* work but the next time the dialog is opened it is unchecked again. We will fix that. It doesn't affect this test.

Scope with channel A = RST pin, channel B = P2.10 pin. Note - the scope is connected to the pins on the microcontroller.

Waveform is attached. Blue = channel A = RST.

I've made a measurement from the trigger point to the dotted line. As you can see it is 1.2 seconds, as expected.

Analysis:

RST is lowered
1.2s later P2.10 is lowered
300ms later RST is raised, device is now in ISP mode
P2.10 remains low because we selected that option in FM
At end of ISP operation RST is lowered
300ms later P2.10 is raised
300ms later RST is raised, device is now executing

So from this I don't see any issues with the way it is working.

If you are getting something drastically different then I would first suspect the USB to RS232 cable you are using (if you are using one).

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

Barny

Dear Andy,
Thanks for that information. Unfortunately i have been struggling to get it to work after the settings you suggested.
The USB to RS232 converter I am using is a ULINX device which I use on alot on equipment, i paid £200+ for it, i know it is a good one.
See attached image 'FlashMagic-1' The blue line is ISP, the red line is RST. Maybe the blip at the start on the RST line is the cause of the problem. These traces are at the LPC2387 pins.
Set attached 'FlashMagic-2' when i used the real RS232 of the PC. The trace is totally different.
One thing i did find now with both comm ports (USB-RS232 and Genuine RS232 port) is that if the ISP line is low all the time (basically i shorted this pin to Ov), both comm ports work successfully with Flash Magic.
Is it possible to set ISP line always low?
Sorry to be a pain... i do know this problem is down to the actual LPC23xx micro-processor because i can't even it to reset when i short the pin to 0vdc.
Thanks for your support so far.
Barny