<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2017-07-28 13:11 GMT+02:00 Gedare Bloom <span dir="ltr"><<a href="mailto:gedare@rtems.org" target="_blank">gedare@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 class="gmail-HOEnZb"><div class="gmail-h5">On Thu, Jul 27, 2017 at 7:43 PM, Denis Obrezkov <<a href="mailto:denisobrezkov@gmail.com">denisobrezkov@gmail.com</a>> wrote:<br>
> I didn't want to enable optimization because I was afraid of new mistakes.<br>
> So, I enabled -Os and now I have:<br>
> _Terminate (the_source=the_source@entry=<wbr>INTERNAL_ERROR_CORE,<br>
> the_error=the_error@entry=3)<br>
>     at<br>
> /home/reprofy/Projects/riscv/<wbr>rtems/development/rtems/<wbr>kernel/rtems-riscv/c/src/../..<wbr>/cpukit/score/src/interr.c:44<br>
> 44        _CPU_Fatal_halt( the_source, the_error );<br>
> (gdb) i s<br>
> #0  _Terminate (the_source=the_source@entry=<wbr>INTERNAL_ERROR_CORE,<br>
> the_error=the_error@entry=3)<br>
>     at<br>
> /home/reprofy/Projects/riscv/<wbr>rtems/development/rtems/<wbr>kernel/rtems-riscv/c/src/../..<wbr>/cpukit/score/src/interr.c:44<br>
> #1  0x20401672 in _Internal_error<br>
> (core_error=core_error@entry=<wbr>INTERNAL_ERROR_WORKSPACE_<wbr>ALLOCATION)<br>
>     at<br>
> /home/reprofy/Projects/riscv/<wbr>rtems/development/rtems/<wbr>kernel/rtems-riscv/c/src/../..<wbr>/cpukit/score/src/interr.c:51<br>
> #2  0x20404968 in _Workspace_Allocate_or_fatal_<wbr>error (size=<optimized out>)<br>
> at ../../cpukit/../../../hifive1/<wbr>lib/include/rtems/score/<wbr>heapimpl.h:137<br>
> #3  0x20401f76 in _Objects_Extend_information (information=0x80000ad4<br>
> <_RTEMS_tasks_Information>)<br>
>     at<br>
> /home/reprofy/Projects/riscv/<wbr>rtems/development/rtems/<wbr>kernel/rtems-riscv/c/src/../..<wbr>/cpukit/score/src/<wbr>objectextendinformation.c:70<br>
> #4  0x20402110 in _Objects_Do_initialize_<wbr>information<br>
> (information=information@entry<wbr>=0x80000ad4 <_RTEMS_tasks_Information>,<br>
> the_api=the_api@entry=OBJECTS_<wbr>CLASSIC_API,<br>
>     the_class=<optimized out>, maximum=maximum@entry=124, size=<optimized<br>
> out>, is_string=<optimized out>,<br>
> maximum_name_length=maximum_<wbr>name_length@entry=4)<br>
>     at<br>
> /home/reprofy/Projects/riscv/<wbr>rtems/development/rtems/<wbr>kernel/rtems-riscv/c/src/../..<wbr>/cpukit/score/src/<wbr>objectinitializeinformation.c:<wbr>118<br>
> #5  0x20402e3a in _Thread_Initialize_information<br>
> (information=information@entry<wbr>=0x80000ad4 <_RTEMS_tasks_Information>,<br>
> the_api=the_api@entry=OBJECTS_<wbr>CLASSIC_API,<br>
>     the_class=the_class@entry=1, maximum=124,<br>
> is_string=is_string@entry=<wbr>false,<br>
> maximum_name_length=maximum_<wbr>name_length@entry=4)<br>
>     at<br>
> /home/reprofy/Projects/riscv/<wbr>rtems/development/rtems/<wbr>kernel/rtems-riscv/c/src/../..<wbr>/cpukit/score/src/thread.c:57<br>
> #6  0x20400ff8 in _RTEMS_tasks_Manager_<wbr>initialization () at<br>
> /home/reprofy/Projects/riscv/<wbr>rtems/development/rtems/<wbr>kernel/rtems-riscv/c/src/../..<wbr>/cpukit/rtems/src/tasks.c:72<br>
> #7  0x2040112e in rtems_initialize_executive () at<br>
> /home/reprofy/Projects/riscv/<wbr>rtems/development/rtems/<wbr>kernel/rtems-riscv/c/src/../..<wbr>/cpukit/sapi/src/exinit.c:92<br>
> #8  0x20400496 in boot_card (cmdline=<optimized out>) at<br>
> /home/reprofy/Projects/riscv/<wbr>rtems/development/rtems/<wbr>kernel/rtems-riscv/c/src/lib/<wbr>libbsp/riscv32/hifive1/../../<wbr>shared/bootcard.c:78<br>
><br>
> Though, the size of executable is much lower (almost two times),<br>
> but I get this mistake. And as for now I can't understand do I have the<br>
> error<br>
> due to optimization or has the optimization revealed another issue?<br>
><br>
<br>
</div></div>Most likely it has revealed another issue. It appears that the<br>
workspace is out of room and the allocate request fails. This could be<br>
a problem in the application's configuration (CONFIGURE_XXX macros) or<br>
is another side-effect of the memory constraints on your device. How<br>
much workspace is there available in your linker script, can you tell?<br>
Are you using unified heap and workspace?<br>
<span class="gmail-HOEnZb"><font color="#888888"><br>
<br>
> --<br>
> Regards, Denis Obrezkov<br>
><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>
</font></span></blockquote></div><br>In my linker scripts all ram is allocated - 16 K:<div><a href="https://github.com/embeddedden/rtems-riscv/blob/hifive1/c/src/lib/libbsp/riscv32/hifive1/startup/linkcmds">https://github.com/embeddedden/rtems-riscv/blob/hifive1/c/src/lib/libbsp/riscv32/hifive1/startup/linkcmds</a><br></div><div><br></div><div>I use:</div><div>CONFIGURE_UNIFIED_WORK_AREAS<br></div><div><br></div><div><br></div>-- <br><div class="gmail_signature">Regards, Denis Obrezkov</div>
</div></div>