<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
On 05/15/2012 10:09 AM, Ivica Eftimovski wrote:
<blockquote
cite="mid:5F1B874BF5D24643AF84FBF14CEC7BAB2B502622F6@ENTMAIL02.tad.teledyne.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<meta name="Generator" content="Microsoft Word 12 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif][if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D">Well it was
self-inflicted wound. I found that my Data Direction
Register setting was incorrect (MCF5235_EPORT_EPDDR). It was
supposed to be NOT(), and it is supposed to be 8bits, not 16
bits as the User Manual has it. RTEMS has it correctly set
to 8bits. <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
</div>
</blockquote>
If you have any macros, etc which aid in programming the<br>
DDR, please feel free to submit them. We welcome anything<br>
that makes the next person's experience a little better. :)<br>
<blockquote
cite="mid:5F1B874BF5D24643AF84FBF14CEC7BAB2B502622F6@ENTMAIL02.tad.teledyne.com"
type="cite">
<div class="WordSection1">
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">Thank
you all for the time and help.</span></p>
</div>
</blockquote>
Thank you for following up on the list to report what the issue<br>
turned out to be. Google remembers all and when people see<br>
"problem" in a subject, it is nice from a project perspective to<br>
see the resolution. Whether it is RTEMS' problem or a user<br>
issue. <br>
<br>
--joel<br>
<blockquote
cite="mid:5F1B874BF5D24643AF84FBF14CEC7BAB2B502622F6@ENTMAIL02.tad.teledyne.com"
type="cite">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Ivica<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF
1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">
<a class="moz-txt-link-abbreviated" href="mailto:rtems-users-bounces@rtems.org">rtems-users-bounces@rtems.org</a>
[<a class="moz-txt-link-freetext" href="mailto:rtems-users-bounces@rtems.org">mailto:rtems-users-bounces@rtems.org</a>] <b>On Behalf Of
</b>Ivica Eftimovski<br>
<b>Sent:</b> Friday, May 11, 2012 11:56 AM<br>
<b>To:</b> <a class="moz-txt-link-abbreviated" href="mailto:rtems-users@rtems.org">rtems-users@rtems.org</a><br>
<b>Subject:</b> Coldfire (MCF5235) Interrupt Problem<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif"">Hi all,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif"">I am just starting with RTEMS
and I am trying to interface the MCF5235 BCC board to our
existing hardware. I am trying to set it to use *IRQ4, which
should have fixed level/priority.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif"">When I execute the code noted
below, the interrupts are disabled properly, the vector
seems set and interrupts are re-enabled. But anytime I
ground*IRQ4 (default high) line while my example program is
running, I do not vector to the ISR. <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif"">I fashioned my code using the
clock/network/console code as guide, and those work great. <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif"">Can anyone please give me a
hint of what am I doing wrong?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif"">-------------------------------------
CODE -------------------------------------<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif"">#define TPU_INT_VECTOR (64+4)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif"">#define TPU_IRQ_LEVEL 4<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif"">#define TPU_IRQ_PRIORITY 4<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif"">void InitTPUInterrupt(void);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif"">static rtems_isr
TPUInterruptHandler(rtems_vector_number vector);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif"">#define
TPUInterruptSetPriority() \<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif""> do
{ \<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif""> MCF5235_INTC0_ICR4
= \<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif"">
MCF5235_INTC_ICR_IL(TPU_IRQ_LEVEL) | \<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif"">
MCF5235_INTC_ICR_IP(TPU_IRQ_PRIORITY); \<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif""> } while(0)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif"">#define
TPUInterruptSetHandler(_level,_vector,_old_handler) \<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif""> do
{ \<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif"">
rtems_interrupt_disable(_level); \<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif""> MCF5235_INTC0_IMRL
&= ~(MCF5235_INTC0_IMRL_INT4 | \<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif"">
MCF5235_INTC0_IMRL_MASKALL); \<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif""> handle_status =
rtems_interrupt_catch(TPUInterruptHandler, \<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif"">
TPU_INT_VECTOR, &old_handler); \<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif"">
rtems_interrupt_enable(level); \<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif""> } while(0)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif"">void InitTPUInterrupt(void) {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif""> rtems_interrupt_level
level;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif""> rtems_isr_entry
old_handler;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif""> uint16 status;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif""> TPUInterruptSetPriority();<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif"">
TPUInterruptSetHandler(level, TPU_INT_VECTOR, old_handler);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif""> asm ("move.w %%sr ,%0;" :
"=r"(status));<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif"">}<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif"">static rtems_isr<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif"">TPUInterruptHandler(rtems_vector_number
vector)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif"">{<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif""> uint volatile chan =
vector - TPU_INT_VECTOR;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif""> printf("\nGot interrupt
number: %i", chan);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif"">
rtems_interrupt_clear(MCF5235_INTC0_ICR4);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif"">}<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif"">rtems_task Init(<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif""> rtems_task_argument ignored<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif"">)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif"">{<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif""> ....<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif""> InitTPUInterrupt();<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif""> ...<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif"">}<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif"">-------------------------------------
CODE -------------------------------------<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New","serif""><o:p> </o:p></span></p>
</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>