This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problem while Performing SoftReset when exception occurs


Gary D. Thomas wrote:
On Fri, 2003-02-14 at 22:39, venkatadri potluri wrote:

i am using MPC860 based board. when ever exception occurs i want to reset
the board.i am generating CYGNUM_HAL_VECTOR_DTLB_MISS exception for
testing.


Have you tried calling HAL_PLATFORM_RESET() in your handler? This should invoke a sequence which resets the platform and is much safer
than just calling the reset handler.
If HAL_PLATFORM_RESET() isn't defined (or for the MPC8xx if you don't have a QUICC, since it just loops forever otherwise, which is somewhat bogus actually - it just shouldn't be defined instead) then branching to the start address _may_ be okay but there are some things I saw you (Venkatadri) missed:

The problem i am facing is when ever exception occurs control is going to
exception handler and then to _exception_reset, up to here it is OK. While
booting up ecos again control is hanging in cyg_hal_invoke_constuctors().
if we debug inside cyg_hal_invoke_constuctors(), control path is like
this



Cyg_Exception_Control::Cyg_Exception_Control
                   |
		    |
      cyg_hal_default_exception_vsr
                   |
                   |
       cyg_hal_exception_handler
                   |
		    |
Cyg_Exception_Control::deliver_exception


and control is switching between cyg_hal_exception_handler and
deliver_exception.  i guess  exception was not cleared properly.

so how to clear the  exception or solve this problem..
Look at the powerPC exception handler in vectors.S, specifically restore_state. You should also disable interrupts and disable the MMU. Otherwise the system may not be in the state it expects (depends on the specific platform setup code admittedly) and in particular you may get an interrupt when you're not in a state to receive them.

Finally, if this is a RAM startup app rather than something booted straight from ROM/Flash stuff like the data section won't have been reset. If that's what you want you'd either have to reload the data section or even stash away a copy of the initial state of the data section at boot time!

But yes, if at all possible use HAL_PLATFORM_RESET, or if that doesn't work, some other hardware watchdog.

Jifl
--
eCosCentric http://www.eCosCentric.com/ The eCos and RedBoot experts
--[ "You can complain because roses have thorns, or you ]--
--[ can rejoice because thorns have roses." -Lincoln ]-- Opinions==mine


--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]