Forums

Data abort in release mode, but not in debug mode. LPC2138-CrossStudio

Started by chjv...@yahoo.com.ar February 12, 2008
Hi,
I use LPC2138 with CrossStudio 1.5.
I have a problem when try to run my code compiled in release mode. When the code is compiled in debub mode works fine.
In release mode occurs a "data abort".

Why can occur this? Obviously there is a diference when the compiler optimize the code in release mode.

How can identify where is the place that "data abort" occurs?

I will try to fix that, but may be there is someone that have any idea why this its happening.

Thanks!
Christian

An Engineer's Guide to the LPC2100 Series

Hi,

> I use LPC2138 with CrossStudio 1.5.
> I have a problem when try to run my code compiled in release mode. When
> the code is compiled in debub mode works fine.
> In release mode occurs a "data abort".

Yeah, wonder why you don't call on our tech support about this one... I'll
be kind, one guess allowed. :-)

> Why can occur this? Obviously there is a diference when the compiler
> optimize the code in release mode.
>
> How can identify where is the place that "data abort" occurs?
>
> I will try to fix that, but may be there is someone that have any idea
> why this its happening.

Man, you're on your own with this one I hope.

--
Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
CrossWorks for ARM, MSP430, AVR, MAXQ, and now Cortex-M3 processors
----- Original Message ----
From: "c...@yahoo.com.ar"
To: l...
Sent: Tuesday, February 12, 2008 1:29:13 PM
Subject: [lpc2000] Data abort in release mode, but not in debug mode. LPC2138-CrossStudio

Hi,
I use LPC2138 with CrossStudio 1.5.
I have a problem when try to run my code compiled in release mode. When the code is compiled in debub mode works fine.
In release mode occurs a "data abort".

Why can occur this? Obviously there is a diference when the compiler optimize the code in release mode.

How can identify where is the place that "data abort" occurs?

--------------------

I believe that you can set a breakpoint on the vector for the data handler, and when the exception hits note the value of R14. Subtract 8 from that value and you will have the address where the exception took place. If you cannot run it in the debugger then you can do the same programmatically and arrange to have the value displayed or stored.

AW
____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs
--- In l..., Alexander Whiplash
wrote:
> ----- Original Message ----
> From: "chjvergara@..."
> To: l...
> Sent: Tuesday, February 12, 2008 1:29:13 PM
> Subject: [lpc2000] Data abort in release mode, but not in debug
mode. LPC2138-CrossStudio
>
> Hi,
> I use LPC2138 with CrossStudio 1.5.
> I have a problem when try to run my code compiled in release mode.
When the code is compiled in debub mode works fine.
> In release mode occurs a "data abort".
>
> Why can occur this? Obviously there is a diference when the
compiler optimize the code in release mode.
>
> How can identify where is the place that "data abort" occurs?
>
> --------------------
>
> I believe that you can set a breakpoint on the vector for the data
handler, and when the exception hits note the value of R14. Subtract
8 from that value and you will have the address where the exception
took place. If you cannot run it in the debugger then you can do the
same programmatically and arrange to have the value displayed or
stored.
>
> AW
>
______________________________________________________________________
______________
> Never miss a thing. Make Yahoo your home page.
> http://www.yahoo.com/r/hs
>
Thanks Alexander. I identified where the data abort occurs.

:
E20000FF and r0, r0, #0x000000FF
E3A0328E mov r3, #0xE0000008
E2833802 add r3, r3, #0x00020000
E5C30000 strb r0, [r3] <--------------Here
E3A0224E mov r2, #0xE0000004

Sometimes the r3 value change to 0xE0040008 and the data abort
occurs. But I could not understand why because the r3 value must be
0xE0020008.

E3A0328E mov r3, #0xE0000008
E2833802 add r3, r3, #0x00020000
In "Project Option -> Compiler" in CrossStudio was enabled the
ARM/THUMB interworking option. I not use anything relationed with
THUMB mode, I disable this option and the aplications works fine.
Thanks.