<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Spurious SWI call (SWI_Dead lock)</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/24595/spurious-swi-call-swi_dead-lock</link><description> 
Hello, 

 
I am experiencing what seems to be a spurious SWI call. 
The effect is that the application hangs on the SWI Handler 
__asm void SWI_Handler (void): 

 
SWI_Dead BHS SWI_Dead 

 
What can I do to identify the origin of this spurious call</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Spurious SWI call (SWI_Dead lock)</title><link>https://community.arm.com/thread/77773?ContentTypeID=1</link><pubDate>Thu, 24 Sep 2009 12:07:05 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:f2e7c1d2-e5fd-4999-bf1e-a3410157df5b</guid><dc:creator>Andr&amp;#195;&amp;#169; Moutinho</dc:creator><description>&lt;p&gt;&lt;p&gt;
The situation is as follows:&lt;br /&gt;
The software runs communicating through a CAN interface.&lt;br /&gt;
After approximately 5 minutes it hangs up in a SWI_Dead loop.&lt;br /&gt;
Analysing the call stack, the SWI call occurred from inside a
function called from an interrupt routine, in the sequence below
(CAN_Handler is the interrupt routine)&lt;br /&gt;
CAN_Handler() -&amp;gt; CAN_RX2_ISR() -&amp;gt; CAN_hw_rd() -&amp;gt; SWI??&lt;/p&gt;

&lt;p&gt;
The problem is there is no explicit call to SWI from inside
CAN_hw_rd().&lt;/p&gt;

&lt;p&gt;
// detail from CAN_hw_rd() :&lt;/p&gt;

&lt;pre&gt;
0x00032100  E2402001  SUB       R2,R0,#0x00000001
   378:   regCAN *ptrcan = (regCAN *) CAN_BASE[ctrl0];
   379:
0x00032104  E59F4780  LDR       R4,[PC,#0x0780]
0x00032108  E794E102  LDR       R14,[R4,R2,LSL #2]
   381:   CANData = ptrcan-&amp;gt;CANRFS;
0x0003210C  E59E3020  LDR       R3,[R14,#0x0020]
   382:   msg-&amp;gt;format   = (CANData &amp;amp; 0x80000000) == 0x80000000;
0x00032110  E1A04FA3  MOV       R4,R3,LSR #31
0x00032114  E5C1400E  STRB      R4,[R1,#0x000E]
   383:   msg-&amp;gt;type     = (CANData &amp;amp; 0x40000000) == 0x40000000;
0x00032118  E2034101  AND       R4,R3,#0x40000000             &amp;lt;&amp;lt; spurious SWI call
0x0003211C  E1A04F24  MOV       R4,R4,LSR #30
0x00032120  E5C1400F  STRB      R4,[R1,#0x000F]
   384:   msg-&amp;gt;len      = ((U8)(CANData &amp;gt;&amp;gt; 16)) &amp;amp; 0x0F;
   385:
0x00032124  E3A0400F  MOV       R4,#0x0000000F
0x00032128  E0044823  AND       R4,R4,R3,LSR #16
0x0003212C  E5C1400C  STRB      R4,[R1,#0x000C]
   387:   msg-&amp;gt;id = ptrcan-&amp;gt;CANRID;
   388:
0x00032130  E59E4024  LDR       R4,[R14,#0x0024]
0x00032134  E5814000  STR       R4,[R1]
   390:   if (msg-&amp;gt;type == DATA_FRAME)

&lt;/pre&gt;

&lt;p&gt;
Thanks a lot,&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Spurious SWI call (SWI_Dead lock)</title><link>https://community.arm.com/thread/56903?ContentTypeID=1</link><pubDate>Thu, 24 Sep 2009 10:10:03 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:9d0ff778-e4b9-4b20-bc3f-a175306ff90e</guid><dc:creator>Tamir Michael</dc:creator><description>&lt;p&gt;&lt;p&gt;
this is very a general problem report. you must provide details -
R14 value, when and where it happens etc.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>