Flash Magic Forum

In-System Programming Support => LPC9xx/LPC9xxx => Topic started by: Bernhard 'Gustl' Bauer on July 06, 2005, 07:38:36 AM

Title: IAP of LPC935
Post by: Bernhard 'Gustl' Bauer on July 06, 2005, 07:38:36 AM
Hi,

this may not fit here, but maybe you can help me.

I try to program a LPC935 via IAP calls.  They report a HVE error. Programming with flashmagic works.  I have no IRQs, just booting and getting the data via I2C (polling). So there should be no reason for a  HVE error. I use the 'Program User Code Page' call. The key is set before. Is there something else to be done before?

 I had a look at the code ISP uses for programming. I can find no difference to mine.

Does someone does know where to get the code of the bootrom (0FF00h). Maybe this could explain where the problem is.

TIA

Gustl

Title: Re: IAP of LPC935
Post by: erikm on July 06, 2005, 10:52:38 AM
a possible cause will be that you "getting the data via I2C (polling)" use the same RAM slots as the bootloader.
Title: Re: IAP of LPC935
Post by: Bernhard 'Gustl' Bauer on July 06, 2005, 10:40:47 PM
I'm not sure what you mean by 'RAM slots'.

I get the data via I2C and write it to a buffer at address 040h. Buffer size is max. 32 bytes. After that I set AA=0. So I2C is sleeping. The source address I give to IAP call is 040h. But I don't understand what should cause trouble.

Gustl

Title: Re: IAP of LPC935
Post by: Bernhard 'Gustl' Bauer on July 07, 2005, 04:06:44 AM
Hi,

I have some further input. When I do a sector erase via flashmagic the 'Program User Code Page' call suddenly works. I tought a 'Program User Code Page' call doesn't need an erase before.  What is the difference between a flashmagic erase and the erase within the 'Program User Code Page' call?

Gustl
Title: Re: IAP of LPC935
Post by: erikm on July 07, 2005, 04:51:12 AM
"I'm not sure what you mean by 'RAM slots'.
I get the data via I2C and write it to a buffer at address 040h"

what if the ROM code uses, say address 42 for temporary storage?

Erik
Title: Re: IAP of LPC935
Post by: Bernhard 'Gustl' Bauer on July 07, 2005, 05:56:58 AM
"what if the ROM code uses, say address 42 for temporary storage?"

But shouldn't that be documented? I have found nothing. Another reason to for a look at the bootram.

Gustl
Title: Re: IAP of LPC935
Post by: Andy Ayre on July 07, 2005, 09:20:52 AM
I believe that programming Flash memory requires an erase first, unless you are only programming to set bits (or clear bits depending on the flash technology used).