Reply by Bill Knight April 24, 20052005-04-24
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]P;
> command[1];
> command[2];
> 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


An Engineer's Guide to the LPC2100 Series

Reply by sig5534 April 24, 20052005-04-24

> 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]P;
> command[1];
> command[2];
> 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



Reply by Bill Knight April 24, 20052005-04-24
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]P;
command[1];
command[2];
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


Reply by sig5534 April 24, 20052005-04-24

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]P;
command[1];
command[2];
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.