<?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>BLE runs only while debugging on custom board (probably RTT issue)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/32570/ble-runs-only-while-debugging-on-custom-board-probably-rtt-issue</link><description>I have problems with my custom board. 
 I developed the firmware with the nrf52840-PDK and there the firmware runs standalone (with RTT connected and without) or when debugged via eclipse. 
 Both boards (nrf52840-PDK and my custom board) have the nrf52840</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 04 Apr 2018 15:48:02 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/32570/ble-runs-only-while-debugging-on-custom-board-probably-rtt-issue" /><item><title>RE: BLE runs only while debugging on custom board (probably RTT issue)</title><link>https://devzone.nordicsemi.com/thread/126906?ContentTypeID=1</link><pubDate>Wed, 04 Apr 2018 15:48:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:710f2a37-d763-47b4-a986-8877b018c322</guid><dc:creator>Florian Zierer</dc:creator><description>&lt;p&gt;Hi Vidar,&lt;/p&gt;
&lt;p&gt;no this also does not help.&lt;/p&gt;
&lt;p&gt;I think I found the reason. Unfortunately the SWDCLK and SWDIO traces cross the antenna matching network on the other side of the PCB on our testboard (not the final one) and this seems to be the problem. If I start JLinkExe with a slow SWD target interface speed like e.g. 10 or 20kHz, I can see some of the RTT logs and can connect via BLE. If I increase the SWD speed, the connection drops. Also if a lot of output is printed, the connection drops.&lt;/p&gt;
&lt;p&gt;Thanks for your help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE runs only while debugging on custom board (probably RTT issue)</title><link>https://devzone.nordicsemi.com/thread/126640?ContentTypeID=1</link><pubDate>Tue, 03 Apr 2018 11:35:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:43823439-2338-4c8b-bc82-cbd2c3302cad</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi Florian,&lt;/p&gt;
&lt;p&gt;Agree, it does not seem to be related to the HF clock. As an experiment, could you try disable sleep mode in your FW to see if that changes the behavior? I.e., remove the call to&amp;nbsp;sd_app_evt_wait() from the main loop.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Note that the chip enters emulated sleep mode when the debug interface is enabled (when you read RTT logs), so that&amp;#39;s another difference with being in debug mode..&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE runs only while debugging on custom board (probably RTT issue)</title><link>https://devzone.nordicsemi.com/thread/126413?ContentTypeID=1</link><pubDate>Thu, 29 Mar 2018 18:40:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8227970a-2d00-4c79-8db8-cb84501f5d0e</guid><dc:creator>Florian Zierer</dc:creator><description>&lt;p&gt;Hey Vidar,&lt;/p&gt;
&lt;p&gt;I did some more measurements and I think the crystal is not the problem.&lt;/p&gt;
&lt;p&gt;I implemented a test case where I measure a timer with 100KHz and toggle an output pin. The output of 100 pulses is averaged.&lt;/p&gt;
&lt;p&gt;If I run the code without manually starting the HFCLK, the pulses from the nrf52840-DK and my Testboard differ.&lt;/p&gt;
&lt;p&gt;If I run it when starting the HFCLK manually, they are exactly 10.000&amp;micro;S as they should.&lt;/p&gt;
&lt;p&gt;Additionally I measured the startup time of the HFCLK and my board takes a little bit longer but nearly the same as the devboard.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;                    Startup Time   Average 100 KHz (10.00&amp;#181;S)   Average 100 KHz
                                   with HFCLK                  No HFCLK
-------------------------------------------------------------------------------
Testboard:          ~345&amp;#181;S         10.000&amp;#181;S                    10.025&amp;#181;s
Development-Kit:    ~334&amp;#181;S         10.000&amp;#181;S                     9.875&amp;#181;S&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The crystal seems ok, what do you think?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m thinking more and more that the problem (no BLE when RTT is active) lies somewhere else. Perhaps it is because I am debugging with an nrf52-DK Jlink?&lt;/p&gt;
&lt;p&gt;Do you have any other suggestions I could have a look at?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE runs only while debugging on custom board (probably RTT issue)</title><link>https://devzone.nordicsemi.com/thread/126379?ContentTypeID=1</link><pubDate>Thu, 29 Mar 2018 06:44:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:17218585-50a7-418f-b8f7-733da55481b5</guid><dc:creator>Florian Zierer</dc:creator><description>&lt;p&gt;Hey Vidar,&lt;/p&gt;
&lt;p&gt;we exchanged the crystal with a 8pF load crystal and use 12pF capacitors as it is done in the reference circuits.&lt;/p&gt;
&lt;p&gt;Unfortunately this does fix the problem. Is there any other hint you could give us to figure out the root for the problem?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE runs only while debugging on custom board (probably RTT issue)</title><link>https://devzone.nordicsemi.com/thread/126020?ContentTypeID=1</link><pubDate>Mon, 26 Mar 2018 17:27:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cf6209fe-f2db-4585-8346-ce9ae560daa4</guid><dc:creator>Florian Zierer</dc:creator><description>&lt;p&gt;Ok, we will try with another crystal with 8pF load capacitance.&lt;/p&gt;
&lt;p&gt;But one question. How is the load capacitance in the datasheet (12pF) meant? I thought it is the load capacitance for the crystal&lt;/p&gt;
&lt;p&gt;The crystal we are using has 12pF load capacitance (should be in accordance with the spec). But with the formula we needed to add 21pF capacitors to get to the 12pF load capacitance. So with our 22pF we should not be too far off.&lt;/p&gt;
&lt;p&gt;The reference circuitry does also not use exact capacitors, the formula would say you have to use 13pF (for 8pF load capaticance) and you use 12pF.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE runs only while debugging on custom board (probably RTT issue)</title><link>https://devzone.nordicsemi.com/thread/125981?ContentTypeID=1</link><pubDate>Mon, 26 Mar 2018 14:10:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d8932181-36f1-4815-8b50-1578be9f618f</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;&lt;em&gt;&amp;quot;Why did you want me to test to start the HFCLK manually?&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;To get an indication whether this issue was clock related. This replicates the clock behavior when the chip is in debug interface mode.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I think wrong load capacitance can explain the behavior you have been seeing. Please refer to Sigurd&amp;#39;s answer in this thread:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/30204/hfxo-crystal/119935#119935"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/30204/hfxo-crystal/119935#119935&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE runs only while debugging on custom board (probably RTT issue)</title><link>https://devzone.nordicsemi.com/thread/125850?ContentTypeID=1</link><pubDate>Sat, 24 Mar 2018 19:21:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f75b92a7-21f7-4259-aa81-700560aaadd8</guid><dc:creator>Florian Zierer</dc:creator><description>&lt;p&gt;Why did you want me to test to start the HFCLK manually?&lt;/p&gt;
&lt;p&gt;As I said, in another firmware, If I remove those lines, it wont start at all. Does this mean there is and issue with the crystal?&lt;/p&gt;
&lt;p&gt;We are using a 12pF load crystal with 22pF Capacitors (calculation would give 21pF but there are only 22pF and 20pF capacitors available.&lt;/p&gt;
&lt;p&gt;Would it help to switch to a 8pF load crystal (with 12pF capacitors)? Can this be the problem, that the crystal does not start fast enough?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE runs only while debugging on custom board (probably RTT issue)</title><link>https://devzone.nordicsemi.com/thread/125761?ContentTypeID=1</link><pubDate>Fri, 23 Mar 2018 14:35:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:572a222c-787c-4790-9260-a1a9882a7055</guid><dc:creator>Florian Zierer</dc:creator><description>&lt;p&gt;Can you please also set&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; NRF_CLOCK-&amp;gt;TASKS_HFCLKSTART&amp;nbsp; = 1;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while ( NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED == 0);&lt;/p&gt;
&lt;p&gt;otherwise the firmware does not start at all without RTT connected.&lt;/p&gt;
&lt;p&gt;With RTT I can see the output:&lt;/p&gt;
&lt;p&gt;682420203: &amp;lt;info&amp;gt; app: Heart Rate Sensor example started.&lt;br /&gt;682420203: &amp;lt;info&amp;gt; app: Fast advertising.&lt;/p&gt;
&lt;p&gt;but can&amp;#39;t connect with nfconnect. The device does not appear when scanning.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If I flash the same hexfile on my DK I can connect to it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE runs only while debugging on custom board (probably RTT issue)</title><link>https://devzone.nordicsemi.com/thread/125755?ContentTypeID=1</link><pubDate>Fri, 23 Mar 2018 14:25:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a12898d-26ad-451c-b497-35db63014236</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;I disabled IOs, reset pin, and set the LF source to the internal RC to make sure that it would run on your board.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE runs only while debugging on custom board (probably RTT issue)</title><link>https://devzone.nordicsemi.com/thread/125739?ContentTypeID=1</link><pubDate>Fri, 23 Mar 2018 13:30:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:88bf9732-169e-4f46-ae43-313bc88e8e40</guid><dc:creator>Florian Zierer</dc:creator><description>&lt;p&gt;Logging and RTT is always enabled in code. I just connect the debugger and view the logs and then its not working any longer.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I will try with your hexfile. Are there all BSP pins disabled? I have different peripherals connected (some on default bsp pins) and don&amp;#39;t want to interfere with them.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE runs only while debugging on custom board (probably RTT issue)</title><link>https://devzone.nordicsemi.com/thread/125697?ContentTypeID=1</link><pubDate>Fri, 23 Mar 2018 10:04:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:abee8e67-c3bf-4b31-a17a-4629597b68ac</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Sorry, meant to say NRF_CLOCK-&amp;gt;TASKS_&lt;strong&gt;HFCLKSTART.&amp;nbsp;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;quot;I can connect only when RTT is not used&amp;quot;&lt;/p&gt;
&lt;p&gt;Just so I understand this correctly, when not used, does that mean that you have disabled RTT logging in the code, or that you are not connecting the debugger and viewing the logs?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I have not managed to reproduce this issue here.&amp;nbsp;Please try with the hex file below on your board&amp;nbsp;to see if you get the same result (RTT is enabled in code):&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-98daf6b127614d3b9c67a3b671d38686/hrs_5F00_w_5F00_s140.hex"&gt;devzone.nordicsemi.com/.../hrs_5F00_w_5F00_s140.hex&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE runs only while debugging on custom board (probably RTT issue)</title><link>https://devzone.nordicsemi.com/thread/125613?ContentTypeID=1</link><pubDate>Thu, 22 Mar 2018 21:13:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3a62cdfd-f58f-4c11-9fbd-243d6a94ffb1</guid><dc:creator>Florian Zierer</dc:creator><description>&lt;p&gt;I had to use the following code snippet&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;    NRF_CLOCK-&amp;gt;TASKS_HFCLKSTART  = 1;
    while ( NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED == 0);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;In some test apps I had issues to start and with this code, it seems to start. Does this mean there is an issue with the HF crystal?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Unfortunately it does not help with the rtt problem, as you already mentioned.&lt;/p&gt;
&lt;p&gt;I can connect only when RTT is not used,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE runs only while debugging on custom board (probably RTT issue)</title><link>https://devzone.nordicsemi.com/thread/125602?ContentTypeID=1</link><pubDate>Thu, 22 Mar 2018 17:32:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:722e1d47-4015-44c6-bd9b-d89597f6f439</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Could you try to enable the HF crystal after startup just to see if it makes any difference? The HF crystal is&amp;nbsp;always &amp;quot;on&amp;quot; in&amp;nbsp;debug interface mode. Although it does not explain why it works when RTT is disabled.&lt;/p&gt;
&lt;p&gt;int main()&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; NRF_CLOCK-&amp;gt;TASKS_START&amp;nbsp; = 1;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; while ( NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED == 0);&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; //app initalization&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Do you have any IOs,etc on the custom board that could be used to&amp;nbsp;indicate if the&amp;nbsp;program goes in a reset loop?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>