Reply by Karl Olsen August 7, 20092009-08-07
--- In l..., Sutton Mehaffey wrote:
>
> I looked at J.Cs code, but he uses assembly language, which is not
> the way I am doing IAP. I am using the way the user's manual
> describes on pages 309-310 under IAP commands.
>
> It seems to work when I define the BIOS entry point locally for
> each routine. If I define it globally, so that each routine can
> use it, it locks up on any 2nd pass. I don't know why.
>
> Here is some sample code to display which sectors have been
> erased. If the iap_entry definition is local, then the loop runs
> for all 27 sectors. If the definition is global, the iap_entry()
> hangs when doing sector 1, and gives an exception (PAbt_Handler).
> Anybody know why local works and global doesn't? Anybody used this
> IAP method described in the user manual and gotten it to work?

Make sure that your toolchain uses interworking, i.e. uses the BX
instruction for the jump to 0x7FFFFFF1, and not just a "mov pc,xxx"
or "ldr pc,xxx".

See http://tech.groups.yahoo.com/group/lpc2000/message/9860
and http://tech.groups.yahoo.com/group/lpc2000/message/9835

Karl Olsen

An Engineer's Guide to the LPC2100 Series

Reply by Sutton Mehaffey August 6, 20092009-08-06
I looked at J.Cs code, but he uses assembly language, which is not the
way I am doing IAP. I am using the way the user's manual describes on
pages 309-310 under IAP commands.

It seems to work when I define the BIOS entry point locally for each
routine. If I define it globally, so that each routine can use it, it
locks up on any 2nd pass. I don't know why.

Here is some sample code to display which sectors have been erased. If
the iap_entry definition is local, then the loop runs for all 27
sectors. If the definition is global, the iap_entry() hangs when doing
sector 1, and gives an exception (PAbt_Handler). Anybody know why local
works and global doesn't? Anybody used this IAP method described in the
user manual and gotten it to work?

Sutton

void iap_info()
{
unsigned char i;
IAP iap_entry = (IAP)0x7FFFFFF1;

memset(iap_command,0,20);
memset(iap_result,0,8);

Clear_Screen();
for (i = 0; i <= 26; i++)
{
iap_command[0] = 53;
iap_command[1] = i;
iap_command[2] = i;
iap_entry(iap_command,iap_result);

if (iap_result[0] == 8)
{
sprintf((char *)text,"Sector %d Not Blank",i);
}
else
{
sprintf((char *)text,"Sector %d Blank",i);
}
Print_Text(3,1,text);
delay(SECS,0.5);
}
}