Cain't program LPC1857

Started by misterhershel, October 20, 2014, 02:49:40 PM

Previous topic - Next topic

misterhershel

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

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

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

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

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

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

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

#7
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
Embedded Systems Academy, Inc.
support at esacademy dot com

misterhershel

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.