<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jun 12, 2017 at 11:09 AM, Denis Obrezkov <span dir="ltr"><<a href="mailto:denisobrezkov@gmail.com" target="_blank">denisobrezkov@gmail.com</a>></span> wrote:<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">Hello all,<div><br></div><div>I was able to debug my program on top of HiFive1 board.</div><div>I found out that I can't use next and until commands from gdb,</div><div>they just hang gdb.</div><div>And now I have a problem, this is my backtrace:</div><div><br></div><div><div>#0  0x2041d728 in _User_extensions_Iterate (arg=0x80002eb8, visitor=0x2041d64e <_User_extensions_Fatal_<wbr>visitor>, direction=CHAIN_ITERATOR_<wbr>FORWARD)</div><div>    at /home/reprofy/Projects/riscv/<wbr>rtems/development/rtems/<wbr>kernel/rtems-riscv/c/src/../..<wbr>/cpukit/score/src/<wbr>userextiterate.c:155</div><div>#1  0x20410ed4 in _User_extensions_Fatal (source=INTERNAL_ERROR_CORE, error=2) at ../../cpukit/../../../hifive1/<wbr>lib/include/rtems/score/<wbr>userextimpl.h:307</div><div>#2  0x20410ef8 in _Terminate (the_source=INTERNAL_ERROR_<wbr>CORE, the_error=2) at /home/reprofy/Projects/riscv/<wbr>rtems/development/rtems/<wbr>kernel/rtems-riscv/c/src/../..<wbr>/cpukit/score/src/interr.c:35</div><div>#3  0x20410f40 in _Internal_error (core_error=INTERNAL_ERROR_<wbr>TOO_LITTLE_WORKSPACE) at /home/reprofy/Projects/riscv/<wbr>rtems/development/rtems/<wbr>kernel/rtems-riscv/c/src/../..<wbr>/cpukit/score/src/interr.c:44</div></div></div></blockquote><div><br></div><div>^^^^^^ </div><div><br></div><div>Looks like there isn't enough RAM for the amount of workspace needed. This could indicate </div><div>that your address map is wrong or that the calculation in bsp_work_area_initialize_<wbr>default()</div><div>is doing the right thing and there really isn't enough RAM left after the BSS.</div><div><br></div><div>Look at a symbol table sorted by address (nm -n -g) and look for the various segment</div><div>boundaries. See how that corresponds to the address map of the board.</div><div><br></div><div>Also in gdb, you can poke at a program a bit without really loading it on a target.</div><div>This can be done to look at the Configuration Table and other statically initialized</div><div>data structures.</div><div><br></div><div>XXX-gdb hello.exe</div><div>(gdb) p Configuration</div><div><br></div><div><br></div><div>The first step is figuring out if this error is real or a side-effect of a bad address map.<br></div><div><br></div><div>You probably should lower the minimum stack size for this architecture as well</div><div>as the size of the starting stack. You don't have that much memory.</div><div><br></div><div> </div><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>#4  0x2041e484 in _Workspace_Handler_<wbr>initialization (areas=0x80002f78, area_count=1, extend=0x0) at /home/reprofy/Projects/riscv/<wbr>rtems/development/rtems/<wbr>kernel/rtems-riscv/c/src/../..<wbr>/cpukit/score/src/wkspace.c:<wbr>123</div><div>#5  0x2040031c in bsp_work_area_initialize_<wbr>default (area_begin=0x80001d58, area_size=8872) at ../../../../../.././hifive1/<wbr>lib/include/bsp/bootcard.h:147</div><div>#6  0x20400372 in bsp_work_area_initialize () at /home/reprofy/Projects/riscv/<wbr>rtems/development/rtems/<wbr>kernel/rtems-riscv/c/src/lib/<wbr>libbsp/riscv32/hifive1/../../<wbr>shared/bspgetworkarea.c:61</div><div>#7  0x2040f3ce in rtems_initialize_executive () at /home/reprofy/Projects/riscv/<wbr>rtems/development/rtems/<wbr>kernel/rtems-riscv/c/src/../..<wbr>/cpukit/sapi/src/exinit.c:95</div><div>#8  0x204002cc in boot_card (cmdline=0x0) at /home/reprofy/Projects/riscv/<wbr>rtems/development/rtems/<wbr>kernel/rtems-riscv/c/src/lib/<wbr>libbsp/riscv32/hifive1/../../<wbr>shared/bootcard.c:76</div><div>#9  0x20400064 in _end_clear_bss () at /home/reprofy/Projects/riscv/<wbr>rtems/development/rtems/<wbr>kernel/rtems-riscv/c/src/lib/<wbr>libbsp/riscv32/hifive1/start/<wbr>start.S:116</div><div><br></div><div>So, I think I should increase a workspace.</div><div>Now, I have some questions:</div><div>I took Hesham's linker file for riscv-generic, and there were no stack space, </div><div>I allocated 0x1000 for stack. Should I make it zero again, or should I decrease its size?</div><div>what size for stack should be enough?</div><div>And why there were no space for stack? is it possible to work without stack allocated in</div><div>linkcmd file?</div><div>Can RTEMS work with a smaller workspace?</div><span class="gmail-HOEnZb"><font color="#888888"><div><br></div>-- <br><div class="gmail-m_-3380279113186824230gmail_signature">Regards, Denis Obrezkov</div>
</font></span></div></div>
<br>______________________________<wbr>_________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/<wbr>mailman/listinfo/devel</a><br></blockquote></div><br></div></div>