Exception handling

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Exception handling

Jitendra B  Shinde
Hi
        We are using MCF5272  with Codewarrior IDE. When I am running software it gives me exception & Codewarrior IDE just halts into the exceptions handler & stops executing. Is there any way to know from which function / program pointer, this exception has come ?


Thanks
Jitendra Shinde
L&T ,Mysore
INDIA

--------------------------------------------------------------------
To Subscribe send a message to:      [hidden email]
To Unsubscribe send a message to:    [hidden email]
For further information, visit:      <http://www.WildRice.com/ColdFire/>



Reply | Threaded
Open this post in threaded view
|

Re: Exception handling

Friedrich Lobenstock
Jitendra B Shinde wrote on 09.06.2005 10:41 MET:
> We are using MCF5272  with Codewarrior IDE. When I am running software it
> gives me exception & Codewarrior IDE just halts into the exceptions handler &
> stops executing. Is there any way to know from which function / program
> pointer, this exception has come ?

Read the manual about exeptions. The stack will contain info about that exception.

MCF5272UM/D 3/2002 REV 2
MCF5272 ColdFire® Integrated Microprocessor User's Manual

Chapter 2.8 Exception Processing Overview

--
MfG / Regards
Friedrich Lobenstock
--------------------------------------------------------------------
To Subscribe send a message to:      [hidden email]
To Unsubscribe send a message to:    [hidden email]
For further information, visit:      <http://www.WildRice.com/ColdFire/>


Reply | Threaded
Open this post in threaded view
|

RE: Exception handling

Garg, Navin
In reply to this post by Jitendra B Shinde
Jitendra,

I don't have an answer to your question. However, I believe you might be
able to help me. I am trying to boot from flash, run some init code,
copy main application to sdram and execute from sdram. I am trying to do
this on a MCF5275EVB ColdFire eval board using the CodeWarrior IDE. I
believe I saw an earlier posting where you indicated that you may have
done something similar on a 5272.

I can see my boot loader start up from flash, initialize and copy
application to sdram and jumps to it, but just a few steps later dies. I
probably don't have the exception/vector tables set correctly or
something. Would it be possible for you to guide me through setting up
of the bootloader and then anything that needs to be done in the main
application. I would greatly appreciate if you could provide a sample
bootloader/main app/.lcf file or any other pointers would be extremely
helpful.

Thanks
Navin
[hidden email]

>>-----Original Message-----
>>From: [hidden email]
>>[mailto:[hidden email]] On Behalf Of Jitendra B Shinde
>>Sent: Thursday, June 09, 2005 4:42 AM
>>To: Garg, Navin
>>Subject: [ColdFire] Exception handling
>>
>>
>>Hi
>>        We are using MCF5272  with Codewarrior IDE. When I am
>>running software it gives me exception & Codewarrior IDE just
>>halts into the exceptions handler & stops executing. Is there
>>any way to know from which function / program pointer, this
>>exception has come ?
>>
>>
>>Thanks
>>Jitendra Shinde
>>L&T ,Mysore
>>INDIA
>>
>>--------------------------------------------------------------------
>>To Subscribe send a message to:      [hidden email]
>>To Unsubscribe send a message to:    [hidden email]
>>For further information, visit:      
>><http://www.WildRice.com/ColdFire/>
>>
>>
--------------------------------------------------------------------
To Subscribe send a message to:      [hidden email]
To Unsubscribe send a message to:    [hidden email]
For further information, visit:      <http://www.WildRice.com/ColdFire/>


Reply | Threaded
Open this post in threaded view
|

RE: Exception handling

Jitendra B  Shinde
In reply to this post by Jitendra B Shinde
Navin,
    Yeh,  I have done similar kind of implementation for my project also.
    But it will not help you if I send you some kind of ref from my project, rather it will confuse you , because my requirements were very complicated  & was not just a bootloader ....If you expect some help from me , you can send your implementation to me, of course offline,  I believe, I can review & give you some tips.
   

Regds
Jitendra Shinde
Larsen &Toubro Ltd ,
Embedded System & Software  Development centre -EmSyS
Mysore -INDIA





>>> [hidden email] 06/09/05 08:01PM >>>
Jitendra,

I don't have an answer to your question. However, I believe you might be
able to help me. I am trying to boot from flash, run some init code,
copy main application to sdram and execute from sdram. I am trying to do
this on a MCF5275EVB ColdFire eval board using the CodeWarrior IDE. I
believe I saw an earlier posting where you indicated that you may have
done something similar on a 5272.

I can see my boot loader start up from flash, initialize and copy
application to sdram and jumps to it, but just a few steps later dies. I
probably don't have the exception/vector tables set correctly or
something. Would it be possible for you to guide me through setting up
of the bootloader and then anything that needs to be done in the main
application. I would greatly appreciate if you could provide a sample
bootloader/main app/.lcf file or any other pointers would be extremely
helpful.

Thanks
Navin
[hidden email]

>>-----Original Message-----
>>From: [hidden email]
>>[mailto:[hidden email]] On Behalf Of Jitendra B Shinde
>>Sent: Thursday, June 09, 2005 4:42 AM
>>To: Garg, Navin
>>Subject: [ColdFire] Exception handling
>>
>>
>>Hi
>>        We are using MCF5272  with Codewarrior IDE. When I am
>>running software it gives me exception & Codewarrior IDE just
>>halts into the exceptions handler & stops executing. Is there
>>any way to know from which function / program pointer, this
>>exception has come ?
>>
>>
>>Thanks
>>Jitendra Shinde
>>L&T ,Mysore
>>INDIA
>>
>>--------------------------------------------------------------------
>>To Subscribe send a message to:      [hidden email]
>>To Unsubscribe send a message to:    [hidden email]
>>For further information, visit:      
>><http://www.WildRice.com/ColdFire/>
>>
>>
--------------------------------------------------------------------
To Subscribe send a message to:      [hidden email]
To Unsubscribe send a message to:    [hidden email]
For further information, visit:      <http://www.WildRice.com/ColdFire/>


--------------------------------------------------------------------
To Subscribe send a message to:      [hidden email]
To Unsubscribe send a message to:    [hidden email]
For further information, visit:      <http://www.WildRice.com/ColdFire/>


Reply | Threaded
Open this post in threaded view
|

Re: Exception handling

Jitendra B  Shinde
In reply to this post by Jitendra B Shinde
Friedrich ,
 I have already gone through this doc, it only talks about if exception happens how it is handled by CPU  & what are the different possibilities of exception, but doesn't give any info from which location of program memory CPU has detected the exception ??



Thanks,
Jitendra Shinde
Larsen &Toubro Ltd ,
Embedded System & Software  Development centre -EmSyS
Mysore -INDIA




>>> [hidden email] 06/09/05 04:22PM >>>
Jitendra B Shinde wrote on 09.06.2005 10:41 MET:
> We are using MCF5272  with Codewarrior IDE. When I am running software it
> gives me exception & Codewarrior IDE just halts into the exceptions handler &
> stops executing. Is there any way to know from which function / program
> pointer, this exception has come ?

Read the manual about exeptions. The stack will contain info about that exception.

MCF5272UM/D 3/2002 REV 2
MCF5272 ColdFire® Integrated Microprocessor User's Manual

Chapter 2.8 Exception Processing Overview

--
MfG / Regards
Friedrich Lobenstock
--------------------------------------------------------------------
To Subscribe send a message to:      [hidden email]
To Unsubscribe send a message to:    [hidden email]
For further information, visit:      <http://www.WildRice.com/ColdFire/>


--------------------------------------------------------------------
To Subscribe send a message to:      [hidden email]
To Unsubscribe send a message to:    [hidden email]
For further information, visit:      <http://www.WildRice.com/ColdFire/>


Reply | Threaded
Open this post in threaded view
|

Re: Exception handling

msalish
In reply to this post by Jitendra B Shinde
The exception stack frame does give explicitly the address where the exception happened. Look at the CF Prog Ref Manual Sec 11.1.2


> Friedrich ,
>  I have already gone through this doc, it only talks about if exception happens
> how it is handled by CPU  & what are the different possibilities of exception,
> but doesn't give any info from which location of program memory CPU has detected
> the exception ??
>
>
>
> Thanks,
> Jitendra Shinde
> Larsen &Toubro Ltd ,
> Embedded System & Software  Development centre -EmSyS
> Mysore -INDIA
>
>
>
>
> >>> [hidden email] 06/09/05 04:22PM >>>
> Jitendra B Shinde wrote on 09.06.2005 10:41 MET:
> > We are using MCF5272  with Codewarrior IDE. When I am running software it
> > gives me exception & Codewarrior IDE just halts into the exceptions handler &
> > stops executing. Is there any way to know from which function / program
> > pointer, this exception has come ?
>
> Read the manual about exeptions. The stack will contain info about that
> exception.
>
> MCF5272UM/D 3/2002 REV 2
> MCF5272 ColdFire� Integrated Microprocessor User's Manual
>
> Chapter 2.8 Exception Processing Overview
>
> --
> MfG / Regards
> Friedrich Lobenstock
> --------------------------------------------------------------------
> To Subscribe send a message to:      [hidden email]
> To Unsubscribe send a message to:    [hidden email]
> For further information, visit:      <http://www.WildRice.com/ColdFire/>
>
>
> --------------------------------------------------------------------
> To Subscribe send a message to:      [hidden email]
> To Unsubscribe send a message to:    [hidden email]
> For further information, visit:      <http://www.WildRice.com/ColdFire/>
>
--------------------------------------------------------------------
To Subscribe send a message to:      [hidden email]
To Unsubscribe send a message to:    [hidden email]
For further information, visit:      <http://www.WildRice.com/ColdFire/>


Reply | Threaded
Open this post in threaded view
|

Re: Exception handling

Friedrich Lobenstock
In reply to this post by Jitendra B Shinde
Jitendra B Shinde wrote on 10.06.2005 05:13 MET:
> Friedrich ,
>  I have already gone through this doc, it only talks about if exception happens how it is handled by CPU  & what are the different possibilities of exception, but doesn't give any info from which location of program memory CPU has detected the exception ??

Yes of course, the program counter (PC) of the offending command (or the
command after it) is saved if you've read the docs again.


page 2-26:

2.8 Exception Processing Overview

3. The processor saves the current context by creating an exception stack
frame on the system stack. ColdFire processors support a single stack
pointer in the A7 address register; therefore, there is no notion of
separate supervisor and user stack pointers. As a result, the exception
stack frame is created at a 0-modulo-4 address on the top of the current
system stack. Additionally, the processor uses a simplified fixed-length
stack frame for all exceptions. The exception type determines whether the
program counter in the exception stack frame defines the address of the
faulting instruction (fault) or of the next instruction to be executed (next).



>
>>>>[hidden email] 06/09/05 04:22PM >>>
> Jitendra B Shinde wrote on 09.06.2005 10:41 MET:
>>We are using MCF5272  with Codewarrior IDE. When I am running software it
>>gives me exception & Codewarrior IDE just halts into the exceptions handler &
>>stops executing. Is there any way to know from which function / program
>>pointer, this exception has come ?
>
> Read the manual about exeptions. The stack will contain info about that exception.
>
> MCF5272UM/D 3/2002 REV 2
> MCF5272 ColdFire® Integrated Microprocessor User's Manual
>
> Chapter 2.8 Exception Processing Overview
>


--
MfG / Regards
Friedrich Lobenstock
--------------------------------------------------------------------
To Subscribe send a message to:      [hidden email]
To Unsubscribe send a message to:    [hidden email]
For further information, visit:      <http://www.WildRice.com/ColdFire/>


Reply | Threaded
Open this post in threaded view
|

Re: Exception handling

Jitendra B  Shinde
In reply to this post by Jitendra B Shinde
Friedrich ,
  Yes ,I got it .. I could locate PC from which I was getting exceptions.....Thanks for your inputs.




-Jitendra Shinde




>>> [hidden email] 06/10/05 03:07PM >>>
Jitendra B Shinde wrote on 10.06.2005 05:13 MET:
> Friedrich ,
>  I have already gone through this doc, it only talks about if exception happens how it is handled by CPU  & what are the different possibilities of exception, but doesn't give any info from which location of program memory CPU has detected the exception ??

Yes of course, the program counter (PC) of the offending command (or the
command after it) is saved if you've read the docs again.


page 2-26:

2.8 Exception Processing Overview

3. The processor saves the current context by creating an exception stack
frame on the system stack. ColdFire processors support a single stack
pointer in the A7 address register; therefore, there is no notion of
separate supervisor and user stack pointers. As a result, the exception
stack frame is created at a 0-modulo-4 address on the top of the current
system stack. Additionally, the processor uses a simplified fixed-length
stack frame for all exceptions. The exception type determines whether the
program counter in the exception stack frame defines the address of the
faulting instruction (fault) or of the next instruction to be executed (next).



>
>>>>[hidden email] 06/09/05 04:22PM >>>
> Jitendra B Shinde wrote on 09.06.2005 10:41 MET:
>>We are using MCF5272  with Codewarrior IDE. When I am running software it
>>gives me exception & Codewarrior IDE just halts into the exceptions handler &
>>stops executing. Is there any way to know from which function / program
>>pointer, this exception has come ?
>
> Read the manual about exeptions. The stack will contain info about that exception.
>
> MCF5272UM/D 3/2002 REV 2
> MCF5272 ColdFire® Integrated Microprocessor User's Manual
>
> Chapter 2.8 Exception Processing Overview
>


--
MfG / Regards
Friedrich Lobenstock
--------------------------------------------------------------------
To Subscribe send a message to:      [hidden email]
To Unsubscribe send a message to:    [hidden email]
For further information, visit:      <http://www.WildRice.com/ColdFire/>


--------------------------------------------------------------------
To Subscribe send a message to:      [hidden email]
To Unsubscribe send a message to:    [hidden email]
For further information, visit:      <http://www.WildRice.com/ColdFire/>