Reply by ek1mus September 28, 20072007-09-28
--- In l..., Joel Winarske wrote:
> > I am not preparing the sector prior to programming. I first like to
> > get the error-message SECTOR_NOT_PREPARED_FOR_WRITE_OPERATION. Right
> > now there isn't anything written into my resultspace when I use Copy
> > RAM to Flash.
> >
>
> Regardless, have you *tried *calling "prepare sector" prior to erase or
> program calls?
>
yes

An Engineer's Guide to the LPC2100 Series

Reply by Joel Winarske September 27, 20072007-09-27
> I am not preparing the sector prior to programming. I first like to
> get the error-message SECTOR_NOT_PREPARED_FOR_WRITE_OPERATION. Right
> now there isn't anything written into my resultspace when I use Copy
> RAM to Flash.
>

Regardless, have you *tried *calling "prepare sector" prior to erase or
program calls?
Reply by ek1mus September 26, 20072007-09-26
--- In l..., Joel Winarske wrote:
>
> ek1mus wrote:
> > A few problems I have with it is:
> >
> > 1. The IAP function will not branch back. Currently I go back into
> > debug-mode by just writing commands in the pipeline.
> >
> > 2. The processor will go into Abort
> >
> > 3. It doesn't complete some IAP routines. 'Blank Check' runs fine, but
> > 'Copy RAM to Flash' does not. It doesnt even returns an error-message.
> > 'Erase Sector' gives back CMD_SUCCESS, but if I check the memory with
> > 'Blank Check' I find out that 'Erase Sector' didn't erased the sector.
> >
> > 'Read Part ID' and 'Read boot code version' works ok too. Didn't try
> > Compare. The IAP routine also gives back INVALID_COMMAND if I try an
> > invalid command.
> >
>
> Are you preparing the sector prior to programming it?
> Some resources that will help:
>
> AN10256 and AN10356:
> http://tech.groups.yahoo.com/group/lpc2000/files/flash%20Programming/
>
> EE example that uses IAP:
> http://tech.groups.yahoo.com/group/lpc2000/files/EE_demo_1_1.zip
> The IAR compiler uses IAP code for flashloading the LPC2xxx parts. The
> project/source for this is included with the IAR-EWB toolset.
>
> Some of the other toolsets may include flashloader source, I never
> looked into it.
> Joel
>

I am not preparing the sector prior to programming. I first like to
get the error-message SECTOR_NOT_PREPARED_FOR_WRITE_OPERATION. Right
now there isn't anything written into my resultspace when I use Copy
RAM to Flash.

I call the IAP code by setting R0 and R1 prior to calling the IAP
routine. I also tried setting the LR prior to calling the routine, but
there wasn't any change in operation.

This can be done without problems because some routines work. Could it
be a problem in the IAP code itself? Interrupts are disabled. It seems
that the clock is working normally because 4 out of 7 routines work
Reply by Joel Winarske September 25, 20072007-09-25
ek1mus wrote:
> A few problems I have with it is:
>
> 1. The IAP function will not branch back. Currently I go back into
> debug-mode by just writing commands in the pipeline.
>
> 2. The processor will go into Abort
>
> 3. It doesn't complete some IAP routines. 'Blank Check' runs fine, but
> 'Copy RAM to Flash' does not. It doesnt even returns an error-message.
> 'Erase Sector' gives back CMD_SUCCESS, but if I check the memory with
> 'Blank Check' I find out that 'Erase Sector' didn't erased the sector.
>
> 'Read Part ID' and 'Read boot code version' works ok too. Didn't try
> Compare. The IAP routine also gives back INVALID_COMMAND if I try an
> invalid command.
>

Are you preparing the sector prior to programming it?
Some resources that will help:

AN10256 and AN10356:
http://tech.groups.yahoo.com/group/lpc2000/files/flash%20Programming/

EE example that uses IAP:
http://tech.groups.yahoo.com/group/lpc2000/files/EE_demo_1_1.zip
The IAR compiler uses IAP code for flashloading the LPC2xxx parts. The
project/source for this is included with the IAR-EWB toolset.

Some of the other toolsets may include flashloader source, I never
looked into it.
Joel