<?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>RESETREAS works differently on NRF52840-DK vs custom board with same code</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/70279/resetreas-works-differently-on-nrf52840-dk-vs-custom-board-with-same-code</link><description>Starting with the dev kit, where I get correct behavior. First, I make sure the RESETREAS register is all zeros. I do this like so: NRF_POWER-&amp;gt;RESETREAS = 0xFFFFFFFF; while (1); I use nrfjprog to check the value in some registers like so: nrfjprog --memrd</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 14 Jan 2021 11:36:36 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/70279/resetreas-works-differently-on-nrf52840-dk-vs-custom-board-with-same-code" /><item><title>RE: RESETREAS works differently on NRF52840-DK vs custom board with same code</title><link>https://devzone.nordicsemi.com/thread/289167?ContentTypeID=1</link><pubDate>Thu, 14 Jan 2021 11:36:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b0bfe2e-28b0-4b1f-a957-3d0259ced497</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;
[quote user="cwmoreiras"]what is the electrical difference in the startup sequence between Power-on-Reset that RESETREAS will be 0 but with other reset events it will be nonzero? [/quote]
&lt;p&gt;If RESETREAS is 0, and you are certain that nothing in your system resets this register, its brown-out&amp;nbsp;/ power-on-reset, as per the documentation:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/power.html?cp=4_0_0_4_2_5_6#unique_186713773"&gt;https://infocenter.nordicsemi.com/topic/ps_nrf52840/power.html?cp=4_0_0_4_2_5_6#unique_186713773&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I would recommend that you try different programmers and check another custom board as well.&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: RESETREAS works differently on NRF52840-DK vs custom board with same code</title><link>https://devzone.nordicsemi.com/thread/289014?ContentTypeID=1</link><pubDate>Wed, 13 Jan 2021 18:20:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5419cdb1-b23e-4bb0-9d7a-555ef74503f9</guid><dc:creator>cwmoreiras</dc:creator><description>&lt;p&gt;The behavior is the same.. The RESETREAS register is always 0. At this point given the issues I had with the black magic probe I believe there is probably something wrong with the board. Please let me know if you have any other ideas or suggestions for how to debug this. If not, you can close the ticket. But please before you do, can you answer me, what is the electrical difference in the startup sequence between Power-on-Reset that RESETREAS will be 0 but with other reset events it will be nonzero? Thank you &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RESETREAS works differently on NRF52840-DK vs custom board with same code</title><link>https://devzone.nordicsemi.com/thread/288813?ContentTypeID=1</link><pubDate>Wed, 13 Jan 2021 07:28:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4f7959db-2a67-4d94-a449-f5f3756a1098</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;I&amp;#39;m glad to hear that one of the debug probes atleast worked without issues.&lt;/p&gt;
&lt;p&gt;How did the program run, in terms of the NRF_POWER-&amp;gt;RESETREAS behavior?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RESETREAS works differently on NRF52840-DK vs custom board with same code</title><link>https://devzone.nordicsemi.com/thread/288753?ContentTypeID=1</link><pubDate>Tue, 12 Jan 2021 18:00:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:df89c01f-0381-41fc-a9b6-d31bb1dac3ff</guid><dc:creator>cwmoreiras</dc:creator><description>&lt;p&gt;I have successfully opened a debug session on the custom board, with the peripheral/blinky example. I started a GDB server with openOCD through the dev kit (this is what I am most familiar with) as so:&lt;br /&gt;openocd -f interface/jlink.cfg -c &amp;quot;transport select swd&amp;quot; -f target/nrf52.cfg&lt;/p&gt;
&lt;p&gt;and was able to attach to the debug port using the command:&lt;br /&gt;arm-none-eabi-gfb build/nrf52840_xxaa.out&lt;br /&gt;target extended-remote localhost:3333&lt;br /&gt;&lt;br /&gt;I am able to set breakpoints and it appears that the CPU is halted at the breakpoint.&lt;br /&gt;&lt;br /&gt;However, I also have a black magic probe, which I can also test with. The black magic probe is unable to flash the chip when the nrf52 is operating at 3.3V. It appears as though the flash is erased, but programming fails. Or maybe the flash is partially erased, since after attempting to program with the BMP, it will begin to operate at 1.8V, in spite of my program setting the GPIO voltage to 3.3 at the very beginning. When I try to attach using this probe it indicates that the target voltage is 3.1V (doesn&amp;#39;t seem right). It appears that I am able to attach to the port, however, and halt with cntl-c.&lt;/p&gt;
&lt;p&gt;After the programming fail, and the nrf52 is running at 1.8V, flashing the chip will be successful with the BMP.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RESETREAS works differently on NRF52840-DK vs custom board with same code</title><link>https://devzone.nordicsemi.com/thread/288716?ContentTypeID=1</link><pubDate>Tue, 12 Jan 2021 15:36:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d38a43e4-8f17-444a-8aa8-89049521c042</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;If you suspect that there&amp;#39;s a bad connection or similar on the power rail, you should see&amp;nbsp;instabilities while entering&amp;nbsp;debug mode and halting/breaking in the program.&lt;/p&gt;
&lt;p&gt;Could you try entering debug mode and see if there&amp;#39;s any issues during the debug session?&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: RESETREAS works differently on NRF52840-DK vs custom board with same code</title><link>https://devzone.nordicsemi.com/thread/288467?ContentTypeID=1</link><pubDate>Mon, 11 Jan 2021 17:22:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab12f32c-070d-4023-8398-b3739404b1ae</guid><dc:creator>cwmoreiras</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Sorry, I should have been more clear on this point. For this test I run a makefile that contains the commands:&lt;br /&gt;nrfjprog -f nrf52 --program ./build/nrf52840_xxaa.hex --sectorerase&lt;br /&gt;nrfjprog -f nrf52 --reset&lt;/p&gt;
&lt;p&gt;Regarding the response from hmolesworth who says:&lt;br /&gt;&amp;quot;this indicates that the chip was reset from the on-chip reset generator, which&lt;br /&gt;// will indicate a power-on-reset or a brownout reset&amp;quot;&lt;/p&gt;
&lt;p&gt;I have other reasons to suspect that the board may have problems with its power rail. Is it possible my chip is browning out during its reset sequence or some case such as that?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RESETREAS works differently on NRF52840-DK vs custom board with same code</title><link>https://devzone.nordicsemi.com/thread/288382?ContentTypeID=1</link><pubDate>Mon, 11 Jan 2021 13:05:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8e38c340-1cce-42a6-9f13-457997a1cc19</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;The below command will leave the nRF in a halted state.&lt;/p&gt;
[quote user=""]nrfjprog -f nrf52 --program ./build/nrf52840_xxaa.hex --sectorerase[/quote]
&lt;p&gt;In order to run the new program, you should either issue a reset (nrfjprog --reset, power cycle the device, etc) or a run (nrfjprog --run) command.&lt;/p&gt;
&lt;p&gt;Can you do this and see if this helps?&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: RESETREAS works differently on NRF52840-DK vs custom board with same code</title><link>https://devzone.nordicsemi.com/thread/288254?ContentTypeID=1</link><pubDate>Sat, 09 Jan 2021 01:46:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:369692e1-d835-4370-8298-b6d5995ca694</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;You might find these notes I made helpful:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// Reset Reason NRF_POWER-&amp;gt;RESETREAS is changed to SWI 4 after the SystemInit() function as it handles chip errata by software resets
// Unless cleared, the RESETREAS register will be cumulative. A field is cleared by writing &amp;#39;1&amp;#39; to it. If none of
// the reset sources are flagged, this indicates that the chip was reset from the on-chip reset generator, which
// will indicate a power-on-reset or a brownout reset&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;See&amp;nbsp;&lt;em&gt;void SystemInit(void)&lt;/em&gt;. A second power cycle may give the result you expect&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>