Help! isync, exceptions, dummy function problems with RTEMS (near-head) PowerPC/virtex BSP - RESOLVED

Robert S. Grimes rsg at alum.mit.edu
Tue Aug 14 16:24:24 UTC 2007


It was the stack checker!!!

Joel Sherrill wrote:
> Robert S. Grimes wrote:
>> Hi,
>>
>> I wanted to heed Joel's call to test RTEMS 4.7.99.2, so I wanted to get
>> my code into a "stable state" so I could compare the new against the
>> code I grabbed from HEAD about four weeks ago. 
> Thank you.  I really do want to get from 4.7->4.8 faster
> than 4.5->4.6 or 4.6->4.7.
>
>>  Everything has been
>> going along quite well, until I added some seemingly simple code - no
>> new tasks or other RTEMS objects, just some application level state
>> management code.  So the problem I am having is almost certainly in my
>> code, but I'm having trouble figuring out what it is, mainly because of
>> how it dies; it just hangs, and when I break into gdb, I find it is
>> stuck on the isync instruction at the very end of  _CPU_Context_switch
>> in new-exceptions/cpu_asm.S.  There is, of course, no stack information,
>> and I'm not sure how to proceed.  Call this the "isync Problem".
>>
>> Another problem I run into is and infinite "exception handler called for
>> exception 0"; this message is streamed out the console as fast as the
>> serial port allows.  Note that the register dump that is supposed to
>> follow does not happen.  Call this the "Infinite Exception 0 Problem"
>>
>> Another problem I have seen is the message "exception handler called for
>> exception 7"; this one _does_ print out the registers before it halts
>> the system (in its infinite loop).  Call this (not surprisingly) the
>> "Exception 7 Problem".
>>
>> All these problems seem to have nothing to do with anything you would
>> expect.  Right now, without having _knowingly_ fixed anything, the
>> Exception 7 Problem seems to be gone.  But I am still quite stuck!
>> However, I have a relatively simple setup where I can selectively cause
>> the Infinite Exception 0 Problem.  In this, everything works just fine.
>> But if I add this function:
>>
>>     void printCurTaskId() {
>>       rtems_id id;
>>       rtems_task_ident(RTEMS_SELF, 0, &id);
>>       printk("Current Task: $%08x\n", id);
>>     }
>>
>>
>> to the source file that contains my main initialization routine (you
>> know, the one RTEMS calls after it initializes), I get the Infinite
>> Exception 0 Problem.  Now, please note that nowhere in my code is this
>> function actually called!  If I simply comment out this function,
>> everything works just fine!  Argh!!!  As far as I can tell, nothing is
>> changed of any significance in the map files (see follow-up email, if
>> it gets
>> approved by the moderator - if you're
>> interested).  Call this one the "Dummy Function Problem" (named after
>> me, it seems!)
>>
>> So, now some specific questions:
>>
>> 1. What could cause the isync Problem?  I have absolutely no clue on
>> this one.
>>
>> 2. What are exception 0 and 7?  In the Xilinx PPC Reference Guide, they
>> document the available exceptions, but they don't give them "ID"
>> numbers; they do give, however, their "exception-vector offsets".  For
>> example, the Program Interrupt exception has an offset of 0x0700, and I
>> certainly would believe that that is exception 7; however, there is no
>> exception-vector offset 0x0000, so I don't know what Exception 0 is.  So
>> what is the mapping between the exception number reported by RTEMS and
>> the documented exceptions...
>>
>> 3. Any ideas what could cause the Dummy Function Problem, or what to
>> check?
>>
>> My hardware is fine, I have enough memory - maybe it's the phase of the
>> moon???
>>
>>   
> I suspect this is the classic problem that the BSP left
> an interrupt source enabled that should be disabled.
> You have an interrupt pending when the first context
> switch enables interrupts and it doesn't have a handler.
>
> Double check the BSP interrupt initialization.  It needs
> to clear/disable all sources and let individual drivers
> enable the ones they will handle.
>
> --joel
>> Thanks,
>> -Bob
>>
>> _______________________________________________
>> rtems-users mailing list
>> rtems-users at rtems.com
>> http://rtems.rtems.org/mailman/listinfo/rtems-users
>>   
>
>



More information about the users mailing list