<?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>Seriaous issue with CONFIG_MCUMGR, VBATT and SAADC</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/109669/seriaous-issue-with-config_mcumgr-vbatt-and-saadc</link><description>I have a serious issue with CONFIG_MCUMGR. 
 If I enable it in prj.conf I cant read the voltage divider to get the status of the battery. I get random values. 
 It took me a long time but I isolated the issue to this 
 
 CONFIG_MCUMGR =y 
 CONFIG_BOOTLOADER_MCUBOOT</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 26 Mar 2024 13:39:55 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/109669/seriaous-issue-with-config_mcumgr-vbatt-and-saadc" /><item><title>RE: Seriaous issue with CONFIG_MCUMGR, VBATT and SAADC</title><link>https://devzone.nordicsemi.com/thread/475935?ContentTypeID=1</link><pubDate>Tue, 26 Mar 2024 13:39:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eb0ec62d-5295-4c92-859c-253c1e1bf6a9</guid><dc:creator>IvanR</dc:creator><description>&lt;p&gt;added&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&amp;amp;&lt;/span&gt;&lt;span&gt;uart0&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;span&gt;status&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;quot;disabled&amp;quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;to&amp;nbsp;mcuboot.overlay&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;It works now!&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Thanks&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Seriaous issue with CONFIG_MCUMGR, VBATT and SAADC</title><link>https://devzone.nordicsemi.com/thread/475927?ContentTypeID=1</link><pubDate>Tue, 26 Mar 2024 13:12:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:292bb584-756d-4879-851a-86e58533dcff</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Thanks for confirming. I suggest comparing the IO configurations with and without MCUBoot enabled to see if you can find any discrepancies.&lt;/p&gt;
&lt;p&gt;You can do this for P0 and P1 in VS code:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1711458765541v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;Edit: Or you can apply an overlay to mcuboot to change the default pinout and disable UARTE if it is not needed in the bootloader.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/config_and_build/multi_image.html#permanent-configuration-changes-to-child-images"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/config_and_build/multi_image.html#permanent-configuration-changes-to-child-images&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Seriaous issue with CONFIG_MCUMGR, VBATT and SAADC</title><link>https://devzone.nordicsemi.com/thread/475922?ContentTypeID=1</link><pubDate>Tue, 26 Mar 2024 13:05:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c517e95e-9816-4d0b-817a-38c8d4c18dba</guid><dc:creator>IvanR</dc:creator><description>&lt;p&gt;It&amp;#39;s a custom board with&amp;nbsp;mx25r6435f.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;its more or less&amp;nbsp;&lt;span&gt;DT overlays of&amp;nbsp; the nRF5340dk_nrf5340 board&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Its basically the overlay that was sent in hello_world.zip&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;When applying the same &amp;quot;commenting out&amp;quot; on the larger project config It passes all start up test but hangs on BLE initi.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt; &amp;gt;&amp;gt;  ADC initialized... 
&amp;gt;&amp;gt;  ADC Channel 2 initialized... 
&amp;gt;&amp;gt;  Voltage divider initialized... 
Test 4&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Test is read out of adc operation with 4 being the result...&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;  if (bt_enable(bt_ready)) {
    report_and_halt(&amp;quot;Bluetooth init failed.&amp;quot;);
  }
  
  while(1){
    int ret = test_vbat();
    printk(&amp;quot;Test %d\n&amp;quot;, ret);
    k_sleep(K_MSEC(500));
  }&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Seriaous issue with CONFIG_MCUMGR, VBATT and SAADC</title><link>https://devzone.nordicsemi.com/thread/475912?ContentTypeID=1</link><pubDate>Tue, 26 Mar 2024 12:56:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b91a2cfc-7477-4ade-a758-2eada9ec876c</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;I suspect the bootloader is configuring some pins (for UARTE, etc) that is causing this issue on your board. Have you created a custom board files for your board, or are you relying on DT overlays with the nRF5340dk_nrf5340 board ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Seriaous issue with CONFIG_MCUMGR, VBATT and SAADC</title><link>https://devzone.nordicsemi.com/thread/475910?ContentTypeID=1</link><pubDate>Tue, 26 Mar 2024 12:52:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1235676c-fa07-4fe0-80a5-4302e43475ac</guid><dc:creator>IvanR</dc:creator><description>&lt;p&gt;The output is as expected&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;*** Booting nRF Connect SDK v3.5.99-ncs1 ***
Starting
3978
3969
3978
3960
3996
3978
3978
3978&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;??&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Seriaous issue with CONFIG_MCUMGR, VBATT and SAADC</title><link>https://devzone.nordicsemi.com/thread/475907?ContentTypeID=1</link><pubDate>Tue, 26 Mar 2024 12:47:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ce143dd4-4ad6-4da6-9faf-26086749c915</guid><dc:creator>IvanR</dc:creator><description>&lt;p&gt;Sorry :) one sec, well a minute to compile&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Seriaous issue with CONFIG_MCUMGR, VBATT and SAADC</title><link>https://devzone.nordicsemi.com/thread/475906?ContentTypeID=1</link><pubDate>Tue, 26 Mar 2024 12:47:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eb55bf58-d60c-4379-a20d-36ed40140b5a</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;This is the configuration I wanted you to try:&lt;/p&gt;
&lt;div&gt;&lt;span&gt;#&lt;/span&gt;&lt;span&gt;&amp;nbsp;CONFIG_MCUMGR=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;CONFIG_BOOTLOADER_MCUBOOT=y&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;#&lt;/span&gt;&lt;span&gt;&amp;nbsp;CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;#&lt;/span&gt;&lt;span&gt;&amp;nbsp;CONFIG_ZCBOR=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;#&lt;/span&gt;&lt;span&gt;&amp;nbsp;CONFIG_STREAM_FLASH=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;#&lt;/span&gt;&lt;span&gt;&amp;nbsp;CONFIG_IMG_MANAGER=y&lt;/span&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Seriaous issue with CONFIG_MCUMGR, VBATT and SAADC</title><link>https://devzone.nordicsemi.com/thread/475905?ContentTypeID=1</link><pubDate>Tue, 26 Mar 2024 12:45:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f2d1b8de-ae42-4b58-a1a1-7e1b518421d0</guid><dc:creator>IvanR</dc:creator><description>&lt;p&gt;This is the output of all uncommented:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;*** Booting nRF Connect SDK v3.5.99-ncs1 ***
Starting
518373
3628800
200475
1555227
3004398
4453659
-3015900
3946797
2792502
2898459
4453614
-3015936
3946779
3310830&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;If I try to comment out only&amp;nbsp;&lt;span&gt;CONFIG_BOOTLOADER_MCUBOOT&amp;nbsp;I get compile&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;n file included from C:/ncs/v2.6.0/zephyr/include/zephyr/storage/flash_map.h:275,
                 from C:/ncs/v2.6.0/zephyr/subsys/dfu/boot/mcuboot.c:12:
C:/ncs/v2.6.0/zephyr/subsys/dfu/boot/mcuboot.c: In function &amp;#39;boot_is_img_confirmed&amp;#39;:
C:/ncs/v2.6.0/nrf/include/flash_map_pm.h:43:22: error: &amp;#39;PM_mcuboot_primary_ID&amp;#39; undeclared (first use in this function)
   43 | #define PM_ID(label) PM_##label##_ID
      |                      ^~~
C:/ncs/v2.6.0/nrf/include/flash_map_pm.h:48:35: note: in expansion of macro &amp;#39;PM_ID&amp;#39;
   48 | #define FIXED_PARTITION_ID(label) PM_ID(label)
      |                                   ^~~~~
C:/ncs/v2.6.0/zephyr/subsys/dfu/boot/mcuboot_priv.h:22:34: note: in expansion of macro &amp;#39;FIXED_PARTITION_ID&amp;#39;
   22 | #define FLASH_AREA_IMAGE_PRIMARY FIXED_PARTITION_ID(SLOT0_LABEL)
      |                                  ^~~~~~~~~~~~~~~~~~
C:/ncs/v2.6.0/zephyr/subsys/dfu/boot/mcuboot.c:192:30: note: in expansion of macro &amp;#39;FLASH_AREA_IMAGE_PRIMARY&amp;#39;
  192 |         rc = flash_area_open(FLASH_AREA_IMAGE_PRIMARY, &amp;amp;fa);
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~
C:/ncs/v2.6.0/nrf/include/flash_map_pm.h:43:22: note: each undeclared identifier is reported only once for each function it appears in
   43 | #define PM_ID(label) PM_##label##_ID
      |                      ^~~
C:/ncs/v2.6.0/nrf/include/flash_map_pm.h:48:35: note: in expansion of macro &amp;#39;PM_ID&amp;#39;
   48 | #define FIXED_PARTITION_ID(label) PM_ID(label)
      |                                   ^~~~~
C:/ncs/v2.6.0/zephyr/subsys/dfu/boot/mcuboot_priv.h:22:34: note: in expansion of macro &amp;#39;FIXED_PARTITION_ID&amp;#39;
   22 | #define FLASH_AREA_IMAGE_PRIMARY FIXED_PARTITION_ID(SLOT0_LABEL)
      |                                  ^~~~~~~~~~~~~~~~~~
C:/ncs/v2.6.0/zephyr/subsys/dfu/boot/mcuboot.c:192:30: note: in expansion of macro &amp;#39;FLASH_AREA_IMAGE_PRIMARY&amp;#39;
  192 |         rc = flash_area_open(FLASH_AREA_IMAGE_PRIMARY, &amp;amp;fa);
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;If I comment out a&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;#&lt;/span&gt;&lt;span&gt; CONFIG_MCUMGR=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;#&lt;/span&gt;&lt;span&gt; CONFIG_BOOTLOADER_MCUBOOT=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;#&lt;/span&gt;&lt;span&gt; CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;#&lt;/span&gt;&lt;span&gt; CONFIG_ZCBOR=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;#&lt;/span&gt;&lt;span&gt; CONFIG_STREAM_FLASH=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;#&lt;/span&gt;&lt;span&gt; CONFIG_IMG_MANAGER=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;I get output:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;*** Booting nRF Connect SDK v3.5.99-ncs1 ***
Starting
3924
3969
3924
3978
3969
3960
3978
3915
3960
3978&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Which is what I expect ....&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Seriaous issue with CONFIG_MCUMGR, VBATT and SAADC</title><link>https://devzone.nordicsemi.com/thread/475899?ContentTypeID=1</link><pubDate>Tue, 26 Mar 2024 12:32:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:35c56c64-2047-4e52-a7d1-e4e7872e76e9</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I tried running your project on an nRF5340 DK both with and without the configuration mentioned above, but it did not appear to affect the SAADC measurements in my case. Do you observe the same issue when only CONFIG_BOOTLOADER_MCUBOOT is enabled?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Seriaous issue with CONFIG_MCUMGR, VBATT and SAADC</title><link>https://devzone.nordicsemi.com/thread/475859?ContentTypeID=1</link><pubDate>Tue, 26 Mar 2024 10:15:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dbbf27d9-2c3d-47d5-b08b-1212c607f783</guid><dc:creator>IvanR</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/64420.hello_5F00_world.zip"&gt;devzone.nordicsemi.com/.../64420.hello_5F00_world.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Example code.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_MCUMGR&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BOOTLOADER_MCUBOOT&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_ZCBOR&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_STREAM_FLASH&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_IMG_MANAGER&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;if this is commented out it works, if not it produces random values&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>