<?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>BMD-341 (nRF52840) fails to boot properly when UART line is used immediately after power cycle</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/66806/bmd-341-nrf52840-fails-to-boot-properly-when-uart-line-is-used-immediately-after-power-cycle</link><description>Hello, 
 Our team has narrowed down a particularly interesting issue with the boot sequence / initialization of our BMD-341 chip, which itself runs the nRF52840 SoC. For context: we are using the S140 v7.0.1 SoftDevice, with SDK16.0.0. We are using the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 09 Oct 2020 00:21:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/66806/bmd-341-nrf52840-fails-to-boot-properly-when-uart-line-is-used-immediately-after-power-cycle" /><item><title>RE: BMD-341 (nRF52840) fails to boot properly when UART line is used immediately after power cycle</title><link>https://devzone.nordicsemi.com/thread/273888?ContentTypeID=1</link><pubDate>Fri, 09 Oct 2020 00:21:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19785116-87bc-4af1-85fb-d67c09addeb7</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Ah, I think you are seeing an effective break condition. This can be fixed if so by enabling the internal pull-up in the nRF52 Rx by setting the pin pull-up after initialising the uart ie at the end of uart_init().&lt;/p&gt;
&lt;p&gt;Without this pull-up enabled the uart handler effectively sees the line-break and a framing error, which can cause a repeated reset thus:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;        case APP_UART_COMMUNICATION_ERROR:
            APP_ERROR_HANDLER(p_event-&amp;gt;data.error_communication);
            break;&lt;/pre&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The two options are 1) enable the pull-up or 2) comment out the error handler line above. Problem with 1 is that the uart is enabled before you can enable the pull-up, unless you modify the Nordic APP_UART_FIFO_INIT code which doesn&amp;#39;t enable the pull-up, before setting the Enable.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BMD-341 (nRF52840) fails to boot properly when UART line is used immediately after power cycle</title><link>https://devzone.nordicsemi.com/thread/273887?ContentTypeID=1</link><pubDate>Thu, 08 Oct 2020 23:43:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8ac27d70-19e4-4f40-8468-63d92ffa5d07</guid><dc:creator>tyrelkostyk</dc:creator><description>&lt;p&gt;Yes, there is an LED that flashes when it is advertising or when &amp;quot;activity&amp;quot; is going on (i.e. messages or being sent/received). If we don&amp;#39;t enable that UART Tx line, we also can&amp;#39;t see the BLE Peripheral on any host BLE devices (tablets, etc). We can once that line is enabled (presumably because the nRF52 finishes &amp;quot;turning on&amp;quot;. We are making some assumptions in this scenario, but only because we have been unable to find any documentation&amp;nbsp;explaining the behaviour&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BMD-341 (nRF52840) fails to boot properly when UART line is used immediately after power cycle</title><link>https://devzone.nordicsemi.com/thread/273886?ContentTypeID=1</link><pubDate>Thu, 08 Oct 2020 23:05:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ca88f72-cf71-474a-a193-207a3c8581bd</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Hmm, I&amp;#39;m not following your description .. what does &amp;quot;&lt;span&gt;&lt;em&gt;nRF52 does not turn on&lt;/em&gt;&amp;quot; mean? Is there an nRF52 LED showing when it&amp;#39;s on, or something else?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BMD-341 (nRF52840) fails to boot properly when UART line is used immediately after power cycle</title><link>https://devzone.nordicsemi.com/thread/273884?ContentTypeID=1</link><pubDate>Thu, 08 Oct 2020 22:48:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8cfe2832-ee81-4d56-a724-3cdee640b873</guid><dc:creator>tyrelkostyk</dc:creator><description>&lt;p&gt;Thank you for your response.&lt;/p&gt;
&lt;p&gt;I hear what you&amp;#39;re&amp;nbsp;saying - that enabling the UART line at startup is bad because it may induce race conditions within the nRF52&amp;#39;s internal startup initializations. However, what my post is trying to convey is the&amp;nbsp;&lt;em&gt;exact&lt;/em&gt; opposite of that suggestion. If we&amp;nbsp;&lt;em&gt;do&lt;/em&gt; delay enabling the UART Tx line, the BLE peripheral literally does not turn on until that delay is over. i.e., the nRF52 does not turn on until we enable that UART Tx line.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BMD-341 (nRF52840) fails to boot properly when UART line is used immediately after power cycle</title><link>https://devzone.nordicsemi.com/thread/273883?ContentTypeID=1</link><pubDate>Thu, 08 Oct 2020 22:41:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:043c2be8-ac3a-4cb3-bfa3-1eeed34a4a59</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Maybe not your issue, but in general early enabling the uart Rx line to the nRF52 - which is of course a Tx &lt;em&gt;output&lt;/em&gt; on the main MCU - is a bad idea. Why? Because assuming the main MCU and nRF52 share the exact same power supply they behave differently. The main MCU powers up immediately but the nRF52 has internal regulators, either LDO or DC-DC; both of these take time to rise the voltage on the internal Vcc to the pin drivers. If the main MCU enables the main MCU Tx (Rx at nRF52) then the nRF52 phantom powers the nRF52 and all bets are off in initialising the uart and indeed the nRF52 reset may never happen. If the main MCU also has internal regulators then a test can be performed by driving a spare unconnected output pin high-low on both main MCU and nRF52 before any other code runs; it&amp;#39;s a race - who wins?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BMD-341 (nRF52840) fails to boot properly when UART line is used immediately after power cycle</title><link>https://devzone.nordicsemi.com/thread/273843?ContentTypeID=1</link><pubDate>Thu, 08 Oct 2020 15:36:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b2bc762e-3b05-4b0b-aaea-f7acd4c53708</guid><dc:creator>tyrelkostyk</dc:creator><description>&lt;p&gt;After a power cycle, the UART&amp;nbsp;line is pulled high after being initialized as such in the main MCUs software. However, after a reset (i.e. reset line pulled low, not a power-cycle), that UART line stays high. This is a property of our MCUs hardware architecture, and isn&amp;#39;t necessarily unexpected.&lt;/p&gt;
&lt;p&gt;In the former (power-cycle) case, the BLE Peripheral only behaves properly if we add a delay between&amp;nbsp;pulling the UART line high and sending data over it. In the latter (reset line) case, the BLE peripheral works no matter what; presumably because that UART line is held high well ahead of time.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;After figuring that out, it seems that the UART line needs to be held high (and undisturbed) for a short amount of time at/during the BLE Peripheral&amp;#39;s boot up sequence. After a power cycle, there was virtually no time between when the main MCU was pulling the UART line high, and when it began sending data over said UART line.&lt;/p&gt;
&lt;p&gt;Are you aware if the BLE Peripheral uses that line for some sort of initialization / configuration? If so, then this behaviour would make sense.&lt;/p&gt;
&lt;p&gt;Some documentation / clarification surrounding that possibility would be awesome :)&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BMD-341 (nRF52840) fails to boot properly when UART line is used immediately after power cycle</title><link>https://devzone.nordicsemi.com/thread/273712?ContentTypeID=1</link><pubDate>Thu, 08 Oct 2020 11:43:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fa52a894-21c2-42fc-9803-06bdcf8e3c6c</guid><dc:creator>ketiljo</dc:creator><description>&lt;p&gt;Is the UART line high before the nRF is powered up?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>