<?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>Shell configuration interaction with MCUMGR dependency (Base64)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/127238/shell-configuration-interaction-with-mcumgr-dependency-base64</link><description>nRF Connect SDK v3.2.1, nRF9160dk 
 
 Hi, 
 I&amp;#39;m working on an application which connects to a MQTT broker over cellular network, and have MCUMGR enabled for firmware updates. I&amp;#39;m trying to integrate some sample shell code, which works fine in isolation</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 12 Mar 2026 12:54:56 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/127238/shell-configuration-interaction-with-mcumgr-dependency-base64" /><item><title>RE: Shell configuration interaction with MCUMGR dependency (Base64)</title><link>https://devzone.nordicsemi.com/thread/563119?ContentTypeID=1</link><pubDate>Thu, 12 Mar 2026 12:54:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:23cc6f88-f3cd-45cf-b1a6-2d44ad5cc948</guid><dc:creator>Adamcs</dc:creator><description>&lt;p&gt;Toolchain/SDK 3.2.1, nrf9160dk_9160_ns, prj.conf only (with copy/paste from the other over confs).&lt;/p&gt;
&lt;p&gt;Thanks, I&amp;#39;ll try to reproduce your results.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Shell configuration interaction with MCUMGR dependency (Base64)</title><link>https://devzone.nordicsemi.com/thread/563107?ContentTypeID=1</link><pubDate>Thu, 12 Mar 2026 12:25:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:afc598ab-edb4-48f5-a4f9-d591ba52ffa9</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This sample seems to be directed towards nRF5340dk, given the gpio_fwd entry in sysbuild/mcuboot folder?&lt;/p&gt;
&lt;p&gt;However, I removed these and the same with the&amp;nbsp;nrf5340-specific configs in prj.conf, and built the project (CONFIG_BASE64 is set by the extra config file):&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;west build -b nrf9160dk/nrf9160/ns -- -DEXTRA_CONF_FILE=&amp;quot;overlay-shell-mgmt.conf;overlay-serial-console.conf&amp;quot;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;And this enables both uart console + shell:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;*** Booting MCUboot v2.3.0-dev-0d9411f5dda3 ***
*** Using nRF Connect SDK v3.2.1-d8887f6f32df ***
*** Using Zephyr OS v4.2.99-ec78104f1569 ***
I: Starting bootloader
I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Boot source: none
I: Image index: 0, Swap type: none
I: Bootloader chainload address offset: 0x10000
I: Image version: v0.0.0
?: Jumping to the first image slot
*** Booting nRF Connect SDK v3.2.1-d8887f6f32df ***
*** Using Zephyr OS v4.2.99-ec78104f1569 ***
[00:00:00.002,899] &amp;lt;inf&amp;gt; smp_sample: build time: Mar 12 2026 13:19:31
uart:~$ 
  clear    date     device   devmem   help     history  kernel   rem
  resize   retval   shell
uart:~$ help
Please press the &amp;lt;Tab&amp;gt; button to see all available commands.
You can also use the &amp;lt;Tab&amp;gt; button to prompt or auto-complete all commands or its subcommands.
You can try to call commands with &amp;lt;-h&amp;gt; or &amp;lt;--help&amp;gt; parameter for more information.

Shell supports following meta-keys:
  Ctrl + (a key from: abcdefklnpuw)
  Alt  + (a key from: bf)
Please refer to shell documentation for more details.

Available commands:
  clear    : Clear screen.
  date     : Date commands
  device   : Device commands
  devmem   : Read/write physical memory
             Usage:
             Read memory at address with optional width:
             devmem &amp;lt;address&amp;gt; [&amp;lt;width&amp;gt;]
             Write memory at address with mandatory width and value:
             devmem &amp;lt;address&amp;gt; &amp;lt;width&amp;gt; &amp;lt;value&amp;gt;
  help     : Prints the help message.
  history  : Command history.
  kernel   : Kernel commands
  rem      : Ignore lines beginning with &amp;#39;rem &amp;#39;
  resize   : Console gets terminal screen size or assumes default in case the
             readout fails. It must be executed after each terminal width change
             to ensure correct text display.
  retval   : Print return value of most recent command
  shell    : Useful, not Unix-like shell commands.
uart:~$ &lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Did you use a different build setup? Could you please share how you configured the sample?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Shell configuration interaction with MCUMGR dependency (Base64)</title><link>https://devzone.nordicsemi.com/thread/563049?ContentTypeID=1</link><pubDate>Wed, 11 Mar 2026 15:38:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5275fda3-8329-45e5-9e77-afc628dddbf0</guid><dc:creator>Adamcs</dc:creator><description>&lt;p&gt;It appears that the shell just doesn&amp;#39;t work when flashing in the sample directly. I haven&amp;#39;t tested DFU while shell is enabled.&lt;/p&gt;
&lt;p&gt;I went into debug mode and was able to step through main and reach the while-loop at the end, doesn&amp;#39;t appear to be stuck.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve attached the project zip.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/1106.smp_5F00_svr.zip"&gt;devzone.nordicsemi.com/.../1106.smp_5F00_svr.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Shell configuration interaction with MCUMGR dependency (Base64)</title><link>https://devzone.nordicsemi.com/thread/563019?ContentTypeID=1</link><pubDate>Wed, 11 Mar 2026 12:47:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9d9c8795-3572-470a-ad7e-d952f4ccb3b6</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Is the issue that your application does not boot after a dfu upgrade, or that the shell in general does not work?&lt;/p&gt;
&lt;p&gt;Have you tried entering debug mode to see if there is any specific place that you&amp;#39;re stuck?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you have replicated this with smp_srv, could you please share the .diff or .zip of the project?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Shell configuration interaction with MCUMGR dependency (Base64)</title><link>https://devzone.nordicsemi.com/thread/562962?ContentTypeID=1</link><pubDate>Tue, 10 Mar 2026 17:35:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8abf75b0-98b4-4308-a985-f6d0fbcc0e3f</guid><dc:creator>Adamcs</dc:creator><description>&lt;p&gt;No luck. The only option I did not already have was&amp;nbsp;CONFIG_UART_CONSOLE_MCUMGR=y.&lt;/p&gt;
&lt;p&gt;When I add that to the prj.conf, I see a couple of print log output in a application pre-init function, but nothing from main. My initial description was wrong, as this appears to be the case with my original config prior to adding the option above.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I tried to make a sample project based on smp_srv, with some minor changes to enable the shell, but I get a similar issue.&lt;/p&gt;
&lt;p&gt;main.c&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/*
 * Copyright (c) 2012-2014 Wind River Systems, Inc.
 * Copyright (c) 2020 Prevas A/S
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#include &amp;lt;zephyr/kernel.h&amp;gt;
#include &amp;lt;zephyr/stats/stats.h&amp;gt;
#include &amp;lt;zephyr/usb/usb_device.h&amp;gt;

#ifdef CONFIG_MCUMGR_GRP_FS
#include &amp;lt;zephyr/device.h&amp;gt;
#include &amp;lt;zephyr/fs/fs.h&amp;gt;
#include &amp;lt;zephyr/fs/littlefs.h&amp;gt;
#endif
#ifdef CONFIG_MCUMGR_GRP_STAT
#include &amp;lt;zephyr/mgmt/mcumgr/grp/stat_mgmt/stat_mgmt.h&amp;gt;
#endif

#define LOG_LEVEL LOG_LEVEL_DBG
#include &amp;lt;zephyr/logging/log.h&amp;gt;
LOG_MODULE_REGISTER(smp_sample);

#include &amp;quot;common.h&amp;quot;

#define STORAGE_PARTITION_LABEL	storage_partition
#define STORAGE_PARTITION_ID	FIXED_PARTITION_ID(STORAGE_PARTITION_LABEL)

/* Define an example stats group; approximates seconds since boot. */
STATS_SECT_START(smp_svr_stats)
STATS_SECT_ENTRY(ticks)
STATS_SECT_END;

/* Assign a name to the `ticks` stat. */
STATS_NAME_START(smp_svr_stats)
STATS_NAME(smp_svr_stats, ticks)
STATS_NAME_END(smp_svr_stats);

/* Define an instance of the stats group. */
STATS_SECT_DECL(smp_svr_stats) smp_svr_stats;

#ifdef CONFIG_MCUMGR_GRP_FS
FS_LITTLEFS_DECLARE_DEFAULT_CONFIG(cstorage);
static struct fs_mount_t littlefs_mnt = {
	.type = FS_LITTLEFS,
	.fs_data = &amp;amp;cstorage,
	.storage_dev = (void *)STORAGE_PARTITION_ID,
	.mnt_point = &amp;quot;/lfs1&amp;quot;
};
#endif

int main(void)
{
	int rc = STATS_INIT_AND_REG(smp_svr_stats, STATS_SIZE_32,
				    &amp;quot;smp_svr_stats&amp;quot;);

	if (rc &amp;lt; 0) {
		LOG_ERR(&amp;quot;Error initializing stats system [%d]&amp;quot;, rc);
	}

	/* Register the built-in mcumgr command handlers. */
#ifdef CONFIG_MCUMGR_GRP_FS
	rc = fs_mount(&amp;amp;littlefs_mnt);
	if (rc &amp;lt; 0) {
		LOG_ERR(&amp;quot;Error mounting littlefs [%d]&amp;quot;, rc);
	}
#endif

#ifdef CONFIG_MCUMGR_TRANSPORT_BT
	start_smp_bluetooth_adverts();
#endif

	/* using __TIME__ ensure that a new binary will be built on every
	 * compile which is convenient when testing firmware upgrade.
	 */
	LOG_INF(&amp;quot;build time: &amp;quot; __DATE__ &amp;quot; &amp;quot; __TIME__);

	/* The system work queue handles all incoming mcumgr requests.  Let the
	 * main thread idle while the mcumgr server runs.
	 */
	while (1) {
		k_sleep(K_MSEC(1000));
		STATS_INC(smp_svr_stats, ticks);
	}
	return 0;
}

#include &amp;lt;zephyr/kernel.h&amp;gt;
#include &amp;lt;zephyr/shell/shell.h&amp;gt;
int test_shell(const struct shell* sh, size_t argc, char** argv)
{
    shell_print(sh, &amp;quot;test_shell&amp;quot;);
    return 0;
}
SHELL_CMD_ARG_REGISTER(test, NULL, &amp;quot;Test&amp;quot;, test_shell, 1, 0);
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;prj.conf&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;# Enable MCUmgr and dependencies.
CONFIG_NET_BUF=y
CONFIG_ZCBOR=y
CONFIG_CRC=y
CONFIG_MCUMGR=y
CONFIG_STREAM_FLASH=y
CONFIG_FLASH_MAP=y

# Some command handlers require a large stack.
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2304
CONFIG_MAIN_STACK_SIZE=2176

# Ensure an MCUboot-compatible binary is generated.
CONFIG_BOOTLOADER_MCUBOOT=y

# Enable flash operations.
CONFIG_FLASH=y

# Required by the `taskstat` command.
CONFIG_THREAD_MONITOR=y

# Support for taskstat command
CONFIG_MCUMGR_GRP_OS_TASKSTAT=y

# Enable statistics and statistic names.
CONFIG_STATS=y
CONFIG_STATS_NAMES=y

# Enable most core commands.
CONFIG_FLASH=y
CONFIG_IMG_MANAGER=y
CONFIG_MCUMGR_GRP_IMG=y
CONFIG_MCUMGR_GRP_OS=y
CONFIG_MCUMGR_GRP_STAT=y

# Enable logging
CONFIG_LOG=y
CONFIG_MCUBOOT_UTIL_LOG_LEVEL_WRN=y

# Disable debug logging
CONFIG_LOG_MAX_LEVEL=3

# Enable console with MCUmgr pass through
CONFIG_MCUMGR_TRANSPORT_UART=y
CONFIG_BASE64=y
CONFIG_CRC=y
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
CONFIG_UART_CONSOLE_MCUMGR=y


CONFIG_SHELL=y
CONFIG_SHELL_BACKEND_SERIAL=y

# Shell features
CONFIG_SHELL_HISTORY=y
CONFIG_SHELL_HISTORY_BUFFER=512
CONFIG_SHELL_TAB=y
CONFIG_SHELL_TAB_AUTOCOMPLETION=y

# Shell configurations
CONFIG_SHELL=y
CONFIG_SHELL_WILDCARD=n
CONFIG_SHELL_PROMPT_UART=&amp;quot;test &amp;gt; &amp;quot;
CONFIG_SHELL_ARGC_MAX=40
# -h and --help options are handled in Modem Shell
CONFIG_SHELL_HELP_OPT_PARSE=n
# Command line buffer is set this large to enable writing of certificates and injecting A-GNSS data on command line.
CONFIG_SHELL_CMD_BUFF_SIZE=3584
# Shell stack has impact for modem shell application, not CONFIG_MAIN_STACK_SIZE
CONFIG_SHELL_STACK_SIZE=9216
# Shell RX buffer needs to be increased to avoid problems with test automation
CONFIG_SHELL_BACKEND_SERIAL_RX_RING_BUFFER_SIZE=512
# Use interrupt driven shell UART, otherwise we won&amp;#39;t be able to suspend the UART
CONFIG_SHELL_BACKEND_SERIAL_API_INTERRUPT_DRIVEN=y
#CONFIG_SERIAL_SUPPORT_INTERRUPT=y

# Shell support
CONFIG_SHELL=y
CONFIG_SHELL_BACKEND_SERIAL=y
CONFIG_SHELL_HISTORY=y
CONFIG_SHELL_HISTORY_BUFFER=512
CONFIG_SHELL_TAB=y
CONFIG_SHELL_TAB_AUTOCOMPLETION=y

# Console and logging
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
CONFIG_LOG=y
CONFIG_PRINTK=y&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s the output from the sample originally, compared to after my changes.&lt;/p&gt;
&lt;p&gt;before&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;*** Booting MCUboot v2.3.0-dev-0d9411f5dda3 ***
*** Using nRF Connect SDK v3.2.1-d8887f6f32df ***
*** Using Zephyr OS v4.2.99-ec78104f1569 ***
I: Starting bootloader
I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Boot source: none
I: Image index: 0, Swap type: none
I: Bootloader chainload address offset: 0x10000
I: Image version: v0.0.0
�*** Booting nRF Connect SDK v3.2.1-d8887f6f32df ***
*** Using Zephyr OS v4.2.99-ec78104f1569 ***
[00:00:00.251,586] &amp;lt;inf&amp;gt; smp_sample: build time: Mar 10 2026 13:23:10&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;after&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;*** Booting MCUboot v2.3.0-dev-0d9411f5dda3 ***
*** Using nRF Connect SDK v3.2.1-d8887f6f32df ***
*** Using Zephyr OS v4.2.99-ec78104f1569 ***
I: Starting bootloader
I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Boot source: none
I: Image index: 0, Swap type: none
I: Bootloader chainload address offset: 0x10000
I: Image version: v0.0.0
&amp;lt;&amp;lt;&amp;lt;I pressed the reset button here&amp;gt;&amp;gt;&amp;gt;
�*** Booting MCUboot v2.3.0-dev-0d9411f5dda3 ***
*** Using nRF Connect SDK v3.2.1-d8887f6f32df ***
*** Using Zephyr OS v4.2.99-ec78104f1569 ***
I: Starting bootloader
I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Boot source: none
I: Image index: 0, Swap type: none
I: Bootloader chainload address offset: 0x10000
I: Image version: v0.0.0
�: Jumping to the first image slot&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Shell configuration interaction with MCUMGR dependency (Base64)</title><link>https://devzone.nordicsemi.com/thread/562436?ContentTypeID=1</link><pubDate>Tue, 03 Mar 2026 13:35:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:03a974ef-4827-4a38-a640-29347c9f77b1</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]&lt;p&gt;Just realized this was specifically what depended on Base64, &amp;quot;CONFIG_MCUMGR_TRANSPORT_UART&amp;quot;.&lt;/p&gt;
&lt;p&gt;Is the issue simply that UART shell and UART MCUMGR cannot coexist?&lt;/p&gt;[/quote]
&lt;p&gt;Your observation is correct, ie. that enabling uart shell + uart mcumgr requires logic to coexist.&lt;/p&gt;
&lt;p&gt;More specifically these configurations:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/main/samples/subsys/mgmt/mcumgr/smp_svr/serial-console.conf"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/main/samples/subsys/mgmt/mcumgr/smp_svr/serial-console.conf&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could you try these and see if you get it working?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>