Partition problem

Kitchen, George A. (JSC-EV)[ESCG] george.a.kitchen at nasa.gov
Tue Oct 23 13:33:07 UTC 2007


One little trick I use in my mcus is to create a tiny hex code log in 256 byte field of zeros.  When task one reads data, you put a 0x10 into the circular buffer.  When Task one finishs reading, you put a 0x11 in.  When Task two reads you put 0x20 and 0x21 into the circular buffer.  When tasks write, you put 0x12 and 0x13 for task one and 0x22 and 0x23 for task two.  Just create a WriteToLog(char x) function and call it at the start and end of your functions that read/write your shared data. It is also wise to write a 0x00 to the next space in the circular within that routine so you know what the last write to the log was when you examine the memory later.
 
After a crash, you can examine that memory space and see what function started before the previous function ended.  Most people know about problems starting a read before you finish a write, but I've also spotted writes starting in the middle of a read this way.  This will ident a corrupting out of sequence execution problem to you.  RTEMS also allows you to set critical section of code so it is not interrupted, particularly important during writing to shared structures.  
 
Allen Kitchen
 
>
> I tried to catch this with my bdm debugger, but after one full day I gave
> up -
> too complex to catch this at the moment of corruption as this value
> changes
> all the time.

yeah, good luck trying to catch that one! :P
_______________________________________________
rtems-users mailing list
rtems-users at rtems.com
http://rtems.rtems.org/mailman/listinfo/rtems-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20071023/775fb867/attachment-0001.html>


More information about the users mailing list