<?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>Debugging 8051 hang</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/16047/debugging-8051-hang</link><description> This is a tricky problem for me. I&amp;#39;m looking for debug suggestions. 
 
I&amp;#39;m using a Cygnal F320 with the Cygnal IDE/debugger/JTAG, Keil C51 V7.07 
 
I have a system that I&amp;#39;ve been working on for 3 months. This problem has come and gone for the last two</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Debugging 8051 hang</title><link>https://community.arm.com/thread/102830?ContentTypeID=1</link><pubDate>Tue, 16 Sep 2003 12:49:08 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:6bef18fe-22cb-4e2b-84c7-144460134a84</guid><dc:creator>Jim McKain</dc:creator><description>&lt;p&gt;SO I confirmed that the C8051F320 silicon has an IDLE mode bug. Contact Cygnal Applications &amp;lt;Apps@cygnal.com&amp;gt; for the fix. They are coming out with an App note which gets around the issue, pretty simple fix...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debugging 8051 hang</title><link>https://community.arm.com/thread/71833?ContentTypeID=1</link><pubDate>Fri, 12 Sep 2003 11:30:22 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:3ffa8f4b-575b-4662-ae96-ffda53455620</guid><dc:creator>Jim McKain</dc:creator><description>&lt;p&gt;I was calling the long math routines from the INTDR and elsewhere as well.&lt;br /&gt;
&lt;br /&gt;
I removed them from INTDR contexts and it did not fix the problem.&lt;br /&gt;
&lt;br /&gt;
*******&lt;br /&gt;
HOWEVER I think I found the issue.&lt;br /&gt;
&lt;br /&gt;
About two months ago I got cute and entered the IDLE mode when I had no work to do.&lt;br /&gt;
&lt;br /&gt;
If I do not enter IDLE mode my problem goes away. I&amp;#39;m thinking this chip has an issue when more than one interrupt happen while in IDLE. I&amp;#39;ll get the logic anaylser out later to prove this. But for now its fixed and in test.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debugging 8051 hang</title><link>https://community.arm.com/thread/40886?ContentTypeID=1</link><pubDate>Fri, 12 Sep 2003 09:14:20 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:d2abca59-ce2f-4396-956e-6284d5be51bb</guid><dc:creator>John Donaldson</dc:creator><description>&lt;p&gt;&amp;quot;I am using C51S library inside Interrupt routines, are these OK to use in a nonreentrant design, (but within interrupts).&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Am I right in assuming that by this you mean you *only* call these library routines from one interrupt handler and nowhere else?&lt;br /&gt;
&lt;br /&gt;
Stefan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debugging 8051 hang</title><link>https://community.arm.com/thread/95760?ContentTypeID=1</link><pubDate>Fri, 12 Sep 2003 09:06:51 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:33041457-ec38-4088-976c-135418e062af</guid><dc:creator>John Donaldson</dc:creator><description>&lt;p&gt;&amp;quot;I&amp;#39;ve already checked the HW stack usage, it uses about 14-16 bytes, I have OVER 100 LEFT!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
In that case, why not initialise your stack pointer a bit higher to see whether the problem changes or goes away? It might give you some idea whether stack corruption is your problem.&lt;br /&gt;
&lt;br /&gt;
Stefan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debugging 8051 hang</title><link>https://community.arm.com/thread/71830?ContentTypeID=1</link><pubDate>Fri, 12 Sep 2003 08:36:22 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:465c843d-1a07-41d4-a469-a7bc7abcd85a</guid><dc:creator>Jim McKain</dc:creator><description>&lt;p&gt;Thanks for your reply, this paricular process does not have access to the busses via pins, only JTAG (28 pin part).&lt;br /&gt;
&lt;br /&gt;
I&amp;#39;ve already checked the HW stack usage, it uses about 14-16 bytes, I have OVER 100 LEFT!&lt;br /&gt;
&lt;br /&gt;
A Good suggestion about polling, I&amp;#39;ll give that a try.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debugging 8051 hang</title><link>https://community.arm.com/thread/40887?ContentTypeID=1</link><pubDate>Thu, 11 Sep 2003 22:13:40 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:8dd0f1bd-8516-4c35-bc70-053e541bf1d3</guid><dc:creator>Drew Davis</dc:creator><description>&lt;p&gt;Can you put a logic analyzer on the address/data busses and look for activity?  If the code is off in the weeds, you&amp;#39;ll be able to see the addresses for the code fetched.  If you&amp;#39;re in an interrupt handler that&amp;#39;s something.  If you see no code fetches at all, well, that tells you something else :0&lt;br /&gt;
&lt;br /&gt;
It seems odd that you could disconnect a JTAG emulator merely with a software problem.  (Not that I&amp;#39;ve used a JTAG emulator with an 8051 before, but if they work the same way as the ones for other processors, the debug chain is a seperate scan chain, and it ought to be a fairly basic hardware problem that prevents the JTAG chain from clocking data out.)&lt;br /&gt;
&lt;br /&gt;
You could check the amount used of the hardware stack by filling idata with a known pattern, running some code, and then seeing how much stack you&amp;#39;ve used.&lt;br /&gt;
&lt;br /&gt;
How hard would it be to put in a polling loop to service the interrupts and disable the interrupt handlers themselves temporarily?  That might shed some light on problems with priority levels of interrupt or reentrancy.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>