Yahoo Groups archive

Lpc2000

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

Message

Calling IAP-routines from thumb mode

2006-01-22 by conrado

Hi Guys,

I try to call the IAP-routines from ARM-mode with help of the code 
to enter THUMB-mode from the file section:

static void callIAP(void)
{
  // fast way to get the address of flashParams[] directly into r0
  register void *pFP asm("r0") = flashParams;

  asm volatile(" mov r1, r0\n"          // copy &flashParams[] into 
r1
               " bx  %[iapLocation]"    // 'bx' because IAP is Thumb 
mode
               :
               : "r" (pFP), [iapLocation] "r" (IAP_LOCATION)
               : "r1" );
}

The code runs fine, the IAP is entered in thumb mode and returns to 
ARM-mode again. Only nothing happens: when I try to read the Part Id 
(command 0x36) it returns 0. The same for the Boot Code (command 
0x37). R0 / R1 points to the (same) FlashParams. With help of the 
debugger I see the 0x36/0x37-commands in these parameters are 
overwritten by zero.

Who can help me please?

Thanks in advance,

Conrado

Attachments

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.