Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Thread

IAP lpc2294 Copy2Ram problem

IAP lpc2294 Copy2Ram problem

2005-09-02 by mpwalter2005

Hi everybody,

some problem during using the IAP functions of the lpc2294. I have 
wrote this sample code:

int iFlashRAMCopy (unsigned long DestinationFlashAddress, unsigned 
long SourceRAMAddress,
                   unsigned int BytesToWrite, unsigned long 
ProcFrequency, unsigned char StartSector, unsigned char EndSector)
{
 unsigned long command[5];
 unsigned long result[2] = {0,0};

  
 disable_interrupt();

 command[0] = FLASH_PREPARE_SECTOR_TO_WRITE;
 command[1] = StartSector;
 command[2] = EndSector;
 command[3] = ProcFrequency;

 iap_entry (command, result);


 if (CMD_SUCCESS == *result)
  {
   command[0] = FLASH_COPY_TO_RAM;
   command[1] = DestinationFlashAddress;
   command[2] = SourceRAMAddress;
   command[3] = BytesToWrite;
   command[4] = ProcFrequency;
   iap_entry (command, result);
  }

 enable_interrupt();

 return (CMD_SUCCESS == *result);

everytime when i try now to copy a part from the ram eg 0x81000000 to 
flash eg. 0x4000 the second iap_entry call me the error 4 - "mapping 
error" - whats wrong ? My program runs on external mem at 0x81000000! 

Greetings
M. Walter

Re: IAP lpc2294 Copy2Ram problem

2005-09-05 by mpwalter2005

everything is ok now, i have found my error ...



--- In lpc2000@yahoogroups.com, "mpwalter2005" <mpwalter2005@y...> 
wrote:
> Hi everybody,
> 
> some problem during using the IAP functions of the lpc2294. I have 
> wrote this sample code:
> 
> int iFlashRAMCopy (unsigned long DestinationFlashAddress, unsigned 
> long SourceRAMAddress,
>                    unsigned int BytesToWrite, unsigned long 
> ProcFrequency, unsigned char StartSector, unsigned char EndSector)
> {
>  unsigned long command[5];
>  unsigned long result[2] = {0,0};
> 
>   
>  disable_interrupt();
> 
>  command[0] = FLASH_PREPARE_SECTOR_TO_WRITE;
>  command[1] = StartSector;
>  command[2] = EndSector;
>  command[3] = ProcFrequency;
> 
>  iap_entry (command, result);
> 
> 
>  if (CMD_SUCCESS == *result)
>   {
>    command[0] = FLASH_COPY_TO_RAM;
>    command[1] = DestinationFlashAddress;
>    command[2] = SourceRAMAddress;
>    command[3] = BytesToWrite;
>    command[4] = ProcFrequency;
>    iap_entry (command, result);
>   }
> 
>  enable_interrupt();
> 
>  return (CMD_SUCCESS == *result);
> 
> everytime when i try now to copy a part from the ram eg 0x81000000 
to 
> flash eg. 0x4000 the second iap_entry call me the error 4 -
 "mapping 
> error" - whats wrong ? My program runs on external mem at 
0x81000000! 
Show quoted textHide quoted text
> 
> Greetings
> M. Walter

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.