<?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>nrf52840 P0.25 is pulled up before application starts</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/106200/nrf52840-p0-25-is-pulled-up-before-application-starts</link><description>I&amp;#39;m currently working on a PCB that involves connecting an external device to an nRF52840 via SPI, with the MOSI pin connected to P0.25 of the MCU. Interestingly, the external device seems to be adversely affected when the MOSI pin is pulled up, preventing</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 01 Dec 2023 21:22:51 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/106200/nrf52840-p0-25-is-pulled-up-before-application-starts" /><item><title>RE: nrf52840 P0.25 is pulled up before application starts</title><link>https://devzone.nordicsemi.com/thread/458590?ContentTypeID=1</link><pubDate>Fri, 01 Dec 2023 21:22:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0c3c19bd-640a-47bb-80f3-49167fe142b6</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;I ran the same test on an nRF52840 and don&amp;#39;t see the pull-up enabled on P0.25. So .. is it possible your chip supplier is providing parts with software such as a bootloader or manufacturing test sequence already installed? Maybe that software has a pull-up enabled on that pin; a full chip erase would remove that if so on the off-chance that hasn&amp;#39;t been tried already..&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52840 P0.25 is pulled up before application starts</title><link>https://devzone.nordicsemi.com/thread/458567?ContentTypeID=1</link><pubDate>Fri, 01 Dec 2023 15:28:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:581cf360-a4b5-4241-9ac7-a75f71679e91</guid><dc:creator>and0792</dc:creator><description>&lt;p&gt;Thank you for the insights, I will have a look at those phantom power/back-drive discussions you mention.&lt;br /&gt;&lt;br /&gt;Nevertheless, I ran a test with a completely different board that never had an&amp;nbsp;external device connected and where, in fact, P0.25 is not connected to anything. I put a breakpoint on the _start entry point and on main() and what I see is P0.25 being pulled up.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Also, power to the external device is given by a power switch that is enabled by a nrf52 gpio (and also has an external pull down resistor) which means that the external device should be powered up after the nrf52. This power switch is activated when the enable pin goes high.&lt;/p&gt;
&lt;p&gt;As a workaround, I put an external pull-up resistor on the power switch and everything worked fine. The drawback is that I will have static power consumption when the enable pin is low and&amp;nbsp; this is something I&amp;#39;d like to avoid.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52840 P0.25 is pulled up before application starts</title><link>https://devzone.nordicsemi.com/thread/458428?ContentTypeID=1</link><pubDate>Fri, 01 Dec 2023 04:18:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a7c23a07-d552-4297-a4e1-1f36cc6a5998</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Thanks, that&amp;#39;s helpful. I see now that the MOSI signal is from the external device driving into the nRF52 pin P0.25, in which case this looks like a classic phantom power issue, where P0.25 is powering up the internal VDD of the nRF52 via the nRF52 internal schottky clamp diode sufficiently high such that the nRF52 reset function fails to correctly operate when nRF52 VDD is turned on. This is a known issue with most MCUs. The effect is likely to have damaged P0.25 such that it no longer behaves normally and may indicate the pull-up enabled (not sure about that). The only solution to phantom power of this nature is to isolate the MOSI signal by either ensuring no power is applied to the external device until the nRF52 has correctly reset or to insert a buffer (aka level-shifter even if voltages are similar) which is enabled by the nRF52 VDD and thus blocks the MOSI signal until nRF52 VDD is established.&lt;/p&gt;
&lt;p&gt;&amp;quot;&lt;span&gt;&lt;em&gt;I can plug the external device after flashing (meaning that the MCU has enough time to run the code that properly configures all the pins) and all is good&lt;/em&gt;&amp;quot; - to clarify my comments this issue is unrelated to the nRF52 programming the pins, it is simply that the nRF52 reset function will not work with phantom power applied prior to nRF52 VDD rising. In this particular case the pin maay already be damaged; maybe test a new board but ensure nRF52 VDD rises before the external device VDD.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Searching the devzone for &amp;quot;Phantom power&amp;quot; and &amp;quot;back-drive&amp;quot; should highlight other discussions regarding this.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/32798/nrf52832-io-problem/130207#130207"&gt;nrf52832-io-problem&lt;/a&gt;&amp;nbsp;- I suggested a buffer in this thread; I use this buffer on our design.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52840 P0.25 is pulled up before application starts</title><link>https://devzone.nordicsemi.com/thread/458427?ContentTypeID=1</link><pubDate>Fri, 01 Dec 2023 03:43:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cc4b0ac0-a4ae-40ca-8400-975f82609256</guid><dc:creator>and0792</dc:creator><description>&lt;p&gt;Sorry, I try to clarify.&lt;/p&gt;
&lt;p&gt;I am working with a PCB (which I designed) that has an nrf52840 on it. This PCB also has a header that can be used to plug an external device and communicate with it through SPI.&lt;/p&gt;
&lt;p&gt;I use Segger to flash the firmware and before flashing I can be in either one of these two different cases:&lt;/p&gt;
&lt;p&gt;1- no external device is plugged&lt;/p&gt;
&lt;p&gt;2- an external device is plugged&lt;/p&gt;
&lt;p&gt;In case 1, the MCU boots up perfectly fine and everything works as expected. I can plug the external device after flashing (meaning that the MCU has enough time to run the code that properly configures all the pins) and all is good.&lt;/p&gt;
&lt;p&gt;In case 2, the MCU doesn&amp;#39;t boot up and no code is executed. After a few tests I realized that if I left the pin of the external device that is connected to P0.25 floating, the MCU boots up and the code is executed as it should.&lt;/p&gt;
&lt;p&gt;So I ran this test:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;- I plugged all the pins of the external device except the one that is connected to P0.25&lt;/p&gt;
&lt;p&gt;- I set a breakpoint at _start as well as one at the main() function&lt;/p&gt;
&lt;p&gt;- I flash the firmware&lt;/p&gt;
&lt;p&gt;- I run the code&lt;/p&gt;
&lt;p&gt;- the program counter stops at _start&lt;/p&gt;
&lt;p&gt;- I look at the PIN_CFG[25] and I see that P0.25 has it&amp;#39;s internal pull up activated&lt;/p&gt;
&lt;p&gt;- I measure the voltage on P0.25 and I see it is high&lt;/p&gt;
&lt;p&gt;-I click on the play button to continue executing the code&lt;/p&gt;
&lt;p&gt;- the program stops at main()&amp;nbsp;&lt;/p&gt;
&lt;p&gt;- I measure the voltage on P0.25 and I see it is high&lt;/p&gt;
&lt;p&gt;- I look at the PIN_CFG[25] and I see that P0.25 has it&amp;#39;s internal pull up activated&lt;/p&gt;
&lt;p&gt;This is where the&amp;nbsp;&lt;span&gt;&amp;nbsp;&amp;quot;&lt;/span&gt;&lt;span&gt;&lt;em&gt;Upon inspecting the code and the register banks with Segger, I noticed that PIN_CFG[25] is initially configured as a pull-up&lt;/em&gt;&amp;quot; comes from.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Then I ran this test:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;- I plugged all the pins of the external device including the one that is connected to P0.25&lt;/p&gt;
&lt;p&gt;- I set a breakpoint at the _start entry point as well as one where you suggested in your previous comment and one in main()&lt;/p&gt;
&lt;p&gt;- I flash the firmware&lt;/p&gt;
&lt;p&gt;- I run the code&amp;nbsp;&lt;/p&gt;
&lt;p&gt;- the code never stops at any of the breakpoints&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I ran one more test:&lt;/p&gt;
&lt;p&gt;- I plugged all the pins of the external device but this time I avoided using P0.25 and used a different gpio instead&amp;nbsp;&lt;/p&gt;
&lt;p&gt;- I flashed the firmware and everything worked fine&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;It seems clear to me that the problem is on P0.25 which, for some reason, is the only pin that, when the system boots up, has its internal pull up enabled.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I hope it is clearer now.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52840 P0.25 is pulled up before application starts</title><link>https://devzone.nordicsemi.com/thread/458421?ContentTypeID=1</link><pubDate>Fri, 01 Dec 2023 02:12:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bb44a7b4-030d-4139-a024-1215c54b4e82</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;er .. how do you know the MCU doesn&amp;#39;t &amp;quot;&lt;em&gt;boot up&lt;/em&gt;&amp;quot; and not just hang in the reset sequence? If&amp;nbsp;the MCU didn&amp;#39;t boot up, where did &amp;quot;&lt;span&gt;&lt;em&gt;Upon inspecting the code and the register banks with Segger, I noticed that PIN_CFG[25] is initially configured as a pull-up&lt;/em&gt;&amp;quot; come from? Are there two MCUs? An outline circuit would help ..&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52840 P0.25 is pulled up before application starts</title><link>https://devzone.nordicsemi.com/thread/458418?ContentTypeID=1</link><pubDate>Fri, 01 Dec 2023 01:33:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ad8d376f-4abe-482f-b802-3b5cc33a8886</guid><dc:creator>and0792</dc:creator><description>&lt;p&gt;Hi hmolesworth,&lt;/p&gt;
&lt;p&gt;the MCU doesn&amp;#39;t even boot up, it would never reach the breakpoint.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52840 P0.25 is pulled up before application starts</title><link>https://devzone.nordicsemi.com/thread/458387?ContentTypeID=1</link><pubDate>Thu, 30 Nov 2023 17:34:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:88e3bcf0-eebb-4fad-b6fd-6eff452832c3</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Just checking, are you setting the breakpoint before inits and errata handling? If not break here (or equivalent), immediately after jump to reset vector in case there is a side-effect of work-arounds. (nRF52832 had an issue with P0.25 though not nRF52840)&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;_vectors:
  .word __stack_end__
  .word Reset_Handler

Reset_Handler:
  /* Perform prestart tasks. */
  ldr r0, =nRFInitialize         &amp;lt;== break here&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52840 P0.25 is pulled up before application starts</title><link>https://devzone.nordicsemi.com/thread/458383?ContentTypeID=1</link><pubDate>Thu, 30 Nov 2023 16:59:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7eea4bf9-dcd4-4cf5-85b9-9cdef8c44fbc</guid><dc:creator>and0792</dc:creator><description>&lt;p&gt;Hi Kenneth,&lt;/p&gt;
&lt;p&gt;thank you for your reply.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Even when no debugger is attached,&amp;nbsp;I can see P0.25 being pulled up by measuring the pin voltage with a multimeter. For this reason I don&amp;#39;t think these two problems are related.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Any other suggestions?&lt;/p&gt;
&lt;p&gt;Andrea&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52840 P0.25 is pulled up before application starts</title><link>https://devzone.nordicsemi.com/thread/458347?ContentTypeID=1</link><pubDate>Thu, 30 Nov 2023 14:51:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a1f145d5-6512-4ec4-ac46-fb4b99446dac</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I am just wondering if the problem may be related to this one:&lt;br /&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/errata_nRF52840_Rev3/ERR/nRF52840/Rev3/latest/anomaly_840_81.html#anomaly_840_81"&gt;https://infocenter.nordicsemi.com/topic/errata_nRF52840_Rev3/ERR/nRF52840/Rev3/latest/anomaly_840_81.html#anomaly_840_81&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>