Create an interactive shell for Zephyr RTOS on Arm Cortex-M
Introduction
Set up the Zephyr shell development environment
Understand the Zephyr shell subsystem and backends
Build and run the Zephyr MQTT shell on Arm Cortex-M
Build and run the Zephyr UART shell on Arm Cortex-M
Next Steps
Create an interactive shell for Zephyr RTOS on Arm Cortex-M
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
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.
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
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.
kernel version to confirm the shell responds.prj.conf.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.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.