Author Topic: LPC2103 not programming  (Read 1734 times)

Erkens

  • Jr. Member
  • **
  • Posts: 3
    • View Profile
LPC2103 not programming
« on: August 27, 2015, 01:41:49 am »
On my laptop (Windows 8.1 64-bit) flashmagic can't flash a LPC2103. However if I try to program the same board with the same usb-uart cable on my pc (Windows 7 64-bit) it works just fine.

I tried Flashmagic version 9.20.3898 and 8.81.3813 (this version i use on my win7 machine) both versions give the same error on my win8 machine: "Operation Failed. (programming - failed to send data to device)"

Flash Magic is able to enter the bootloader, I can read the device signature.
In fact if I  use the erase flash function it tells me it completed the erase, but in fact it did not erase the chip.
If I manually enter the bootloader via a serial terminal on that machine and erase it "by hand" the chip does get erased.

It get even stranger because on this win8 machine Flashmagic is able to program a LPC1766 and a LPC1227.

Can anyone suggest how I can get it to work.

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2114
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: LPC2103 not programming
« Reply #1 on: August 28, 2015, 01:12:12 am »
First of all please try the latest version. Then:

Please send us four debug files:

1. One showing a full erase followed by a blank check on Win7
2. One showing a full erase followed by a blank check on Win8

3. One showing a complete programming on Win7
4. One showing a failure to program on Win8

Please use the same hex file for 3 and 4. Please also send us the hex file. Also please give the debug files meaningful names.

Instructions are here:

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

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

Erkens

  • Jr. Member
  • **
  • Posts: 3
    • View Profile
Re: LPC2103 not programming
« Reply #2 on: August 28, 2015, 02:38:58 am »
I updated to flashmagic 9.30.3940

On win8 it still failed.
Programming failed with the same message as before.
Blank check failed with this message: "Operation Failed (blank check)"
I also notice that the chip does not get erased by win8 even though it "completes".

Please note that the included hex-file may not run properly on generic dev-boards, because it expects certain peripherals.

I know that the board is good, in fact I tested multiple boards and on win8 they fail and on win7 it works.
I even tested it with different power supplies and different hex-files.

I have used these boards and usb-uart cables for several years without any problem. The cable uses a CP2102 usb-uart chip.
Though this is the first time I tried to program one from win8.

I tried the win8 machine also with other controllers and they all work fine:
- LPC1313, LPC1313/01
- LPC1227
- LPC1766
- LPC2468

Therefore I find it a mystery why only the LPC2103 fails.

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2114
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: LPC2103 not programming
« Reply #3 on: August 28, 2015, 04:12:32 am »
Erase/blank check:

On Win7 the blank check works.

On Win8 the bank check fails because the LPC2103 reports that CRP is enabled and writing to RAM is not allowed. The blank check requires writing to RAM. This implies CRP2 is set.

But if this is the exact same chip then I don't see how that can be possible.

For both Win7 and Win8 all erase commands are correctly sent, echoed back and acked as being successful by the chip - no difference. How are you verifying the chip is not blank?

You have selected to erase all flash, which should unlock CRP1 and CRP2, but even though the command "E 0 7" is successful it seems CRP2 is still set. This doesn't make sense.

In Win8 please enter a frequency of 12MHz into section 1. You have this on Win7. It might make a difference to how the chip behaves. Please retest and generate new debug files.

Programming:

This fails on Win8 because, again, the chip is reporting that CRP is set. Again this might be because you are not setting a frequency in Flash Magic. Please retest and generate new debug files.

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

Erkens

  • Jr. Member
  • **
  • Posts: 3
    • View Profile
Re: LPC2103 not programming
« Reply #4 on: August 28, 2015, 05:01:25 am »
Problem solved, it was indeed the frequency of 12 MHz that it needed to know.
I completely overlooked this setting, I had compared every setting in advanced options between win7 and 8.
Maybe It would be wise to add a warning when this value is not set for chips that need it.
I have added the logs of the working win8, in case your interested in comparing the responses.

On a side note, i could see it did not erase the chip because my run led was blinking (controlled by the firmware in the chip) after the erase.

Thank you for your quick reply and sorry for my mistake.