Author Topic: Cain't program LPC1857  (Read 7706 times)

misterhershel

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Cain't program LPC1857
« on: October 20, 2014, 02:49:40 pm »
I'm set up to program a hex file to bank 0, checked "Erase all Flash", "Verify after programming" and "Activate Flash Bank". It seems to program suspiciously fast, but I get no verify errors. However, when I go to ISP/Display Memory, everything is blank except the word at 0x1C (vector table). If I go to ISP/Verify, it passes.

If I check "Erase blocks used..." it gives me the error ".... nothing to erase".

If I program memory with my emulator, then view it with Flash Magic (ISP/Display Memory), it looks fine, and Flash Magic will even verify the hex file (ISP/Verify).

Also, if I use a utility to create and view my hex file, everything is normal. All lines of the hex file appear to be in order by address, as well.

I could swear that I was able to program the same board a few weeks ago, with no problem. I may have had an earlier version of Flash Magic, but I'm not sure.

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2190
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: Cain't program LPC1857
« Reply #1 on: October 21, 2014, 12:45:22 am »
If you click on the small blue Info link next to the browse button in section 3 it tells you what parts of flash are used by the hex file. What does it say?

Please generate a debug file and send it to us along with the hex file. Details here:

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

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

misterhershel

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Re: Cain't program LPC1857
« Reply #2 on: October 21, 2014, 06:41:54 am »
The "more info" window shows the correct flash range of 0x0 to 0x1F9F7. I had to split the hex file and zip the sections in order to attach.

Thanks for the help.

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2190
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: Cain't program LPC1857
« Reply #3 on: October 21, 2014, 07:01:32 am »
First please try setting the frequency in step 1 to the crystal frequency.

Second please re-generate the debug file while trying to erase, program and verify. Thanks.

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

misterhershel

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Re: Cain't program LPC1857
« Reply #4 on: October 21, 2014, 07:18:32 am »
My understanding is that when ISP mode is entered, that the internal osc (IRC = 12 mHz) and PLL generate a 96 mHz clock, which is the setting for the files attached in the previous post. I've also tried 12 mHz.

Unfortunately, I've got a doctors appointment in a few minutes, and will be out of the office for a couple of hours, but will be willing to try anything when I get back.

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2190
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: Cain't program LPC1857
« Reply #5 on: October 21, 2014, 07:24:58 am »
The frequency isn't critical. Entering zero should tell the bootloader to "auto detect", however I wanted to rule it out as a possibility.
Embedded Systems Academy, Inc.
support at esacademy dot com

misterhershel

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Re: Cain't program LPC1857
« Reply #6 on: October 21, 2014, 12:38:48 pm »
Here's the debug file and hex file with the frequency set to zero.

The hex file may be slightly different, since it's been recompiled, and includes the time of compile, etc.

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2190
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: Cain't program LPC1857
« Reply #7 on: October 22, 2014, 12:51:12 am »
Hi, yes indeed the address range of your hex file starts at 0x00000000 and goes to 0x0001F9F7.

However the lowest flash memory address in the LPC1857 is 0x1A000000.

Therefore none of your hex file is inside the flash memory address range of the device, so there is nothing for Flash Magic to do.

Verify passes because there is nothing to verify against.

What we could do is put a warning somewhere in the user interface to indicate that the entire hex file is outside of the device memory - we will look into that.

Andy
« Last Edit: October 22, 2014, 12:53:17 am by Andy Ayre »
Embedded Systems Academy, Inc.
support at esacademy dot com

misterhershel

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Re: Cain't program LPC1857
« Reply #8 on: October 22, 2014, 06:25:28 am »
Thanks Andy.

I should have known that, since the code I wrote for this project is able to reflash itself through the binary protocol it communicates with.