Errors in PSIM

Gedare Bloom gedare at rtems.org
Tue May 7 01:18:16 UTC 2013


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.

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.
On May 6, 2013 8:55 PM, "Binkowski, Cassio" <cassioiks at gmail.com> wrote:

> So there is now way to know how much memory RTEMS is actually using?
>
> Also, I have modified psim.in to be with 32mb of RAM:
> /openprom/options/oea-memory-size 33554432
>
> 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?
>
>
> On Sun, May 5, 2013 at 11:39 PM, Joel Sherrill <Joel.Sherrill at oarcorp.com>wrote:
>
>>  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 <gedare at rtems.org> wrote:
>>
>>
>>  You can look for some tutorials on ld scripts. This is an area of rtems
>> that lacks good documentation.
>>
>> 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...
>> On May 5, 2013 9:01 PM, "Binkowski, Cassio" <cassioiks at gmail.com> wrote:
>>
>>> Hi Gedare,
>>>
>>>  Can you please explain where/how in linkcmds I should be touching and
>>> how to let the bps know about the change?
>>> I'm very new to this.
>>>
>>>  Also, how do I calculate how much space RTEMS is taking so I know the
>>> address to start creating the partitions?
>>>
>>>  Thanks!
>>>
>>>
>>> On Sun, May 5, 2013 at 9:40 PM, Gedare Bloom <gedare at gwmail.gwu.edu>wrote:
>>>
>>>> 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.
>>>> -Gedare
>>>>  On May 5, 2013 2:46 PM, "Binkowski, Cassio" <cassioiks at gmail.com>
>>>> wrote:
>>>>
>>>>> Thanks Joel.
>>>>>
>>>>>  I have modified it to be with 32 MB of RAM.
>>>>>
>>>>>  /openprom/options/oea-memory-size 33554432
>>>>>
>>>>>  Right now my doubt is the following:
>>>>>
>>>>>  From psim.in 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?
>>>>>
>>>>>  Thanks.
>>>>>
>>>>>
>>>>> On Thu, May 2, 2013 at 12:06 PM, Joel Sherrill <
>>>>> joel.sherrill at oarcorp.com> wrote:
>>>>>
>>>>>>  I don't know where this all ended yesterday.
>>>>>>
>>>>>>
>>>>>> On 5/1/2013 9:00 PM, Binkowski, Cassio wrote:
>>>>>>
>>>>>> 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 (
>>>>>> http://git.rtems.org/rtems/tree/c/src/lib/libbsp/powerpc/psim/startup/linkcmds).
>>>>>> I have never dealt with this before and will need some assistance.
>>>>>>
>>>>>>   You could modify the device tree created by psim/psim-gdb to add
>>>>>> more RAM or a second bank of RAM after the first 16 MB that the
>>>>>> linkcmds knows about.  This is in psim.in:
>>>>>>
>>>>>> /openprom/options/oea-memory-size 16777216
>>>>>>
>>>>>> The bottom line is that you are reading the mpc5200 PowerPC manual for
>>>>>> addresses and that does not have any correlation to the memory map of
>>>>>> the "psim board" as defined by the device-tree.
>>>>>>
>>>>>> 0x10000 is 64k which is in use by the program or RTEMS.
>>>>>> 0x100000 is 1MB and is also in use by the program or RTEMS.
>>>>>> 0x1000000 is outside the memory map.
>>>>>>
>>>>>> --joel
>>>>>>
>>>>>>
>>>>>> On Wed, May 1, 2013 at 10:35 PM, Binkowski, Cassio <
>>>>>> cassioiks at gmail.com> wrote:
>>>>>>
>>>>>>> That may be one solution.
>>>>>>>
>>>>>>>  @Joel: Thank you so much for the detailed explanation.
>>>>>>> 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.
>>>>>>>
>>>>>>>  For example, I am now getting another exception, I'm just pasting
>>>>>>> some of it, because it's huge:
>>>>>>>
>>>>>>>  *Suspending faulting task (0x0A010003)*
>>>>>>> *Exception handler called for exception 7 (0x7)*
>>>>>>>  *Too many stack frames (stack possibly corrupted), giving up...*
>>>>>>> *Suspending faulting task (0x0A010004)*
>>>>>>> *
>>>>>>> *
>>>>>>> It's given at the creation of the 7th partition when function *
>>>>>>> _API_extensions_Run_postswitch()* is executed.
>>>>>>>
>>>>>>>  How can I start searching for it? I don't know what to look for
>>>>>>> inside inter.h.
>>>>>>>
>>>>>>>  Best regards
>>>>>>>  Cassio
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Wed, May 1, 2013 at 10:18 PM, Gedare Bloom <gedare at gwmail.gwu.edu
>>>>>>> > wrote:
>>>>>>>
>>>>>>>> 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.
>>>>>>>> -Gedare
>>>>>>>>  On May 1, 2013 7:07 PM, "Binkowski, Cassio" <cassioiks at gmail.com>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>>  Hmmm. The 'Testing Task' does not have a while(1) loop and I'm
>>>>>>>>> not deleting it. Could that be it? *<- Yup, that's it. Just
>>>>>>>>> tested. Can you please explain how did you arrive at this conclusion?
>>>>>>>>> *
>>>>>>>>>
>>>>>>>>>  I'm referring to the MPC5200B board. You can see the manual in
>>>>>>>>> the following link:
>>>>>>>>> http://www.freescale.com/files/32bit/doc/ref_manual/MPC5200BUM.pdf
>>>>>>>>>
>>>>>>>>>  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.
>>>>>>>>> So, if starting address is 0x10000, the next partition will start
>>>>>>>>> at 0x10000 + previousPartitionSize.
>>>>>>>>> Does this make sense?
>>>>>>>>>
>>>>>>>>>  Thanks.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Wed, May 1, 2013 at 7:49 PM, Joel Sherrill <
>>>>>>>>> Joel.Sherrill at oarcorp.com> wrote:
>>>>>>>>>
>>>>>>>>>>  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" <cassioiks at gmail.com> wrote:
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>   Ok.
>>>>>>>>>>
>>>>>>>>>>  1) The Init task is already deleting itself after loading the
>>>>>>>>>> other tasks. Do I have to do something else?
>>>>>>>>>>
>>>>>>>>>>  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.
>>>>>>>>>>
>>>>>>>>>>  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.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Wed, May 1, 2013 at 6:18 PM, Joel Sherrill <
>>>>>>>>>> Joel.Sherrill at oarcorp.com> wrote:
>>>>>>>>>>
>>>>>>>>>>>  That address is invalid for psim. Where does the partition memory come from? Here I'd the memory keep for psim
>>>>>>>>>>> http://git.rtems.org/rtems/tree/c/src/lib/libbsp/powerpc/psim/startup/linkcmds
>>>>>>>>>>>
>>>>>>>>>>> "Binkowski, Cassio" <cassioiks at gmail.com> wrote:
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>  I'm also getting the following error when I uncomment the
>>>>>>>>>>> function that creates 10 partitions to be used by my application:
>>>>>>>>>>>
>>>>>>>>>>>  *core_find_mapping() - access to unmaped address, attach a
>>>>>>>>>>> default map to handle this - addr=0x1000d2c nr_bytes=0x4
>>>>>>>>>>> processor=0xa8e5000 cia=0x1028c*
>>>>>>>>>>>  *
>>>>>>>>>>> *
>>>>>>>>>>> Can you please help?
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On Wed, May 1, 2013 at 5:44 PM, Binkowski, Cassio <
>>>>>>>>>>> cassioiks at gmail.com> wrote:
>>>>>>>>>>>
>>>>>>>>>>>> The file 'events.c' is inside /gdb-7.5.1/sim/ppc.
>>>>>>>>>>>>
>>>>>>>>>>>>  I am using psim-gdb testing my own application, it's not an
>>>>>>>>>>>> RTEMS example.
>>>>>>>>>>>>
>>>>>>>>>>>>  I managed to break right on it, and it stops at:
>>>>>>>>>>>> ../../../../../../rtems/c/src/../../cpukit/score/src/interr.c:58
>>>>>>>>>>>>
>>>>>>>>>>>>  Signature is the following:
>>>>>>>>>>>>  the_source=the_source at entry=INTERNAL_ERROR_CORE,
>>>>>>>>>>>> is_internal=is_internal at entry=true,
>>>>>>>>>>>>     the_error=the_error at entry=5)
>>>>>>>>>>>>
>>>>>>>>>>>>  I have no clue of what it can be. Do you have any idea?
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> On Wed, May 1, 2013 at 5:37 PM, Joel Sherrill <
>>>>>>>>>>>> Joel.Sherrill at oarcorp.com> wrote:
>>>>>>>>>>>>
>>>>>>>>>>>>>  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" <cassioiks at gmail.com> wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>   Hi everyone,
>>>>>>>>>>>>>
>>>>>>>>>>>>>  I was just testing my application using PSIM and it is
>>>>>>>>>>>>> returning the following lines, right after starting a Task:
>>>>>>>>>>>>>
>>>>>>>>>>>>>  *rtems-4.10.99.0(PowerPC/Generic (classic FPU)/psim) PANIC
>>>>>>>>>>>>> ERROR 5*
>>>>>>>>>>>>> *events.c:404: assertion failed - events->time_from_event > 0*
>>>>>>>>>>>>>
>>>>>>>>>>>>>  Has anybody experienced this before?
>>>>>>>>>>>>>
>>>>>>>>>>>>>  Thanks.
>>>>>>>>>>>>> Cassio
>>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>  _______________________________________________
>>>>>>>>> rtems-users mailing list
>>>>>>>>> rtems-users at rtems.org
>>>>>>>>> http://www.rtems.org/mailman/listinfo/rtems-users
>>>>>>>>>
>>>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>   --
>>>>>> Joel Sherrill, Ph.D.             Director of Research & Development joel.sherrill at OARcorp.com        On-Line Applications Research
>>>>>> Ask me about RTEMS: a free RTOS  Huntsville AL 35805
>>>>>> Support Available                (256) 722-9985
>>>>>>
>>>>>>
>>>>>
>>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20130506/fb2b6327/attachment-0001.html>


More information about the users mailing list