Yahoo Groups archive

Lpc2000

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

Thread

IAP Problem

IAP Problem

2005-04-24 by sig5534

I am getting an Invalid Instruction Exception trying to get my IAP 
routines running.  When it branches to the IAP service routine at 
0x7FFFFFF0, it goes to the next instruc which is invalid.  

==>>	0x7FFFFFF0 F7FFB580    LDRNVB    R11,[PC,+R0,LSL #0xb]
	0x7FFFFFF4 BC80F949    DD 0xBC80F949 ; INVALID OPCODE
	0x7FFFFFF8 4718BC08    LDRMI     R11,[R8,-R8,LSL #0x18]
	0x7FFFFFFC FFFFFFFF    SWINV     0xffffff
	0x80000000 DEADDEAD    CDPLE     CP14,0xa,CR13,CR13,CR13,0x5
	0x80000004 DEADDEAD    CDPLE     CP14,0xa,CR13,CR13,CR13,0x5
	0x80000008 DEADDEAD    CDPLE     CP14,0xa,CR13,CR13,CR13,0x5

R00=0x40000EF8
R11=0x40000F30

Here is the code snip:

void attrib_RAM FlashData(void) {
   	typedef void (*IAP)(unsigned int [],unsigned int[]);
   	unsigned int command[5];
   	unsigned int result[2];
   	// setup
   	IAP iap_entry;
	Disable_INT();
   	iap_entry=(IAP) IAP_LOCATION;
   	// Prepare to erase
   	command[0]=50;
   	command[1]=14;
   	command[2]=14;
   	iap_entry(command, result);
   	if (result[0] != IAP_CMD_SUCCESS) goto error;
...

It's pretty standard.  I don't know why it is causing this crash.
I must be missing something simple.

I guess I don't know where the PC is suppose to go after 0x7FFFFFF0.  
Seems like it should go to the handler routine for cmd #50, but it 
just drops to the next instruc.

Any ideas?

Thanks, Chris.

Re: [lpc2000] IAP Problem

2005-04-24 by Bill Knight

The location is 0x7FFFFFF1 indicating that it is a Thumb mode
instruction.  A 'bx' instruction is typically used to branch
to Thumb code from ARM.  See my LPC_FlashRoutines-18Feb05.zip
post to the files section of this mailing list for operational/
example code.

Regards
-Bill Knight
R O SoftWare &
http://www.theARMPatch.com




On Sun, 24 Apr 2005 12:51:01 -0000, sig5534 wrote:



I am getting an Invalid Instruction Exception trying to get my IAP 
routines running.  When it branches to the IAP service routine at 
0x7FFFFFF0, it goes to the next instruc which is invalid.  

==>>	0x7FFFFFF0 F7FFB580    LDRNVB    R11,[PC,+R0,LSL #0xb]
	0x7FFFFFF4 BC80F949    DD 0xBC80F949 ; INVALID OPCODE
	0x7FFFFFF8 4718BC08    LDRMI     R11,[R8,-R8,LSL #0x18]
	0x7FFFFFFC FFFFFFFF    SWINV     0xffffff
	0x80000000 DEADDEAD    CDPLE     CP14,0xa,CR13,CR13,CR13,0x5
	0x80000004 DEADDEAD    CDPLE     CP14,0xa,CR13,CR13,CR13,0x5
	0x80000008 DEADDEAD    CDPLE     CP14,0xa,CR13,CR13,CR13,0x5

R00=0x40000EF8
R11=0x40000F30

Here is the code snip:

void attrib_RAM FlashData(void) {
   	typedef void (*IAP)(unsigned int [],unsigned int[]);
   	unsigned int command[5];
   	unsigned int result[2];
   	// setup
   	IAP iap_entry;
	Disable_INT();
   	iap_entry=(IAP) IAP_LOCATION;
   	// Prepare to erase
   	command[0]=50;
   	command[1]=14;
   	command[2]=14;
   	iap_entry(command, result);
   	if (result[0] != IAP_CMD_SUCCESS) goto error;
...

It's pretty standard.  I don't know why it is causing this crash.
I must be missing something simple.

I guess I don't know where the PC is suppose to go after 0x7FFFFFF0.  
Seems like it should go to the handler routine for cmd #50, but it 
just drops to the next instruc.

Any ideas?

Thanks, Chris.






Yahoo! Groups Links

Re: IAP Problem

2005-04-24 by sig5534

>  See my LPC_FlashRoutines-18Feb05.zip
> post to the files section of this mailing list for operational/
> example code.
> 
> Regards
> -Bill Knight
> R O SoftWare &
> http://www.theARMPatch.com
> 

I looked at those as well, and I actually tried sticking in some of 
the code.  But I get some errors from the GCC compiler.  Something 
about RC24_Truncation ....

You have some low level asm code doing this and it seems to make the 
GCC compiler unhappy. 

Do you know what that is about?

Chris.



> 
> On Sun, 24 Apr 2005 12:51:01 -0000, sig5534 wrote:
> 
> 
> 
> I am getting an Invalid Instruction Exception trying to get my IAP 
> routines running.  When it branches to the IAP service routine at 
> 0x7FFFFFF0, it goes to the next instruc which is invalid.  
> 
> ==>>	0x7FFFFFF0 F7FFB580    LDRNVB    R11,[PC,+R0,LSL #0xb]
> 	0x7FFFFFF4 BC80F949    DD 0xBC80F949 ; INVALID OPCODE
> 	0x7FFFFFF8 4718BC08    LDRMI     R11,[R8,-R8,LSL #0x18]
> 	0x7FFFFFFC FFFFFFFF    SWINV     0xffffff
> 	0x80000000 DEADDEAD    CDPLE     CP14,0xa,CR13,CR13,CR13,0x5
> 	0x80000004 DEADDEAD    CDPLE     CP14,0xa,CR13,CR13,CR13,0x5
> 	0x80000008 DEADDEAD    CDPLE     CP14,0xa,CR13,CR13,CR13,0x5
> 
> R00=0x40000EF8
> R11=0x40000F30
> 
> Here is the code snip:
> 
> void attrib_RAM FlashData(void) {
>    	typedef void (*IAP)(unsigned int [],unsigned int[]);
>    	unsigned int command[5];
>    	unsigned int result[2];
>    	// setup
>    	IAP iap_entry;
> 	Disable_INT();
>    	iap_entry=(IAP) IAP_LOCATION;
>    	// Prepare to erase
>    	command[0]=50;
>    	command[1]=14;
>    	command[2]=14;
>    	iap_entry(command, result);
>    	if (result[0] != IAP_CMD_SUCCESS) goto error;
> ...
> 
> It's pretty standard.  I don't know why it is causing this crash.
> I must be missing something simple.
> 
> I guess I don't know where the PC is suppose to go after 
0x7FFFFFF0.  
Show quoted textHide quoted text
> Seems like it should go to the handler routine for cmd #50, but it 
> just drops to the next instruc.
> 
> Any ideas?
> 
> Thanks, Chris.
> 
> 
> 
> 
> 
> 
> Yahoo! Groups Links

Re: [lpc2000] Re: IAP Problem

2005-04-24 by Bill Knight

I'm using that code in a project with gcc right now and do not
have any errors, warnings, or complaints from the compiler.
The compiler is version 3.4.3 from http://www.gnuarm.com
Code is compiled in ARM mode with the following parameters:
 -mcpu=arm7tdmi -O2 -ggdb -ffreestanding \
 -Wall -Wcast-align -Wcast-qual -Wimplicit -Wmissing-declarations \
 -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wswitch \
 -Wredundant-decls -Wreturn-type -Wshadow -Wstrict-prototypes -Wunused
plus some INCLUDES

Good luck
-Bill


On Sun, 24 Apr 2005 18:53:28 -0000, sig5534 wrote:



>  See my LPC_FlashRoutines-18Feb05.zip
> post to the files section of this mailing list for operational/
> example code.
> 
> Regards
> -Bill Knight
> R O SoftWare &
> http://www.theARMPatch.com
> 

I looked at those as well, and I actually tried sticking in some of 
the code.  But I get some errors from the GCC compiler.  Something 
about RC24_Truncation ....

You have some low level asm code doing this and it seems to make the 
GCC compiler unhappy. 

Do you know what that is about?

Chris.



> 
> On Sun, 24 Apr 2005 12:51:01 -0000, sig5534 wrote:
> 
> 
> 
> I am getting an Invalid Instruction Exception trying to get my IAP 
> routines running.  When it branches to the IAP service routine at 
> 0x7FFFFFF0, it goes to the next instruc which is invalid.  
> 
> ==>>	0x7FFFFFF0 F7FFB580    LDRNVB    R11,[PC,+R0,LSL #0xb]
> 	0x7FFFFFF4 BC80F949    DD 0xBC80F949 ; INVALID OPCODE
> 	0x7FFFFFF8 4718BC08    LDRMI     R11,[R8,-R8,LSL #0x18]
> 	0x7FFFFFFC FFFFFFFF    SWINV     0xffffff
> 	0x80000000 DEADDEAD    CDPLE     CP14,0xa,CR13,CR13,CR13,0x5
> 	0x80000004 DEADDEAD    CDPLE     CP14,0xa,CR13,CR13,CR13,0x5
> 	0x80000008 DEADDEAD    CDPLE     CP14,0xa,CR13,CR13,CR13,0x5
> 
> R00=0x40000EF8
> R11=0x40000F30
> 
> Here is the code snip:
> 
> void attrib_RAM FlashData(void) {
>    	typedef void (*IAP)(unsigned int [],unsigned int[]);
>    	unsigned int command[5];
>    	unsigned int result[2];
>    	// setup
>    	IAP iap_entry;
> 	Disable_INT();
>    	iap_entry=(IAP) IAP_LOCATION;
>    	// Prepare to erase
>    	command[0]=50;
>    	command[1]=14;
>    	command[2]=14;
>    	iap_entry(command, result);
>    	if (result[0] != IAP_CMD_SUCCESS) goto error;
> ...
> 
> It's pretty standard.  I don't know why it is causing this crash.
> I must be missing something simple.
> 
> I guess I don't know where the PC is suppose to go after 
0x7FFFFFF0.  
> Seems like it should go to the handler routine for cmd #50, but it 
> just drops to the next instruc.
> 
> Any ideas?
> 
> Thanks, Chris.
> 
> 
> 
> 
> 
> 
> Yahoo! Groups Links






Yahoo! Groups Links

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.