<div dir="auto"><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Jul 23, 2017 5:15 PM, "Denis Obrezkov" <<a href="mailto:denisobrezkov@gmail.com">denisobrezkov@gmail.com</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div class="quoted-text">2017-07-23 22:30 GMT+02:00 Joel Sherrill <span dir="ltr"><<a href="mailto:joel@rtems.org" target="_blank">joel@rtems.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div>Increasing the stack size effectively eliminated a data corruption issue. The memory corrupted likely was an RTEMS internal object structure.</div><div dir="auto"><br></div><div dir="auto">What is the stack frame size required by each subroutine call?</div></div></blockquote></div><div>How can I determine it?</div></div></div></div></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">If it isn't directly in the CPU's ABI definition, then what is pushed to the stack or reserved on each subroutine call. You may see it in terms of stack pointer, frame pointer, reserved space, etc.</div><div dir="auto"><br></div><div dir="auto">For example, the m68k had a minimum of 4 registers saved and the return address. More registers could be saved for complicated methods.</div><div dir="auto"><br></div><div dir="auto">I think some risc CPU has a number like 172 bytes reserved for possible register saves. </div><div dir="auto"><br></div><div dir="auto">So the scheme varies </div><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div class="quoted-text"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div dir="auto"><br></div><div dir="auto">How much stack to call printf()?</div><div dir="auto"><br></div><div dir="auto">The minimum is an educated guess by the porter that is large enough to run many/most small applications. You should be able to call RTEMS services and do a context switch.</div><div dir="auto"><br></div><div dir="auto">Hope that helps pick one. :)</div></div></blockquote><div><br></div></div><div>As for now, I have increased the minimum stack size and get the following output:</div><div class="quoted-text">
<p style="margin:0px">*** LOW MEMORY CLOCK TICK TEST ***</p>
<p style="margin:0px">TA1  - rtems_clock_get_tod - 09:00:00   12/31/1988</p>
</div><p style="margin:0px">TA2  - rtems_clock_get_tod - 09:00:00   12/31/1988</p>
<div><span style="white-space:pre-wrap">TA3  - rtems_clock_get_tod - 09:00:00   12/31/1988</span></div><div><br></div><div>I will try to determine how to proceed further.</div><font color="#888888"><div> <br></div></font></div><font color="#888888"><br clear="all"><div><br></div>-- <br><div class="m_2078125371786812759gmail_signature">Regards, Denis Obrezkov</div>
</font></div></div>
</blockquote></div><br></div></div></div>