<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/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/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>nrf51822 hanging sometimes in high current almost 250uA</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/47006/nrf51822-hanging-sometimes-in-high-current-almost-250ua</link><description>nrf51822 production is sometimes hanging (no response) in high current state (almost 250 uA -&amp;gt; normally 20uA). 
 before this issue, there is similar issue about twi that waiting twi event sometimes hanged (not exactly same code, twi-&amp;gt;ready ). 
 So I added</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 08 May 2019 11:31:31 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/47006/nrf51822-hanging-sometimes-in-high-current-almost-250ua" /><item><title>RE: nrf51822 hanging sometimes in high current almost 250uA</title><link>https://devzone.nordicsemi.com/thread/185936?ContentTypeID=1</link><pubDate>Wed, 08 May 2019 11:31:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:abe3ce26-1858-4557-aea5-fe29ab23a01e</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>[quote user="_maibi"]RAM (rwx) : ORIGIN = 0x20001fe8, LENGTH = 0x2000[/quote]
&lt;p&gt;&amp;nbsp;LENGTH should be 0x2018 (you have 0x4000 bytes of total RAM).&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;[quote user="_maibi"][/quote]&lt;/p&gt;
&lt;p&gt;&lt;span&gt;ram size + stack + heap size =&amp;nbsp;0x16D0 +&amp;nbsp;0x600 + 0 = 0x1CD0 &amp;lt; 0x2000&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Can you find any problem?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If you have a stack overflow, you should be able to read out the SP when debugging.&lt;/p&gt;
&lt;p&gt;If using gdb, you can send the &amp;quot;mon regs&amp;quot; command to read all the CPU registers.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Have you checked the call stack trace when the issue occurs?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51822 hanging sometimes in high current almost 250uA</title><link>https://devzone.nordicsemi.com/thread/185819?ContentTypeID=1</link><pubDate>Wed, 08 May 2019 05:25:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:28de5a8d-c6a6-436a-b7fc-1df667e745f6</guid><dc:creator>_maibi</dc:creator><description>&lt;p&gt;So. I change my config heap size -&amp;gt; 0, stack size-&amp;gt;&amp;nbsp;0x600, but this issue still occur.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;*.map file&lt;/p&gt;
&lt;p&gt;...&lt;br /&gt;.heap 0x200036b8 0x0&lt;br /&gt; 0x200036b8 __HeapBase = .&lt;br /&gt; 0x200036b8 __end__ = .&lt;br /&gt; 0x200036b8 PROVIDE (end, .)&lt;br /&gt; *(.heap*)&lt;br /&gt; .heap 0x200036b8 0x0 _build/nrf51422_xxac_gcc_startup_nrf51.S.o&lt;br /&gt; 0x200036b8 __HeapLimit = .&lt;/p&gt;
&lt;p&gt;.stack_dummy 0x200036b8 0x600&lt;br /&gt; *(.stack*)&lt;br /&gt; .stack 0x200036b8 0x600 _build/nrf51422_xxac_gcc_startup_nrf51.S.o&lt;br /&gt; 0x20003fe8 __StackTop = (ORIGIN (RAM) + 0x2000)&lt;br /&gt; 0x200039e8 __StackLimit = (__StackTop - SIZEOF (.stack_dummy))&lt;br /&gt; 0x20003fe8 PROVIDE (__stack, __StackTop)&lt;br /&gt; 0x00000001 ASSERT ((__StackLimit &amp;gt;= __HeapLimit), region RAM overflowed with stack)&lt;br /&gt;OUTPUT(_build/nrf51422_xxac.out elf32-littlearm)&lt;/p&gt;
&lt;p&gt;my application using ram size is &lt;span&gt;0x200036b8 - 0x20001fe8=&amp;nbsp;0x16D0&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;my *.ld file&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;MEMORY&lt;br /&gt;{&lt;br /&gt; FLASH (rx) : ORIGIN = 0x1b000, LENGTH = 0x25000&lt;br /&gt; RAM (rwx) : ORIGIN = 0x20001fe8, LENGTH = 0x2000&lt;br /&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;ram size + stack + heap size =&amp;nbsp;0x16D0 +&amp;nbsp;0x600 + 0 = 0x1CD0 &amp;lt; 0x2000&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Can you find any problem?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51822 hanging sometimes in high current almost 250uA</title><link>https://devzone.nordicsemi.com/thread/185812?ContentTypeID=1</link><pubDate>Wed, 08 May 2019 02:14:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:852379f2-1ac6-409d-bf70-7791183edc2d</guid><dc:creator>_maibi</dc:creator><description>&lt;p&gt;Q1. the production has two peripherals 1 spi,1 twi. and 1 input pin, 2 output pins. Are you talking about the pull resistor on swd_pin? or common input pin?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Q2. I try to check debug print with j-link, but It doesn&amp;#39;t print anything.&lt;/p&gt;
&lt;p&gt;Q3. supply dc voltage only&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I assume stack overflow. Can you check this .map file and config&amp;nbsp;&lt;/p&gt;
&lt;p&gt;keil i used&lt;/p&gt;
&lt;p&gt;Total RO Size (Code + RO Data) 80340 ( 78.46kB)&lt;br /&gt; Total RW Size (RW Data + ZI Data) 7616 ( 7.44kB)&lt;br /&gt; Total ROM Size (Code + RO Data + RW Data) 80416 ( 78.53kB)&lt;/p&gt;
&lt;p&gt;arm_startup.s file&lt;/p&gt;
&lt;p&gt;Stack_Size 2048&lt;/p&gt;
&lt;p&gt;Heap_Size 2048&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Stack + Heap + Rw Size =&amp;nbsp; 11,712&amp;nbsp;&lt;/p&gt;
&lt;p&gt;My device has 16KB RAM, softdevice use 8KB RAM.&lt;/p&gt;
&lt;p&gt;I think Ram should be need over almost 19KB. Is it right?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51822 hanging sometimes in high current almost 250uA</title><link>https://devzone.nordicsemi.com/thread/185656?ContentTypeID=1</link><pubDate>Tue, 07 May 2019 09:07:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a6bbac24-4428-48a8-87ec-ae5ea7e58ea0</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;[quote user=""][/quote]&lt;/p&gt;
&lt;p&gt;nrf51822 production is sometimes hanging (no response) in high current state (almost 250 uA -&amp;gt; normally 20uA).&lt;/p&gt;
&lt;p&gt;before this issue, there is similar issue about twi that waiting twi event sometimes hanged (not exactly same code, twi-&amp;gt;ready ).&lt;/p&gt;
&lt;p&gt;So I added watch dog timer ,&amp;nbsp;It resets after a watchdog period of time.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I thinks it is different issue.&lt;/p&gt;
&lt;p&gt;As I searched, I suspected that It was in debug mode in high current. so I attach pull down resistor to swd_clk pin.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Debug mode shall draw more than 250 uA, so it is likely something else.&lt;/p&gt;
&lt;p&gt;Q1: How are your pins configured? If a pin has a pull resistor, and there is something external keeping the pin active, it can draw around 200 uA (VDD_NRF / 13k = ~230uA at 3.0V) depending on your supply voltage.&lt;/p&gt;
&lt;p&gt;If there are several pins configured as input, which are floating, the same issue can occur.&lt;/p&gt;
&lt;p&gt;Q2: Is there nothing on the device that works as it should when this occurs? Have you tried to reproduce this in debug mode?&lt;/p&gt;
&lt;p&gt;Q3: Have you tried to look at the current consumption using a analyzer to see if the current draw is static or dynamic (ie: a timer that wakes up every x ms)?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>