<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2017-07-23 15:20 GMT+02:00 Denis Obrezkov <span dir="ltr"><<a href="mailto:denisobrezkov@gmail.com" target="_blank">denisobrezkov@gmail.com</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="ltr"><div><div class="gmail-h5"><div>2017-07-22 21:24 GMT+02:00 Joel Sherrill <span dir="ltr"><<a href="mailto:joel@rtems.org" target="_blank">joel@rtems.org</a>></span>:<br></div></div></div><div class="gmail_extra"><div><div class="gmail-h5"><div class="gmail_quote"><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"><span class="gmail-m_8010678515499489926gmail-"><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Jul 22, 2017 3:01 PM, "Denis Obrezkov" <<a href="mailto:denisobrezkov@gmail.com" target="_blank">denisobrezkov@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail-m_8010678515499489926gmail-m_-2630517832992178285quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hello, I am trying to enable a dummy clock driver.<div>I did as Joel suggested like in v850sim BSP.</div><div>But now I have a problem - the driver isn't initialized properly.</div><div>I receive an exception "Illegal instruction" during rtems_io_initialize.</div><div>The line with the exception is /cpukit/sapi/src/ioinitialize.<wbr>c:36:</div><div>return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL<br></div><div><br></div><div>and "p callout" in gdb returns:</div><div>(rtems_device_driver_entry) 0x2040087c <Clock_initialize+34><br></div><div><br></div><div>What could be the reason for such a behavior?</div></div></blockquote></div></div></div><div dir="auto"><br></div></span><div dir="auto">Accidental data overwrite?</div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail-m_8010678515499489926gmail-m_-2630517832992178285quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><font color="#888888"><div><br><span class="gmail-m_8010678515499489926gmail-HOEnZb"><font color="#888888"><div><div><br></div>-- <br><div class="gmail-m_8010678515499489926gmail-m_-2630517832992178285m_-7900291833434481661gmail_signature">Regards, Denis Obrezkov</div>
</div></font></span></div></font></div><span class="gmail-m_8010678515499489926gmail-HOEnZb"><font color="#888888">
<br>______________________________<wbr>_________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman<wbr>/listinfo/devel</a><br></font></span></blockquote></div><br></div></div></div>
</blockquote></div><br></div></div>I was able to proceed further by enabling a console driver. But I can't create a thread, because of an error.<div>For example, I have a backtrace:</div><div><div>#0 0x20408984 in rtems_task_start (id=<a href="tel:(214)%20748-8832" value="+12147488832" target="_blank">2147488832</a>, entry_point=0x80001448, argument=16777216)</div><div> at /home/reprofy/Projects/riscv/<wbr>rtems/development/rtems/<wbr>kernel/rtems-riscv/c/src/../..<wbr>/cpukit/rtems/src/taskstart.c:<wbr>29</div><div>#1 0x204004c6 in Init (argument=0) at /home/reprofy/Projects/riscv/<wbr>rtems/development/rtems/<wbr>kernel/rtems-riscv/c/src/../..<wbr>/testsuites/samples/ticker/<wbr>init.c:59</div><div>#2 0x20410438 in _Thread_Entry_adaptor_idle (executing=0x80000f88)</div><div> at /home/reprofy/Projects/riscv/<wbr>rtems/development/rtems/<wbr>kernel/rtems-riscv/c/src/../..<wbr>/cpukit/score/src/<wbr>threadentryadaptoridle.c:25</div><div>#3 0x2041ba5c in _Thread_Handler () at /home/reprofy/Projects/riscv/<wbr>rtems/development/rtems/<wbr>kernel/rtems-riscv/c/src/../..<wbr>/cpukit/score/src/<wbr>threadhandler.c:73</div><div>#4 0x2041b9fa in _User_extensions_Thread_<wbr>exitted (executing=0x80000f88) at ../../cpukit/../../../hifive1/<wbr>lib/include/rtems/score/<wbr>userextimpl.h:298</div><div><br></div><div>But after several steps it is:</div><div><div>#0 0x204104f2 in _Objects_Are_ids_equal (left=541099722, right=<a href="tel:(214)%20749-0432" value="+12147490432" target="_blank">2147490432</a>) at ../../cpukit/../../../hifive1/<wbr>lib/include/rtems/score/<wbr>objectimpl.h:817</div><div>#1 0x2041057a in _Thread_Get (id=167837697, lock_context=0x80001a58) at /home/reprofy/Projects/riscv/<wbr>rtems/development/rtems/<wbr>kernel/rtems-riscv/c/src/../..<wbr>/cpukit/score/src/threadget.c:<wbr>28</div><div>#2 0x204089c0 in rtems_task_start (id=167837697, entry_point=0x204003a4 <Test_task>, argument=1)</div><div> at /home/reprofy/Projects/riscv/<wbr>rtems/development/rtems/<wbr>kernel/rtems-riscv/c/src/../..<wbr>/cpukit/rtems/src/taskstart.c:<wbr>43</div><div>#3 0x204004c6 in Init (argument=0) at /home/reprofy/Projects/riscv/<wbr>rtems/development/rtems/<wbr>kernel/rtems-riscv/c/src/../..<wbr>/testsuites/samples/ticker/<wbr>init.c:59</div><div>#4 0x20410438 in _Thread_Entry_adaptor_idle (executing=0x80000f88)</div><div> at /home/reprofy/Projects/riscv/<wbr>rtems/development/rtems/<wbr>kernel/rtems-riscv/c/src/../..<wbr>/cpukit/score/src/<wbr>threadentryadaptoridle.c:25</div><div>#5 0x2041ba5c in _Thread_Handler () at /home/reprofy/Projects/riscv/<wbr>rtems/development/rtems/<wbr>kernel/rtems-riscv/c/src/../..<wbr>/cpukit/score/src/<wbr>threadhandler.c:73</div><div>#6 0x2041b9fa in _User_extensions_Thread_<wbr>exitted (executing=0x80000f88) at ../../cpukit/../../../hifive1/<wbr>lib/include/rtems/score/<wbr>userextimpl.h:298</div><div>Backtrace stopped: frame did not save the PC</div></div><div><br></div><div>You can see that rtems_task_start arguments have been changed. Though it is the same function. </div><div>Also, the value of 'left' in _Objects_Are_ids_equal should be 'id' value from _Thread_Get.</div></div><div><br></div><div><br></div>-- <br><div class="gmail-m_8010678515499489926gmail_signature">Regards, Denis Obrezkov</div>
</div></div><div class="gmail_extra"><div><div class="gmail-h5"><br><div class="gmail_quote">2017-07-22 21:24 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"><span><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Jul 22, 2017 3:01 PM, "Denis Obrezkov" <<a href="mailto:denisobrezkov@gmail.com" target="_blank">denisobrezkov@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail-m_8010678515499489926m_-2630517832992178285quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hello, I am trying to enable a dummy clock driver.<div>I did as Joel suggested like in v850sim BSP.</div><div>But now I have a problem - the driver isn't initialized properly.</div><div>I receive an exception "Illegal instruction" during rtems_io_initialize.</div><div>The line with the exception is /cpukit/sapi/src/ioinitialize.<wbr>c:36:</div><div>return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL<br></div><div><br></div><div>and "p callout" in gdb returns:</div><div>(rtems_device_driver_entry) 0x2040087c <Clock_initialize+34><br></div><div><br></div><div>What could be the reason for such a behavior?</div></div></blockquote></div></div></div><div dir="auto"><br></div></span><div dir="auto">Accidental data overwrite?</div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail-m_8010678515499489926m_-2630517832992178285quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><font color="#888888"><div><br><span class="gmail-m_8010678515499489926HOEnZb"><font color="#888888"><div><div><br></div>-- <br><div class="gmail-m_8010678515499489926m_-2630517832992178285m_-7900291833434481661gmail_signature">Regards, Denis Obrezkov</div>
</div></font></span></div></font></div><span class="gmail-m_8010678515499489926HOEnZb"><font color="#888888">
<br>______________________________<wbr>_________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman<wbr>/listinfo/devel</a><br></font></span></blockquote></div><br></div></div></div>
</blockquote></div><br><br clear="all"><div><br></div></div></div><span class="gmail-HOEnZb"><font color="#888888">-- <br><div class="gmail-m_8010678515499489926gmail_signature">Regards, Denis Obrezkov</div></font></span></div></blockquote><div>My stack size was only 256. </div></div>I increased it back to 512, so now I obtain:</div><div class="gmail_extra"><div class="gmail_extra">*** LOW MEMORY CLOCK TICK TEST ***</div><div class="gmail_extra"> TA1 - rtems_clock_get_tod - 09:00:00 12/31/1988</div><div class="gmail_extra"> TA-2147475599 - rtems_clock_get_tod - 09:00:00 12/31/1988</div><div class="gmail_extra"><br></div>(I haven't implemented in the console driver a special symbol substitution (\n -> \r))<br clear="all"><div>The name of the task in not very pleasant. </div><div><br></div><div>Also, should printk work without "CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER" being defined?</div><div><br></div>-- <br><div class="gmail_signature">Regards, Denis Obrezkov</div>
</div></div>