EmbeddedRelated.com
Forums

lpc1769: can't access first 512 bytes of flash using ISP

Started by Triffid Hunter June 30, 2012
Hi,

I've just started working with an LPC1769 and can't seem to access the
first 512 bytes of flash using the built-in serial ISP.

Has anyone ever encountered this before?

Specifically, I can prepare, erase, write and copy to my heart's content
but the first 512 bytes always read back the same data, check blank returns
false for sector 0, and the verify routines also fail since the first 512
bytes never change.

Even the simple sequence
P 0 0 (prepare sector 0 for flash)
E 0 0 (erase sector 0)
I 0 0 (check if sector 0 is blank)
returns 8 (sector not blank)


An Engineer's Guide to the LPC2100 Series

Hi,

possibly you have mapped the vector table (default address 0x0, length
256 byte) to RAM by setting VTOR (address 0xE000ED08) accordingly.
Set VTOR to 0 and try again.

Regards
Herbert

Am 30.06.2012 16:13, schrieb Triffid Hunter:
> Hi,
>
> I've just started working with an LPC1769 and can't seem to access the
> first 512 bytes of flash using the built-in serial ISP.
>
> Has anyone ever encountered this before?
>
> Specifically, I can prepare, erase, write and copy to my heart's content
> but the first 512 bytes always read back the same data, check blank returns
> false for sector 0, and the verify routines also fail since the first 512
> bytes never change.
>
> Even the simple sequence
> P 0 0 (prepare sector 0 for flash)
> E 0 0 (erase sector 0)
> I 0 0 (check if sector 0 is blank)
> returns 8 (sector not blank)
>

On Sun, Jul 1, 2012 at 9:57 PM, wrote:

> possibly you have mapped the vector table (default address 0x0, length
> 256 byte) to RAM by setting VTOR (address 0xE000ED08) accordingly.
> Set VTOR to 0 and try again.
I haven't mapped anything, this is using the built-in on-chip ISP ROM
that's activated when P2.10 is held low during reset on a blank chip.


--- In l..., Triffid Hunter wrote:
>
> I haven't mapped anything, this is using the built-in on-chip ISP ROM
> that's activated when P2.10 is held low during reset on a blank chip.
>

ISP or IAP? If you really mean ISP then check your Code Read Protection setting.

Regards,
Chris Burrows

--
Astrobe v4.2: Oberon for Cortex-M3 Development System
http://www.astrobe.com

Sorry, I was talking about IAP, not ISP - my fault!
Herbert

Am 02.07.2012 07:41, schrieb Triffid Hunter:
> On Sun, Jul 1, 2012 at 9:57 PM, wrote:
>
>> possibly you have mapped the vector table (default address 0x0, length
>> 256 byte) to RAM by setting VTOR (address 0xE000ED08) accordingly.
>> Set VTOR to 0 and try again.
>
> I haven't mapped anything, this is using the built-in on-chip ISP ROM
> that's activated when P2.10 is held low during reset on a blank chip.
>

--- In l..., groups@... wrote:
>
> Sorry, I was talking about IAP, not ISP - my fault!
> Herbert
>

In that case, check that you have made allowances for all the precautions in Application Note AN11071 "In-Application Programming for the LPC1700"

You can download a copy from:

http://www.lpcware.com/content/nxpfile/an11071-application-programming-lpc1700-v10

Regards,
Chris Burrows

--
Astrobe v4.2: Oberon for Cortex-M3 Development System
http://www.astrobe.com

On Mon, Jul 2, 2012 at 6:22 PM, cfbsoftware1 wrote:

> --- In l..., Triffid Hunter wrote:
> >
> > I haven't mapped anything, this is using the built-in on-chip ISP ROM
> > that's activated when P2.10 is held low during reset on a blank chip.
> > ISP or IAP? If you really mean ISP then check your Code Read Protection
> setting.
The chip is fresh from my local distributor.

I did look at the CRP settings, but it says that an 'Erase all' command
should erase any standing CRP. I have erased the whole chip several times
(E 0 29) while experimenting with this issue.

It turns out that my flash writes succeed since my application runs
perfectly, I just find it bizarre that I can't read the first 512 bytes of
flash (and thus can't verify the first [and most important] sector) using
the built-in ISP.


Which tool are you using for ISP ??
Try to use Flash Magic, I think this should be ok.

Herbert

Am 02.07.2012 15:43, schrieb Triffid Hunter:
> On Mon, Jul 2, 2012 at 6:22 PM, cfbsoftware1 wrote:
>
>> --- In l..., Triffid Hunter wrote:
>>> I haven't mapped anything, this is using the built-in on-chip ISP ROM
>>> that's activated when P2.10 is held low during reset on a blank chip.
>>>
>> ISP or IAP? If you really mean ISP then check your Code Read Protection
>> setting.
>
> The chip is fresh from my local distributor.
>
> I did look at the CRP settings, but it says that an 'Erase all' command
> should erase any standing CRP. I have erased the whole chip several times
> (E 0 29) while experimenting with this issue.
>
> It turns out that my flash writes succeed since my application runs
> perfectly, I just find it bizarre that I can't read the first 512 bytes of
> flash (and thus can't verify the first [and most important] sector) using
> the built-in ISP.
>

On Tue, Jul 3, 2012 at 12:07 AM, wrote:

> Which tool are you using for ISP ??
>

I'm doing it by hand with a serial terminal, following the instructions in
the lpc17xx user manual to the letter.


--- In l..., Triffid Hunter wrote:
>
> On Tue, Jul 3, 2012 at 12:07 AM, wrote:
>
> > Which tool are you using for ISP ??
> > I'm doing it by hand with a serial terminal, following the instructions in
> the lpc17xx user manual to the letter.
>

Are you wearing a hairshirt while you do it ;-) See if FlashMagic works better - that might give you some clues as to what the problem is.

Chris.