Who is this for?

This is an introductory topic for embedded developers who want to add an interactive command-line shell to a Zephyr RTOS application on Arm Cortex-M.

What will you learn?

Upon completion of this Learning Path, you will be able to:

  • Enable and tailor Zephyr shell (Kconfig/prj.conf) to produce a minimal CLI footprint
  • Build and flash shell-enabled Zephyr apps using MQTT and UART shell backends on an Arm Cortex-M board
  • Use the Zephyr shell for board bring-up, diagnostics, and interactive testing

Prerequisites

Before starting, you will need the following:

  • Basic familiarity with embedded C programming
  • Visual Studio Code with the Workbench for Zephyr extension installed and configured
  • Docker Desktop, Docker Engine, or another Docker-compatible runtime installed on your host computer (for the MQTT shell example, if you’re not installing Mosquitto on host)
  • A Zephyr-supported Arm Cortex-M board (for example, NXP FRDM-MCXN947)

Summary

AI-assisted

This summary was drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.

Close
?
You’ll enable and configure the Zephyr shell on an Arm Cortex-M board with Workbench for Zephyr. First, you’ll update prj.conf for the shell and selected MQTT or UART backend. Then, you’ll build and flash from Visual Studio Code, verify the shell prompt, and use built-in modules for bring-up and diagnostics over Ethernet or USB serial.

Frequently asked questions

AI-assisted

These FAQs were drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.

Close
?
How do I know the Zephyr shell is enabled and working after I flash the board?
You should see a shell prompt on the selected backend after boot. Run a built-in command such as kernel version to confirm the shell responds.
Do I need to add networking code in main.c for the MQTT shell example?
No. The MQTT example starts the shell, network stack, DHCP client, and MQTT shell backend from configuration options in prj.conf.
Which backend should I use if I want to interact locally during bring-up?
Use the UART shell backend. It maps shell input and output to the active UART console over the board’s USB serial interface and doesn’t require network connectivity.
What should I check if I don’t see any shell output over UART?
Verify that the UART shell backend is enabled in prj.conf and that you’re connected to the board’s USB serial interface selected as the active console. Use a serial terminal application supported on your host OS to view the console.
What should I check if the MQTT shell doesn't connect to the broker?
Confirm CONFIG_SHELL_BACKEND_MQTT is enabled and that required networking options are set in prj.conf so the device can obtain network connectivity. Ensure the MQTT broker is reachable from the board over Ethernet.
Next