<div dir="ltr">Thanks for the info, Gedare.<div><br></div><div>Just an FYI now. I found out how to properly increment memory in psim. You need to do it right on psim or psim-gdb script, on directive: <i><span style="font-family:arial,sans-serif;font-size:13px">/openprom/options/oea-memory-</span><span style="font-family:arial,sans-serif;font-size:13px">size </span></i></div>
<div><font face="arial, sans-serif">That's where one should do it.</font></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">Thanks for the support.</font></div><div style><font face="arial, sans-serif">Cassio</font></div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, May 6, 2013 at 10:18 PM, Gedare Bloom <span dir="ltr"><<a href="mailto:gedare@rtems.org" target="_blank">gedare@rtems.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p>Ah, sounds like an issue with the mmu. You may need to investigate how the memory map is implemented in psim. It might use a variable defined in the linker script.</p>
<p>RTEMS can estimate the memory usage with spsize test case... usually the workspace allocation size is well known, and the rest of unused ram goes to heap. But this depends on the linkcmds of the bsp.</p><div class="HOEnZb">
<div class="h5">
<div class="gmail_quote">On May 6, 2013 8:55 PM, "Binkowski, Cassio" <<a href="mailto:cassioiks@gmail.com" target="_blank">cassioiks@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">So there is now way to know how much memory RTEMS is actually using?<div><br></div><div>Also, I have modified <a href="http://psim.in" target="_blank">psim.in</a> to be with 32mb of RAM: <span style="font-family:arial,sans-serif;font-size:13px">/openprom/options/oea-memory-</span><span style="font-family:arial,sans-serif;font-size:13px">size 33554432</span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">However, when I try to create a partition with starting address 0x1000000 (10 MB) it says the address is not mapped. How can that be?</span></div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, May 5, 2013 at 11:39 PM, Joel Sherrill <span dir="ltr"><<a href="mailto:Joel.Sherrill@oarcorp.com" target="_blank">Joel.Sherrill@oarcorp.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<pre style="font-size:10.0pt;font-family:Tahoma;word-wrap:break-word">The linker script format is defined by binutils. RTEMS bsps need enough symbols to define the work area and starting stack.
Since the linker script has 16mb in it, that is all the RTEMS application can know about. Anything beyond that 16mb is free for you to use as you like.
Gedare Bloom <<a href="mailto:gedare@rtems.org" target="_blank">gedare@rtems.org</a>> wrote:
</pre><div><div>
<div>
<p>You can look for some tutorials on ld scripts. This is an area of rtems that lacks good documentation.</p>
<p>The only way to know what memory you can use outside of rtems is to inspect the linkcmds. In your case though you might be able to just point at the 16 MB base address, since psim bsp does not expect to use that much ram...</p>
<div class="gmail_quote">On May 5, 2013 9:01 PM, "Binkowski, Cassio" <<a href="mailto:cassioiks@gmail.com" target="_blank">cassioiks@gmail.com</a>> wrote:<br type="attribution">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Hi Gedare,
<div><br>
</div>
<div>Can you please explain where/how in <span style="font-family:arial,sans-serif;font-size:13px">linkcmds I should be touching and how to let the </span><font face="arial, sans-serif">bps know about the change?</font></div>
<div><font face="arial, sans-serif">I'm very new to this.</font></div>
<div><font face="arial, sans-serif"><br>
</font></div>
<div><font face="arial, sans-serif">Also, how do I calculate how much space RTEMS is taking so I know the address to start creating the partitions?</font></div>
<div><font face="arial, sans-serif"><br>
</font></div>
<div><font face="arial, sans-serif">Thanks!</font></div>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Sun, May 5, 2013 at 9:40 PM, Gedare Bloom <span dir="ltr">
<<a href="mailto:gedare@gwmail.gwu.edu" target="_blank">gedare@gwmail.gwu.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<p>You probably need to modify the bsp linkcmds file, or just malloc a large chunk. The bsp may need to know about the extra memory in either case, so check out the linkcmds.<span><font color="#888888"><br>
-Gedare</font></span></p>
<div>
<div>
<div class="gmail_quote">On May 5, 2013 2:46 PM, "Binkowski, Cassio" <<a href="mailto:cassioiks@gmail.com" target="_blank">cassioiks@gmail.com</a>> wrote:<br type="attribution">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Thanks Joel.
<div><br>
</div>
<div>I have modified it to be with 32 MB of RAM.</div>
<div><br>
</div>
<div>/openprom/options/oea-memory-size 33554432<br>
</div>
<div><br>
</div>
<div>Right now my doubt is the following:</div>
<div><br>
</div>
<div>From <a href="http://psim.in" target="_blank">psim.in</a> or other resources, how can I know at which address I can start creating the partitions and make sure it won't give me an 'unmapped address' error again?</div>
<div><br>
</div>
<div>Thanks.</div>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Thu, May 2, 2013 at 12:06 PM, Joel Sherrill <span dir="ltr">
<<a href="mailto:joel.sherrill@oarcorp.com" target="_blank">joel.sherrill@oarcorp.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<div>I don't know where this all ended yesterday.
<div><br>
<br>
On 5/1/2013 9:00 PM, Binkowski, Cassio wrote:<br>
</div>
</div>
<div>
<blockquote type="cite">
<div dir="ltr">I know I'm missing out on something. It's probably because of the memory addresses and maybe a custom config is required on that file mentioned by Joel (<a href="http://git.rtems.org/rtems/tree/c/src/lib/libbsp/powerpc/psim/startup/linkcmds" style="font-family:Tahoma;font-size:10pt;white-space:pre-wrap" target="_blank">http://git.rtems.org/rtems/tree/c/src/lib/libbsp/powerpc/psim/startup/linkcmds</a>).
I have never dealt with this before and will need some assistance.<br>
</div>
<div class="gmail_extra"><br>
</div>
</blockquote>
</div>
You could modify the device tree created by psim/psim-gdb to add <br>
more RAM or a second bank of RAM after the first 16 MB that the <br>
linkcmds knows about. This is in <a href="http://psim.in" target="_blank">psim.in</a>:<br>
<br>
/openprom/options/oea-memory-size 16777216<br>
<br>
The bottom line is that you are reading the mpc5200 PowerPC manual for<br>
addresses and that does not have any correlation to the memory map of<br>
the "psim board" as defined by the device-tree. <br>
<br>
0x10000 is 64k which is in use by the program or RTEMS.<br>
0x100000 is 1MB and is also in use by the program or RTEMS.<br>
0x1000000 is outside the memory map.<span><font color="#888888"><br>
<br>
--joel</font></span>
<div>
<div><br>
<blockquote type="cite">
<div class="gmail_extra"><br>
<div class="gmail_quote">On Wed, May 1, 2013 at 10:35 PM, Binkowski, Cassio <span dir="ltr">
<<a href="mailto:cassioiks@gmail.com" target="_blank">cassioiks@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">That may be one solution.
<div><br>
</div>
<div>@Joel: Thank you so much for the detailed explanation.</div>
<div>One thing that would be great is that if we could somehow condense all this information exchanged in the mailing list into the Wiki/Manuals/Doxygen.</div>
<div><br>
</div>
<div>For example, I am now getting another exception, I'm just pasting some of it, because it's huge:</div>
<div><br>
</div>
<div>
<div><i>Suspending faulting task (0x0A010003)</i></div>
<div><i>Exception handler called for exception 7 (0x7)</i></div>
</div>
<div>
<div><i>Too many stack frames (stack possibly corrupted), giving up...</i></div>
<div><i>Suspending faulting task (0x0A010004)</i></div>
<div><i><br>
</i></div>
<div>It's given at the creation of the 7th partition when function <b>_API_extensions_Run_postswitch()</b> is executed.</div>
<div><br>
</div>
<div>How can I start searching for it? I don't know what to look for inside inter.h.</div>
<div><br>
</div>
<div>Best regards</div>
<span><font color="#888888">
<div>Cassio</div>
</font></span></div>
<div><br>
</div>
</div>
<div>
<div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Wed, May 1, 2013 at 10:18 PM, Gedare Bloom <span dir="ltr">
<<a href="mailto:gedare@gwmail.gwu.edu" target="_blank">gedare@gwmail.gwu.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<p>You tell the partitions where to start, so just give the second partition the right address. You have to be sure the memory you use is available both in the hw as real memory and also not used for other purposes. Probably you can malloc all the memory you
need at startup time and pass pointers into the allocated buffer to partition create.<br>
-Gedare</p>
<div class="gmail_quote">
<div>
<div>On May 1, 2013 7:07 PM, "Binkowski, Cassio" <<a href="mailto:cassioiks@gmail.com" target="_blank">cassioiks@gmail.com</a>> wrote:<br type="attribution">
</div>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div>
<div dir="ltr">Hmmm. The 'Testing Task' does not have a while(1) loop and I'm not deleting it. Could that be it?
<b><- Yup, that's it. Just tested. Can you please explain how did you arrive at this conclusion?</b>
<div><br>
</div>
<div>I'm referring to the MPC5200B board. You can see the manual in the following link: <a href="http://www.freescale.com/files/32bit/doc/ref_manual/MPC5200BUM.pdf" target="_blank">http://www.freescale.com/files/32bit/doc/ref_manual/MPC5200BUM.pdf</a></div>
<div><br>
</div>
<div>Now, mentioning the partitions and memory addresses. I'm not quite sure if I'm incrementing addresses correctly. I do want to create a partition right next where the other one finishes.</div>
<div>So, if starting address is 0x10000, the next partition will start at 0x10000 + previousPartitionSize.</div>
<div>Does this make sense?</div>
<div><br>
</div>
<div>Thanks.</div>
<div><br>
</div>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Wed, May 1, 2013 at 7:49 PM, Joel Sherrill <span dir="ltr">
<<a href="mailto:Joel.Sherrill@oarcorp.com" target="_blank">Joel.Sherrill@oarcorp.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<pre style="font-size:10.0pt;font-family:Tahoma;word-wrap:break-word">It could be another task exiting. You mentioned loading code.
Psim is a specific simulated hardware environment and does not as configured match any board. If you got addresses from a piece of real hardware, the addresses will not match. What target board's manual are you reading?
"Binkowski, Cassio" <<a href="mailto:cassioiks@gmail.com" target="_blank">cassioiks@gmail.com</a>> wrote:
</pre>
<div>
<div>
<div>
<div dir="ltr">Ok.
<div><br>
</div>
<div>1) The Init task is already deleting itself after loading the other tasks. Do I have to do something else?</div>
<div><br>
</div>
<div>2) The memory for partitions came from the board data sheet. I based myself on the addresses mentioned there and followed upon. I was creating the first one starting at 0x10000 and incrementing from that according to each partition's size.</div>
<div><br>
</div>
<div>Can you help me set these 2 things up? I'm not really sure how to deal with that memory issue and the internal error as well.</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Wed, May 1, 2013 at 6:18 PM, Joel Sherrill <span dir="ltr">
<<a href="mailto:Joel.Sherrill@oarcorp.com" target="_blank">Joel.Sherrill@oarcorp.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<pre style="font-size:10.0pt;font-family:Tahoma;word-wrap:break-word">That address is invalid for psim. Where does the partition memory come from? Here I'd the memory keep for psim
<a href="http://git.rtems.org/rtems/tree/c/src/lib/libbsp/powerpc/psim/startup/linkcmds" target="_blank">http://git.rtems.org/rtems/tree/c/src/lib/libbsp/powerpc/psim/startup/linkcmds</a>
"Binkowski, Cassio" <<a href="mailto:cassioiks@gmail.com" target="_blank">cassioiks@gmail.com</a>> wrote:
</pre>
<div>
<div>
<div dir="ltr">I'm also getting the following error when I uncomment the function that creates 10 partitions to be used by my application:
<div><br>
</div>
<div><i>core_find_mapping() - access to unmaped address, attach a default map to handle this - addr=0x1000d2c nr_bytes=0x4 processor=0xa8e5000 cia=0x1028c</i><br>
</div>
<div><i><br>
</i></div>
<div>Can you please help?</div>
</div>
</div>
<div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Wed, May 1, 2013 at 5:44 PM, Binkowski, Cassio <span dir="ltr">
<<a href="mailto:cassioiks@gmail.com" target="_blank">cassioiks@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">The file 'events.c' is inside /gdb-7.5.1/sim/ppc.
<div><br>
</div>
<div>I am using psim-gdb testing my own application, it's not an RTEMS example.</div>
<div><br>
</div>
<div>I managed to break right on it, and it stops at:</div>
<div>../../../../../../rtems/c/src/../../cpukit/score/src/interr.c:58<br>
</div>
<div><br>
</div>
<div>Signature is the following:</div>
<div>
<div>the_source=the_source@entry=INTERNAL_ERROR_CORE, is_internal=is_internal@entry=true, </div>
<div> the_error=the_error@entry=5)</div>
<div><br>
</div>
<div>I have no clue of what it can be. Do you have any idea?</div>
</div>
</div>
<div>
<div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Wed, May 1, 2013 at 5:37 PM, Joel Sherrill <span dir="ltr">
<<a href="mailto:Joel.Sherrill@oarcorp.com" target="_blank">Joel.Sherrill@oarcorp.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<pre style="font-size:10.0pt;font-family:Tahoma;word-wrap:break-word">Where is the file events.c?
Break at the fault handler printing that.
Does this happen with any rtems provided examples?
Are you using the psim or psim-gdb script to run it?
"Binkowski, Cassio" <<a href="mailto:cassioiks@gmail.com" target="_blank">cassioiks@gmail.com</a>> wrote:
</pre>
<div>
<div>
<div>
<div dir="ltr">Hi everyone,
<div><br>
</div>
<div>I was just testing my application using PSIM and it is returning the following lines, right after starting a Task:</div>
<div><br>
</div>
<div>
<div><i>rtems-4.10.99.0(PowerPC/Generic (classic FPU)/psim) PANIC ERROR 5</i></div>
<div><i>events.c:404: assertion failed - events->time_from_event > 0</i></div>
</div>
<div><br>
</div>
<div>Has anybody experienced this before?</div>
<div><br>
</div>
<div>Thanks.</div>
<div>Cassio</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
<br>
</div>
</div>
_______________________________________________<br>
rtems-users mailing list<br>
<a href="mailto:rtems-users@rtems.org" target="_blank">rtems-users@rtems.org</a><br>
<a href="http://www.rtems.org/mailman/listinfo/rtems-users" target="_blank">http://www.rtems.org/mailman/listinfo/rtems-users</a><br>
<br>
</blockquote>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
<br>
</div>
</div>
<div>
<pre cols="72">--
Joel Sherrill, Ph.D. Director of Research & Development
<a href="mailto:joel.sherrill@OARcorp.com" target="_blank">joel.sherrill@OARcorp.com</a> On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available <a href="tel:%28256%29%20722-9985" value="+12567229985" target="_blank">(256) 722-9985</a> </pre>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</blockquote>
</div>
</div>
</div></div></div>
</blockquote></div><br></div>
</blockquote></div>
</div></div></blockquote></div><br></div>