<?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>Clock configuration fail in application with secure bootloader (uart mbr)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/84411/clock-configuration-fail-in-application-with-secure-bootloader-uart-mbr</link><description>I am using nrf52832 with a custom board with no external crystal oscillator. As bootloader I use &amp;quot;secure_bootloader_uart_mbr&amp;quot; so I don&amp;#39;t have softdevice. SDK is 17.1.0_ddde560 
 I have modified sdk_config.h of my application to use RC as LF clock source</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 22 Feb 2022 13:05:03 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/84411/clock-configuration-fail-in-application-with-secure-bootloader-uart-mbr" /><item><title>RE: Clock configuration fail in application with secure bootloader (uart mbr)</title><link>https://devzone.nordicsemi.com/thread/354358?ContentTypeID=1</link><pubDate>Tue, 22 Feb 2022 13:05:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a09be4cf-3b56-4c1f-84ae-452f1c4eba7f</guid><dc:creator>Narek Aleksanyan</dc:creator><description>&lt;p&gt;I found what was causing my application to crush.&lt;/p&gt;
&lt;p&gt;It was the fact that I didn&amp;#39;t change RAM placement addresses and my application most likely was trying to access function at an address which was allocated for bootloader and giving hardfault in the result .&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Clock configuration fail in application with secure bootloader (uart mbr)</title><link>https://devzone.nordicsemi.com/thread/354125?ContentTypeID=1</link><pubDate>Mon, 21 Feb 2022 12:12:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39d92a4f-8aac-4f2f-abaf-9143ee09296a</guid><dc:creator>Narek Aleksanyan</dc:creator><description>&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/1028x720/__key/communityserver-discussions-components-files/4/Screenshot-2022_2D00_02_2D00_21-155039.png" /&gt;&lt;/p&gt;
&lt;p&gt;Here is what happens when it crushes, and you can see the main function here as well.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Clock configuration fail in application with secure bootloader (uart mbr)</title><link>https://devzone.nordicsemi.com/thread/354099?ContentTypeID=1</link><pubDate>Mon, 21 Feb 2022 10:44:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:81362b20-5a15-423a-b403-b9d7999384f2</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;1) What happens when it crashes? Hardfault? or does it go to the app_error handler? Are you able to debug further after the crash?&lt;/p&gt;
&lt;p&gt;2) How does your main() function look like?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Clock configuration fail in application with secure bootloader (uart mbr)</title><link>https://devzone.nordicsemi.com/thread/353364?ContentTypeID=1</link><pubDate>Wed, 16 Feb 2022 13:23:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:087debb7-58eb-479c-b978-033bf2753341</guid><dc:creator>Narek Aleksanyan</dc:creator><description>[quote userid="15146" url="~/f/nordic-q-a/84411/clock-configuration-fail-in-application-with-secure-bootloader-uart-mbr/353051#353051"]I assume you did this,&amp;nbsp;NRF_SDH_CLOCK_LF_SRC to 0, NRF_SDH_CLOCK_LF_RC_CTIV to 16, NRF_SDH_CLOCK_LF_RC_TEMP_CTIV to 2, and NRF_SDH_CLOCK_LF_ACCURACY to 1. Perhaps also&amp;nbsp;CLOCK_CONFIG_LF_SRC to 0.[/quote]
&lt;p&gt;Yes, I have these settings in my application sdk_config&lt;/p&gt;
[quote userid="15146" url="~/f/nordic-q-a/84411/clock-configuration-fail-in-application-with-secure-bootloader-uart-mbr/353051#353051"]&lt;p&gt;Does it passes&amp;nbsp;nrf_drv_clock_lfclk_request() as well?&lt;/p&gt;
&lt;p&gt;Are you able to debug, and figure out where it crashes?&lt;/p&gt;[/quote]
&lt;p&gt;My application crashes inside nrf_drv_clock_lfclk_request() when it calles&amp;nbsp;&amp;nbsp;CRITICAL_REGION_EXIT()&lt;/p&gt;
&lt;p&gt;here is the function below.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;void nrf_drv_clock_lfclk_request(nrf_drv_clock_handler_item_t * p_handler_item)
{
    ASSERT(m_clock_cb.module_initialized);

    if (m_clock_cb.lfclk_on)
    {
        if (p_handler_item)
        {
            p_handler_item-&amp;gt;event_handler(NRF_DRV_CLOCK_EVT_LFCLK_STARTED);
        }
        CRITICAL_REGION_ENTER();
        ++(m_clock_cb.lfclk_requests);
        CRITICAL_REGION_EXIT();
    }
    else
    {
        CRITICAL_REGION_ENTER();
        if (p_handler_item)
        {
            item_enqueue((nrf_drv_clock_handler_item_t **)&amp;amp;m_clock_cb.p_lf_head,
                p_handler_item);
        }
        if (m_clock_cb.lfclk_requests == 0)
        {
            nrfx_clock_lfclk_start();
        }
        ++(m_clock_cb.lfclk_requests);
        CRITICAL_REGION_EXIT();//this call results in crush &amp;lt;=============
    }

    ASSERT(m_clock_cb.lfclk_requests &amp;gt; 0);
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Clock configuration fail in application with secure bootloader (uart mbr)</title><link>https://devzone.nordicsemi.com/thread/353051?ContentTypeID=1</link><pubDate>Tue, 15 Feb 2022 10:19:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b64992c8-966d-4110-b5a4-d406692a1e2c</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Does it passes&amp;nbsp;nrf_drv_clock_lfclk_request() as well?&lt;/p&gt;
&lt;p&gt;Are you able to debug, and figure out where it crashes?&lt;/p&gt;
&lt;p&gt;&lt;span&gt;...&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I assume you did this,&amp;nbsp;NRF_SDH_CLOCK_LF_SRC to 0, NRF_SDH_CLOCK_LF_RC_CTIV to 16, NRF_SDH_CLOCK_LF_RC_TEMP_CTIV to 2, and NRF_SDH_CLOCK_LF_ACCURACY to 1. Perhaps also&amp;nbsp;CLOCK_CONFIG_LF_SRC to 0.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Clock configuration fail in application with secure bootloader (uart mbr)</title><link>https://devzone.nordicsemi.com/thread/352914?ContentTypeID=1</link><pubDate>Mon, 14 Feb 2022 13:52:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:237fcf67-aae1-4f81-907a-6caafd5e6f88</guid><dc:creator>Narek Aleksanyan</dc:creator><description>&lt;p&gt;The only log that I get in my application is the one that I wrote&lt;/p&gt;
&lt;p&gt;&amp;lt;info&amp;gt; app: inside app main&lt;/p&gt;
&lt;p&gt;the other instance of logging before crushing is in the function nrf_drv_clock_init(), which is not getting processed even if I call NRF_LOG_FLUSH() or&amp;nbsp;&lt;span&gt;NRF_LOG_FINAL_FLUSH()&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;but the returned value of&amp;nbsp;nrf_drv_clock_init() passes the APP_ERROR_CHECK&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;ret_code_t ret= nrf_drv_clock_init();
APP_ERROR_CHECK(ret);
nrf_drv_clock_lfclk_request(NULL);&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
[quote userid="15146" url="~/f/nordic-q-a/84411/clock-configuration-fail-in-application-with-secure-bootloader-uart-mbr/352854#352854"]From your &amp;quot;NRF_LIBUARTE_ASYNC_DEFINE&amp;quot;, you seem to be using RTC instance 0. This is used by the SoftDevice as well. Try using RTC instance 2 instead.[/quote]
&lt;p&gt;I changed the RTC instance to 2, also changed the timer instance to 3, but the problem still persists.&lt;/p&gt;
&lt;p&gt;Is it possible that the address of the modules in use are misplaced in ram?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;EDIT::&lt;/p&gt;
&lt;p&gt;So I stumbled across bunch of parsing errors in output Source Navigator, which neither were showing in Target tab, nor they were indicated in any way during build, and all of these errors are complaining about &amp;quot;unknown register name &amp;#39;vfpcc&amp;#39; in asm&amp;quot; in the cmsis_gcc.h header.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Which according to this&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/35481/source-navigator-in-segger-embedded-studio-reports-unknown-register-name-vfpcc-in-asm"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/35481/source-navigator-in-segger-embedded-studio-reports-unknown-register-name-vfpcc-in-asm&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;is not an issue&lt;/p&gt;
&lt;p&gt;However I include this for you to have full information regarding the issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Clock configuration fail in application with secure bootloader (uart mbr)</title><link>https://devzone.nordicsemi.com/thread/352854?ContentTypeID=1</link><pubDate>Mon, 14 Feb 2022 11:31:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cf13e45b-f61f-41fd-a08b-23322661de17</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Do you have any logs from your application as well?&lt;/p&gt;
[quote user=""]Also I use a timer instance in libuarte if it is relevant.[/quote]
&lt;p&gt;From your &amp;quot;NRF_LIBUARTE_ASYNC_DEFINE&amp;quot;, you seem to be using RTC instance 0. This is used by the SoftDevice as well. Try using RTC instance 2 instead.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Clock configuration fail in application with secure bootloader (uart mbr)</title><link>https://devzone.nordicsemi.com/thread/351801?ContentTypeID=1</link><pubDate>Tue, 08 Feb 2022 12:53:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2ca5ca33-6829-4a8e-abe5-ad039772cfca</guid><dc:creator>Narek Aleksanyan</dc:creator><description>&lt;p&gt;I ran the&amp;nbsp;&lt;span&gt;debug variant of the bootloader project(pca10040_uart_debug), and here is the log of the bootloader.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;00&amp;gt; &amp;lt;info&amp;gt; app: Inside main&lt;br /&gt;00&amp;gt; &lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; app: In nrf_bootloader_init&lt;br /&gt;00&amp;gt; &lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_settings: Calling nrf_dfu_settings_init()...&lt;br /&gt;00&amp;gt; &lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.&lt;br /&gt;00&amp;gt; &lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_settings: Using settings page.&lt;br /&gt;00&amp;gt; &lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_settings: Copying forbidden parts from backup page.&lt;br /&gt;00&amp;gt; &lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.&lt;br /&gt;00&amp;gt; &lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; nrf_dfu_settings: Backing up settings page to address 0x7E000.&lt;br /&gt;00&amp;gt; &lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.&lt;br /&gt;00&amp;gt; &lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; app: Enter nrf_bootloader_fw_activate&lt;br /&gt;00&amp;gt; &lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: No firmware to activate.&lt;br /&gt;00&amp;gt; &lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_validation: CRC check of app failed. Return 1&lt;br /&gt;00&amp;gt; &lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; app: App is valid&lt;br /&gt;00&amp;gt; &lt;br /&gt;00&amp;gt; &amp;lt;warning&amp;gt; nrf_dfu_settings: No additional data erased&lt;br /&gt;00&amp;gt; &lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; nrf_dfu_settings: Backing up settings page to address 0x7E000.&lt;br /&gt;00&amp;gt; &lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.&lt;br /&gt;00&amp;gt; &lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; app: Running nrf_bootloader_app_start with address: 0x00001000&lt;br /&gt;00&amp;gt; &lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; app: Disabling interrupts. NVIC-&amp;gt;ICER[0]: 0x0&lt;br /&gt;00&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Clock configuration fail in application with secure bootloader (uart mbr)</title><link>https://devzone.nordicsemi.com/thread/351548?ContentTypeID=1</link><pubDate>Mon, 07 Feb 2022 13:16:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:70481f62-5583-460d-8242-5699b3c64f71</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]&lt;p&gt;After bootloader starts my application I initialize the clock module, however my application crushes and causes the device to reset.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;[/quote]
&lt;p&gt;Could you test with the debug variant of the bootloader project(pca10040_uart_debug), and see if you get any errors or warnings printed in the log(Segger RTT logger backend)?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>