<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 5/1/2013 2:25 PM, Alan Cudmore
wrote:<br>
</div>
<blockquote
cite="mid:CAJrjN73r57=q-7oHHGwO5y6PrzGC1bDhYq3UAbO3jSA5-Bt2MA@mail.gmail.com"
type="cite">
<div dir="ltr">It looks like the CP15 initialization is explicitly
enabling unaligned traps, so that is the likely cause. <br>
</div>
</blockquote>
This came up recently (past week?). The default setting with the<br>
MMU initialization code makes it a fault.<br>
<br>
Unless we compile newlib and other tool libraries to have strict<br>
alignment, unaligned access must be allowed. My gut says <br>
cp15 is setup wrong by default for the way we generate code.<br>
<br>
Gedare has mentored the MMU projects so let's bring him in.<br>
<blockquote
cite="mid:CAJrjN73r57=q-7oHHGwO5y6PrzGC1bDhYq3UAbO3jSA5-Bt2MA@mail.gmail.com"
type="cite">
<div dir="ltr">
<div style="">The BSP has a good polled printk, so I might try
to setup something for the exception vectors as well.</div>
</div>
</blockquote>
I wonder why there isn't a good exception handler. :(<br>
<br>
Is there not one? Or did you just not get that part of the<br>
ARM BSP shared setup?<br>
<br>
<blockquote
cite="mid:CAJrjN73r57=q-7oHHGwO5y6PrzGC1bDhYq3UAbO3jSA5-Bt2MA@mail.gmail.com"
type="cite">
<div dir="ltr">
<div style="">Thanks,</div>
<div style="">Alan</div>
<div style=""><br>
</div>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Wed, May 1, 2013 at 1:11 PM, Claus,
Ric <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:claus@slac.stanford.edu" target="_blank">claus@slac.stanford.edu</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">It's not
clear what your debugging environment is like, but if you
could put some sort of indicator (e.g. a printk, a write to
memory that is persistent across reboots, or turn on an LED)
in each of the exception vectors (except IRQ, since it will
be tickled often by at least clock), then you could tell
whether you've taken an exception. It smells like you're
taking an alignment exception and landing in a for (;;)
loop.<br>
<br>
It'd interesting to know the pros and cons of enabling
unaligned accesses with CP15. Naively, it might seem like a
good idea to always enable these. Presumably it kills
performance to do so, however.<br>
<br>
Ric<br>
<br>
________________________________________<br>
From: <a moz-do-not-send="true"
href="mailto:rtems-users-bounces@rtems.org">rtems-users-bounces@rtems.org</a>
[<a moz-do-not-send="true"
href="mailto:rtems-users-bounces@rtems.org">rtems-users-bounces@rtems.org</a>]
On Behalf Of Alan Cudmore [<a moz-do-not-send="true"
href="mailto:alan.cudmore@gmail.com">alan.cudmore@gmail.com</a>]<br>
Sent: Wednesday, May 01, 2013 8:12 AM<br>
To: Gedare Bloom<br>
Cc: <a moz-do-not-send="true"
href="mailto:rtems-users@rtems.org">rtems-users@rtems.org</a><br>
Subject: Re: Raspberry Pi BSP debugging<br>
<div class="im"><br>
Great idea. It should be easy enough to try, and it looks
like the bit to enable unaligned access is not set in the
BSP.<br>
<br>
Thanks,<br>
Alan<br>
<br>
<br>
<br>
</div>
<div class="im">On Wed, May 1, 2013 at 10:38 AM, Gedare
Bloom <<a moz-do-not-send="true"
href="mailto:gedare@rtems.org">gedare@rtems.org</a><mailto:<a
moz-do-not-send="true" href="mailto:gedare@rtems.org">gedare@rtems.org</a>>>
wrote:<br>
Could it be a matter of the compiler (not) knowing the
correct<br>
alignment for the target architecture?<br>
<br>
To quote Sebastian from a recent post: "Please have a look
in the<br>
ARM1176JZF-S manual. You may have to enable the unaligned
access in<br>
the CP15."<br>
<br>
-Gedare<br>
<br>
</div>
<div>
<div class="h5">On Wed, May 1, 2013 at 10:16 AM, Alan
Cudmore <<a moz-do-not-send="true"
href="mailto:alan.cudmore@gmail.com">alan.cudmore@gmail.com</a><mailto:<a
moz-do-not-send="true"
href="mailto:alan.cudmore@gmail.com">alan.cudmore@gmail.com</a>>>
wrote:<br>
> I'm trying to track down a bug in the Raspberry Pi
BSP. It will be much<br>
> easier once I get a JTAG device, but for now I have
been able to narrow down<br>
> one specific instance where the BSP hangs.<br>
><br>
> The first symptom of this problem was with a shell
example. If I type an<br>
> invalid shell command, I noticed it will hang or
crash on the strncat<br>
> function.<br>
><br>
> Next, I modified the simple hello world sample and
found that it will also<br>
> hang with a strncat call. I copied the strncat
function from the newlib<br>
> sources and found that the local copies ( optimized
for size and speed )<br>
> work. The attached example shows the two local
strncat calls followed by the<br>
> newlib call. It will always hang on the newlib
call.<br>
><br>
> This example works on the arm920/gdb simulator and
the sparc-sis simulator.<br>
><br>
> Some other notes;<br>
> - The memory map looks reasonable, comparing it to
the arm920 map<br>
> - Many other newlib functions work such as strncpy,
printf, etc<br>
> - Much of the other basic RTEMS seem to work as
well. I can create a RAM<br>
> disk, format it , mount it, copy files, etc. I ran
many of the tests such as<br>
> unlimited, ticker, etc.<br>
><br>
> If anyone has an idea I can try let me know.
Otherwise I might just wait<br>
> until I can get a JTAG device hooked up.<br>
><br>
> Thanks,<br>
> Alan<br>
><br>
><br>
><br>
><br>
><br>
><br>
> _______________________________________________<br>
> rtems-users mailing list<br>
</div>
</div>
> <a moz-do-not-send="true"
href="mailto:rtems-users@rtems.org">rtems-users@rtems.org</a><mailto:<a
moz-do-not-send="true" href="mailto:rtems-users@rtems.org">rtems-users@rtems.org</a>><br>
> <a moz-do-not-send="true"
href="http://www.rtems.org/mailman/listinfo/rtems-users"
target="_blank">http://www.rtems.org/mailman/listinfo/rtems-users</a><br>
><br>
<br>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Joel Sherrill, Ph.D. Director of Research & Development
<a class="moz-txt-link-abbreviated" href="mailto:joel.sherrill@OARcorp.com">joel.sherrill@OARcorp.com</a> On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985 </pre>
</body>
</html>