Strange bug on EP9302-based custom board

Joel Sherrill <joel@OARcorp.com> joel.sherrill at OARcorp.com
Wed Dec 14 15:23:11 UTC 2005


Jay Monkman wrote:
> Fabien CASAS wrote:
> 
>>Hi all !
>>
>>I'm porting RTEMS to an EP9302(ARM9)-based custom board, starting from
>>ARM ports, and I'm stuck on a strange bug.
>>I've got a base port that provides a console, a clock driver and some
>>board-specific drivers. This base port seems to run fine, except for
>>some improvements to be done.
>>BUT : when I add a call to a function (e.g. a call to
>>rtems_task_wake_after), or when I just add a local variable into a
>>function of one of my drivers, the whole executive crashes, before the
>>function is called.
> 
> 
> Without this driver, does the ticker test run correctly?

Always a good question to get answered. :)

Where are you calling wake after from?  It should NEVER be called from 
an ISR as it is a blocking call.

It cannot be called before tasking is started.  That means it cannot be 
called in driver initialization that occurs before the Init task runs.

>>- or it hangs at the Undefined exception vector with a link register
>>pointing to the IRQ exception vector.
> 
> 
> This is the execption whose handler lives at address 0x00000004? You need to
> find out what instruction is causing that.
> 
> Set a breakpoint at bsp_pretasking_hook() or some other function that gets
> called early on.
> 
> Start you application. When you hit the breakpoint, set a new breakpoint at
> 0x0000004.
> 
> Continue execution.
> 
> When you hit the breakpoint at 0x0000004, the Link Register will have the
> address of 2 instructions past the one that caused you to get the exception.
> 
> 
> 
> If you are using software breakpoints, you have to stop execution before a
> breakpoint on the execption vectors gets hit. Very early in startup, the
> addresses of the exception handlers are copied to the exception vectors,
> overwriting any software breakpoint you've set. When you stop and restart GDB,
> the breakpoint gets re-inserted.


-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel at OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
    Support Available             (256) 722-9985




More information about the users mailing list