<HTML dir=ltr><HEAD><TITLE>Re: Partition problem</TITLE>
<META http-equiv=Content-Type content="text/html; charset=unicode">
<META content="MSHTML 6.00.2900.3199" name=GENERATOR></HEAD>
<BODY>
<DIV id=idOWAReplyText34652 dir=ltr>
<DIV dir=ltr><FONT size=2>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.</FONT></DIV>
<DIV dir=ltr><FONT size=2></FONT> </DIV>
<DIV dir=ltr><FONT size=2>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. </FONT></DIV>
<DIV dir=ltr><FONT size=2></FONT> </DIV>
<DIV dir=ltr><FONT size=2>Allen Kitchen</FONT></DIV>
<DIV dir=ltr><FONT size=2></FONT> </DIV>
<DIV dir=ltr><FONT size=2>><BR>> I tried to catch this with my bdm debugger, but after one full day I gave<BR>> up -<BR>> too complex to catch this at the moment of corruption as this value<BR>> changes<BR>> all the time.<BR><BR>yeah, good luck trying to catch that one! :P<BR>_______________________________________________<BR>rtems-users mailing list<BR>rtems-users@rtems.com<BR><A href="http://rtems.rtems.org/mailman/listinfo/rtems-users">http://rtems.rtems.org/mailman/listinfo/rtems-users</A><BR></DIV></FONT></DIV></BODY></HTML>