<?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>Migrating from nrf52 DK to custom board, guidance required</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/76671/migrating-from-nrf52-dk-to-custom-board-guidance-required</link><description>Hello, 
 I am having some trouble migrating from the nrf52 DK to my custom board with an nRF52832 and running as standalone. The application is working as intended when the custom board is connected to the DK debug header as well as on the DK itself.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 29 Jun 2021 12:20:27 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/76671/migrating-from-nrf52-dk-to-custom-board-guidance-required" /><item><title>RE: Migrating from nrf52 DK to custom board, guidance required</title><link>https://devzone.nordicsemi.com/thread/317707?ContentTypeID=1</link><pubDate>Tue, 29 Jun 2021 12:20:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6a6244ee-5ede-412b-a3d1-692372ff2c6f</guid><dc:creator>Nobody</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Sorry, I believe we had a miscommunication with regards to the LED.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The LED is connected using one of the GPIOs as a sink with a current limiting resistor. That way, if I sufficiently increase the interval I will be able to observe it blink as you suggest or probe it to see timing intervals directly on a scope. I stopped before reaching that because I noticed an erratic behavior as mentioned.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Solving this issue also proved to solve the application loading problem. It was all attributed to lead inductance. Using different leads yielded different results. So no longer than 5cm and everything works as intended. I shall also add some bulk capacitance to support the current gulps for the periods when the device wakes up and the Tx is abruptly turned on.&lt;/p&gt;
&lt;p&gt;You are indeed correct. I only require the MBR and application. But since that did not work for my initial trials I went down the wrong hole after the wrong issue. Should have checked the power first.&lt;/p&gt;
&lt;p&gt;Thank you in any case and I hope this will help someone else on here.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;All the best,&lt;/p&gt;
&lt;p&gt;Nobody&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Migrating from nrf52 DK to custom board, guidance required</title><link>https://devzone.nordicsemi.com/thread/317232?ContentTypeID=1</link><pubDate>Fri, 25 Jun 2021 12:33:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dbe0952d-33d3-410d-b369-12eb4619039b</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;It seems like you&amp;#39;re mixing RTC (real time counter) and RC oscillator (which is the internal 32.768kHz oscillator). The external crystal is the LF XTAL and has nothing to do with RTC really.&lt;/p&gt;
&lt;p&gt;The reason you don&amp;#39;t have these defines is because you&amp;#39;re not using a SoftDevice, and these are the SoftDevice configs. Sorry I missed that. Since you say you have an external crystal either way, this is likely not the issue.&lt;/p&gt;
&lt;p&gt;Regarding your misbehaving LED.&amp;nbsp;Wouldn&amp;#39;t adding a LED between VDD and a point like P0.08 just always power the LED? When the debugger is connected. What happens if you increase the interval to say 1000ms, so that you should be able to see it blinking. How have you set the pin as? Active high or low? Please use our&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fug_nrf52832_dk%2FUG%2Fnrf52_DK%2Fhw_btns_leds.html"&gt; button and LEDs HW description&lt;/a&gt; for details.&lt;/p&gt;
&lt;p&gt;What is the end goal of this custom board anyways? If you&amp;#39;re always programming it using the debug header and SWD pins, you won&amp;#39;t need a bootloader, and can only worry about the application itself, so what would you like the application to do?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Migrating from nrf52 DK to custom board, guidance required</title><link>https://devzone.nordicsemi.com/thread/316978?ContentTypeID=1</link><pubDate>Thu, 24 Jun 2021 12:11:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9d09a208-215c-4070-9dab-c07bd0406c3c</guid><dc:creator>Nobody</dc:creator><description>&lt;p&gt;Hi Simon,&lt;/p&gt;
&lt;p&gt;I have tried a few more things on my custom board. One of them yielded unexpected results.&lt;/p&gt;
&lt;p&gt;- Adding an LED with a 1k resistor between P0.08 and VDD_nRF.&lt;/p&gt;
&lt;p&gt;- The LED is Set at the RTC callback event ( followed by nrf_drv_saadc_sample() )&lt;/p&gt;
&lt;p&gt;- The LED is Cleared when the conversion is complete.&lt;/p&gt;
&lt;p&gt;- RTC interval set to 100ms&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Results:&lt;/p&gt;
&lt;p&gt;When the custom board is connected to the DKs debug header, the board appears to work as expected and due to the 100ms, the LED appears to be constantly on (as one might expect)&lt;/p&gt;
&lt;p&gt;When the board is disconnected from the DK and powered from an external source, the board appears to run as expected. So the application now starts on my board.&lt;br /&gt;However, the LED &lt;span style="text-decoration:underline;"&gt;blinks erratically&lt;/span&gt;. Can we assume that the&amp;nbsp;RTC triggering or the ADC conversion is misbehaving?&lt;br /&gt;Furthermore, I am powering the board from an SMU (3V) and the current jumps from 5.6mA (draw that appears to be attributed to stuck in MBR?) and 1.6mA where I assume it is working as expected.&lt;/p&gt;
&lt;p&gt;Hope this provides further insights&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Leon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Migrating from nrf52 DK to custom board, guidance required</title><link>https://devzone.nordicsemi.com/thread/316897?ContentTypeID=1</link><pubDate>Thu, 24 Jun 2021 08:51:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1714afc3-7ca7-4920-bcaa-e2e19870548a</guid><dc:creator>Nobody</dc:creator><description>&lt;p&gt;Hi Simon,&lt;/p&gt;
&lt;p&gt;Thanks for getting back to me on this matter.&lt;/p&gt;
&lt;p&gt;Yes, I have seen the missing/misconfigured LF source issue many times in my searches here and I thought I had it properly configured. However, it seems my sdk_config.h is missing these exact definitions. That said, it has other, similar ones. Please see below snippets from my config that refers to LF (before adding your settings):&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;//==========================================================
// &amp;lt;e&amp;gt; NRFX_CLOCK_ENABLED - nrfx_clock - CLOCK peripheral driver
//==========================================================
#ifndef NRFX_CLOCK_ENABLED
#define NRFX_CLOCK_ENABLED 1
#endif
// &amp;lt;o&amp;gt; NRFX_CLOCK_CONFIG_LF_SRC  - LF Clock Source
 
// &amp;lt;0=&amp;gt; RC 
// &amp;lt;1=&amp;gt; XTAL 
// &amp;lt;2=&amp;gt; Synth 
// &amp;lt;131073=&amp;gt; External Low Swing 
// &amp;lt;196609=&amp;gt; External Full Swing 

#ifndef NRFX_CLOCK_CONFIG_LF_SRC
#define NRFX_CLOCK_CONFIG_LF_SRC 1
#endif

// &amp;lt;o&amp;gt; NRFX_CLOCK_CONFIG_IRQ_PRIORITY  - Interrupt priority
 
// &amp;lt;0=&amp;gt; 0 (highest) 
// &amp;lt;1=&amp;gt; 1 
// &amp;lt;2=&amp;gt; 2 
// &amp;lt;3=&amp;gt; 3 
// &amp;lt;4=&amp;gt; 4 
// &amp;lt;5=&amp;gt; 5 
// &amp;lt;6=&amp;gt; 6 
// &amp;lt;7=&amp;gt; 7 

#ifndef NRFX_CLOCK_CONFIG_IRQ_PRIORITY
#define NRFX_CLOCK_CONFIG_IRQ_PRIORITY 6
#endif&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;// &amp;lt;e&amp;gt; NRF_CLOCK_ENABLED - nrf_drv_clock - CLOCK peripheral driver - legacy layer
//==========================================================
#ifndef NRF_CLOCK_ENABLED
#define NRF_CLOCK_ENABLED 1
#endif
// &amp;lt;o&amp;gt; CLOCK_CONFIG_LF_SRC  - LF Clock Source
 
// &amp;lt;0=&amp;gt; RC 
// &amp;lt;1=&amp;gt; XTAL 
// &amp;lt;2=&amp;gt; Synth 
// &amp;lt;131073=&amp;gt; External Low Swing 
// &amp;lt;196609=&amp;gt; External Full Swing 

#ifndef CLOCK_CONFIG_LF_SRC
#define CLOCK_CONFIG_LF_SRC 1
#endif

// &amp;lt;o&amp;gt; CLOCK_CONFIG_IRQ_PRIORITY  - Interrupt priority
 

// &amp;lt;i&amp;gt; Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice
// &amp;lt;0=&amp;gt; 0 (highest) 
// &amp;lt;1=&amp;gt; 1 
// &amp;lt;2=&amp;gt; 2 
// &amp;lt;3=&amp;gt; 3 
// &amp;lt;4=&amp;gt; 4 
// &amp;lt;5=&amp;gt; 5 
// &amp;lt;6=&amp;gt; 6 
// &amp;lt;7=&amp;gt; 7 

#ifndef CLOCK_CONFIG_IRQ_PRIORITY
#define CLOCK_CONFIG_IRQ_PRIORITY 6
#endif

// &amp;lt;/e&amp;gt;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Unfortunately, adding your suggestion did not make a difference. Still working normally when connected to the debugger and no signs of life when externally powered.&lt;/p&gt;
&lt;p&gt;I have tried &lt;span style="text-decoration:underline;"&gt;removing the RTC crystal (and caps)&lt;/span&gt; from my board and it appears to be used by the application as intended (in debug) as it does not work at all without it. Adding the crystal and caps returned to the previous state of working when connected to the DK debug header.&lt;/p&gt;
&lt;p&gt;I will note that my application is a mix of multiple examples, hence I likely have a messy sdk_config file.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;On the subject of RTC, please see below how I instantiate it, hope it helps&lt;/p&gt;
&lt;p&gt;Parameters:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;const  nrf_drv_rtc_t           rtc = NRF_DRV_RTC_INSTANCE(2);
static uint32_t                rtc_ticks = RTC_US_TO_TICKS(SAADC_SAMPLE_INTERVAL_MS*1000, RTC_FREQUENCY);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;In main()&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;lfclk_config();
rtc_config();&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The definitions:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;// Configre low frequency clock
static void lfclk_config(void)
{
    ret_code_t err_code = nrf_drv_clock_init();
    APP_ERROR_CHECK(err_code);
    nrf_drv_clock_lfclk_request(NULL);
}

// Configure RTC
static void rtc_config(void)
{

    uint32_t err_code;

    //Initialize RTC instance
    nrf_drv_rtc_config_t rtc_config;
    rtc_config.prescaler = RTC_FREQ_TO_PRESCALER(RTC_FREQUENCY);
    err_code = nrf_drv_rtc_init(&amp;amp;rtc, &amp;amp;rtc_config, rtc_handler);
    APP_ERROR_CHECK(err_code);

    err_code = nrf_drv_rtc_cc_set(&amp;amp;rtc, 0, rtc_ticks, true);
    APP_ERROR_CHECK(err_code);

    //Power on RTC instance
    nrf_drv_rtc_enable(&amp;amp;rtc);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This was taken from the SAADC low power example:&lt;br /&gt;&lt;a href="https://github.com/NordicPlayground/nRF52-ADC-examples/tree/master/saadc_low_power"&gt;https://github.com/NordicPlayground/nRF52-ADC-examples/tree/master/saadc_low_power&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Looking forward to any insights.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Nobody&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Migrating from nrf52 DK to custom board, guidance required</title><link>https://devzone.nordicsemi.com/thread/316865?ContentTypeID=1</link><pubDate>Thu, 24 Jun 2021 07:28:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a469097c-c15d-46cb-b2ad-f14c2ae3d6b4</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;The first thing I&amp;#39;d like you to check/confirm is whether your custom board has the optional external LF crystal from our reference circuitry, as it is common when it works when the debugger is connected but not otherwise that this is missing, and that the application is not configured to use the internal LF clock instead.&lt;/p&gt;
&lt;p&gt;If that&amp;#39;s the case, you can configure your application to use the internal RC oscillator instead by changing the following defines to these values in your projects sdk_config.h file.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// &amp;lt;h&amp;gt; Clock - SoftDevice clock configuration

//==========================================================
// &amp;lt;o&amp;gt; NRF_SDH_CLOCK_LF_SRC  - SoftDevice clock source.
 
// &amp;lt;0=&amp;gt; NRF_CLOCK_LF_SRC_RC 
// &amp;lt;1=&amp;gt; NRF_CLOCK_LF_SRC_XTAL 
// &amp;lt;2=&amp;gt; NRF_CLOCK_LF_SRC_SYNTH 

#ifndef NRF_SDH_CLOCK_LF_SRC
#define NRF_SDH_CLOCK_LF_SRC 0
#endif

// &amp;lt;o&amp;gt; NRF_SDH_CLOCK_LF_RC_CTIV - SoftDevice calibration timer interval. 
#ifndef NRF_SDH_CLOCK_LF_RC_CTIV
#define NRF_SDH_CLOCK_LF_RC_CTIV 16
#endif

// &amp;lt;o&amp;gt; NRF_SDH_CLOCK_LF_RC_TEMP_CTIV - SoftDevice calibration timer interval under constant temperature. 
// &amp;lt;i&amp;gt; How often (in number of calibration intervals) the RC oscillator shall be calibrated
// &amp;lt;i&amp;gt;  if the temperature has not changed.

#ifndef NRF_SDH_CLOCK_LF_RC_TEMP_CTIV
#define NRF_SDH_CLOCK_LF_RC_TEMP_CTIV 2
#endif

// &amp;lt;o&amp;gt; NRF_SDH_CLOCK_LF_ACCURACY  - External clock accuracy used in the LL to compute timing.
 
// &amp;lt;0=&amp;gt; NRF_CLOCK_LF_ACCURACY_250_PPM 
// &amp;lt;1=&amp;gt; NRF_CLOCK_LF_ACCURACY_500_PPM 
// &amp;lt;2=&amp;gt; NRF_CLOCK_LF_ACCURACY_150_PPM 
// &amp;lt;3=&amp;gt; NRF_CLOCK_LF_ACCURACY_100_PPM 
// &amp;lt;4=&amp;gt; NRF_CLOCK_LF_ACCURACY_75_PPM 
// &amp;lt;5=&amp;gt; NRF_CLOCK_LF_ACCURACY_50_PPM 
// &amp;lt;6=&amp;gt; NRF_CLOCK_LF_ACCURACY_30_PPM 
// &amp;lt;7=&amp;gt; NRF_CLOCK_LF_ACCURACY_20_PPM 
// &amp;lt;8=&amp;gt; NRF_CLOCK_LF_ACCURACY_10_PPM 
// &amp;lt;9=&amp;gt; NRF_CLOCK_LF_ACCURACY_5_PPM 
// &amp;lt;10=&amp;gt; NRF_CLOCK_LF_ACCURACY_2_PPM 
// &amp;lt;11=&amp;gt; NRF_CLOCK_LF_ACCURACY_1_PPM 

#ifndef NRF_SDH_CLOCK_LF_ACCURACY
#define NRF_SDH_CLOCK_LF_ACCURACY 1
#endif&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>