Hello Shell
This is a derived work from the original Zephyr “Hello World” example! Most of the stuff in this README file needs to be redesigned and changed!
Overview
A simple Hello World example that can be used with any supported board and prints ‘Hello World! I’m THE SHELL’ to the console. This application can be built into modes:
basic command set
fancy command set, with default enabled
CONFIG_BRIDLE_CMD_HELLO
Requirements
The sample supports the following platforms (located in samples/helloshell/tests.yaml):
Hardware platforms |
Order number |
Board name |
|
|---|---|---|---|
STM32C5A3CG |
|
||
STM32C5A3CG |
|
||
ATSAMD21G18A |
|
||
RP2350 |
|
||
RP2350 |
|
||
RP2040 |
|
||
RP2040 |
|
||
STM32F103 |
|
||
CH32V203 |
|
||
RP2350 |
|
||
RP2350 |
|
||
RP2040 |
|
||
RP2040 |
|
||
RP2040 |
|
||
RP2040 |
|
||
RP2040 |
|
||
RP2040 |
|
||
RP2040 |
|
||
RP2040 |
|
||
STM32F103 |
|
||
STM32F072 |
|
||
STM32F051 |
|
||
STM32F030 |
|
||
ATSAMD21G18A |
|
||
ATSAMD21G18A |
|
||
ATSAMD21G18A |
|
||
ATSAMD21G18A |
|
||
RP2040 |
|
||
RP2040 |
|
||
RP2350 |
|
||
RP2350 |
|
||
RP2040 |
|
||
RP2040 |
|
||
RP2350 |
|
||
STM32L496ZG |
|
||
STM32L496ZG |
|
||
STM32F767ZI |
|
||
STM32F767ZI |
|
||
STM32F746ZG |
|
||
STM32F746ZG |
|
||
STM32F413ZH |
|
||
STM32F413ZH |
|
||
STM32F401RE |
|
||
STM32F401RE |
|
||
STM32F303RE |
|
||
STM32F303RE |
|
||
nRF9160 |
|
||
nRF52840 |
|
||
nRF52840 |
|
||
Native (64-bit) |
|
||
Native (32-bit) |
|
||
RP2350 |
|
||
RP2040 |
|
||
i.MX RT1170 (CM7) |
with Bridle’s MIMXRT1170-EVK (BBE) |
|
|
i.MX RT1170 (CM4) |
with Bridle’s MIMXRT1170-EVK (BBE) |
|
|
i.MX RT1060 |
|
||
i.MX RT1060 |
|
||
i.MX RT1010 |
|
||
i.MX RT1010 |
|
||
STM32F777NI |
|
||
RP2350 |
|
||
RP2040 |
|
||
RP2040 |
|
||
nRF52840 |
|
||
ATSAMD21G18A |
|
||
ATSAMD21G18A |
|
For simulated or emulated testing and development purposes one of the following runtime environments (boards) are also possible to use:
ARM Cortex-A9 Emulation (
qemu_cortex_a9)
Building and Running
This project outputs ‘Hello World! I’m THE SHELL’ to the console. It can be built and executed as emulation in QEMU Emulation for X86 as follows:
west build -b qemu_x86 -p -d build/helloshell-qemu_x86 bridle/samples/helloshell west build -t run -d build/helloshell-qemu_x86
Hint
Exit QEMU by pressing CTRL+A x.
Also it can be built and executed on following targets:
As Native simulator - native_sim, fancy command set mode:
west build -b native_sim -p -d build/helloshell-native_sim bridle/samples/helloshell west build -t run -d build/helloshell-native_sim
Hint
Connect a terminal emulator to the given pseudotty or start the application directly with the autoconnect argument:
./build/helloshell-native_sim/zephyr/zephyr.exe -attach_uartAs emulation in QEMU Emulation for ARM Cortex-M3, fancy command set mode:
west build -b qemu_cortex_m3 -p -d build/helloshell-qemu_cortex_m3 bridle/samples/helloshell west build -t run -d build/helloshell-qemu_cortex_m3
Hint
Exit QEMU by pressing CTRL+A x.
On Nucleo F746ZG board, fancy command set mode:
west build -b nucleo_f746zg -p -d build/helloshell-nucleo_f746zg bridle/samples/helloshell west flash -d build/helloshell-nucleo_f746zg
Further you can deside either to run in a basic or fancy command set mode:
On Nucleo F746ZG board, tiny command set mode for an absolutely minimal environment (lowest memory footprint):
west build -b nucleo_f746zg -p -d build/helloshell-nucleo_f746zg bridle/samples/helloshell -- -DEXTRA_CONF_FILE="prj-tiny.conf" west flash -d build/helloshell-nucleo_f746zg
On Nucleo F746ZG board, minimal command set mode for basic system operations:
west build -b nucleo_f746zg -p -d build/helloshell-nucleo_f746zg bridle/samples/helloshell -- -DEXTRA_CONF_FILE="prj-minimal.conf" west flash -d build/helloshell-nucleo_f746zg
On Nucleo F746ZG board, helpful command set mode for hardware startups and bug hunting:
west build -b nucleo_f746zg -p -d build/helloshell-nucleo_f746zg bridle/samples/helloshell -- -DEXTRA_CONF_FILE="prj-hwstartup.conf" west flash -d build/helloshell-nucleo_f746zg
On Nucleo F746ZG board, fancy command set mode (implies
prj.confmerged with board specific configuration):west build -b nucleo_f746zg -p -d build/helloshell-nucleo_f746zg bridle/samples/helloshell west flash -d build/helloshell-nucleo_f746zg
Sample Output
(text in bold is a command input, text in angle brackets are keys to press)
Hello World! I'm THE SHELL from nucleo_f746zg
uart:~$ <Tab>
adc bridle clear dac date device devmem
eeprom flash gpio hello help history hwinfo
i2c kernel led log pwm regulator rem
resize retval rtc sensor shell timer
uart:~$ help
Please press the <Tab> button to see all available commands.
You can also use the <Tab> button to prompt or auto-complete all commands or its subcommands.
You can try to call commands with <-h> or <--help> 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:
adc : ADC commands
bridle : Bridle commands.
clear : Clear screen.
dac : DAC shell commands
date : Date commands
device : Device commands
devmem : Read/write physical memory
Usage:
Read memory at address with optional width:
devmem address [width]
Write memory at address with mandatory width and value:
devmem address <width> <value>
eeprom : EEPROM shell commands
flash : Flash shell commands
gpio : GPIO commands
hello : say hello
help : Prints the help message.
history : Command history.
hwinfo : HWINFO commands
i2c : I2C commands
kernel : Kernel commands
led : LED commands
log : Commands for controlling logger
pwm : PWM shell commands
regulator : Regulator playground
rem : Ignore lines beginning with 'rem '
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
sensor : Sensor commands
shell : Useful, not Unix-like shell commands.
timer : Timer commands
uart:~$ hello -h
hello - say hello
uart:~$ hello
Hello from shell.
uart:~$ kernel version
Zephyr version 4.5.0
uart:~$ bridle version
Bridle version 4.4.99
uart:~$ bridle version long
Bridle version 4.4.99.0
uart:~$ bridle info
Zephyr: 4.5.0
Bridle: 4.4.99
uart:~$ kernel uptime
Uptime: 327750 ms
uart:~$ kernel cycles
cycles: 3586181929 hw cycles
uart:~$ kernel thread list
Scheduler: 792 since last call
Threads:
*0x20010990 shell_uart
options: 0x0, priority: 14 timeout: 0
state: queued, entry: 0x8005025
stack size 2048, unused 1008, usage 1040 / 2048 (50 %)
0x20010d10
options: 0x0, priority: 0 timeout: 0
state: pending, entry: 0x8006d09
stack size 1024, unused 832, usage 192 / 1024 (18 %)
0x20010490 logging
options: 0x0, priority: 14 timeout: 0
state: pending, entry: 0x8002aed
stack size 768, unused 568, usage 200 / 768 (26 %)
0x20011610 idle
options: 0x1, priority: 15 timeout: 0
state: , entry: 0x8015079
stack size 320, unused 256, usage 64 / 320 (20 %)
uart:~$ kernel thread stacks
0x20010990 shell_uart (real size 2048): unused 1008 usage 1040 / 2048 (50 %)
0x20010d10 (real size 1024): unused 832 usage 192 / 1024 (18 %)
0x20010490 logging (real size 768): unused 568 usage 200 / 768 (26 %)
0x20011610 idle (real size 320): unused 256 usage 64 / 320 (20 %)
0x20015900 IRQ 00 (real size 2048): unused 1752 usage 296 / 2048 (14 %)
TCP/IP Network over Wi-Fi on the RPi Pico W or 2W
This project provides an extended board-specific configuration for the RPi Pico W or RPi Pico 2W with a pre-activated TCP/IP network stack via the Infineon 2.4GHz Wi-Fi chip.
For the RPi Pico W, also with Raspberry Pi Pico (BBE):
west build -b rpi_pico/rp2040/w -p -S usb-console -d build/helloshell-rpi_pico_w bridle/samples/helloshell west flash -r uf2 -d build/helloshell-rpi_pico_wwest build -b rpi_pico/rp2040/w/bbe -p -S usb-console -d build/helloshell-rpi_pico_w bridle/samples/helloshell west flash -r uf2 -d build/helloshell-rpi_pico_w
For the RPi Pico 2W, also with Raspberry Pi Pico 2 (BBE):
west build -b rpi_pico2/rp2350a/m33_0/w -p -S usb-console -d build/helloshell-rpi_pico2_w bridle/samples/helloshell west flash -r uf2 -d build/helloshell-rpi_pico2_wwest build -b rpi_pico2/rp2350a/m33_0/w/bbe -p -S usb-console -d build/helloshell-rpi_pico2_w bridle/samples/helloshell west flash -r uf2 -d build/helloshell-rpi_pico2_w
You should see the following message on the console (e.g. on RPi Pico W):
[3440] WLAN MAC Address : 29:F7:28:FC:67:1C [3443] WLAN Firmware : wl0: Jun 5 2024 06:33:59 version 7.95.88 (cf1d613 CY) FWID 01-7b7cf51a [3447] WLAN CLM : API: 12.2 Data: 9.10.39 Compiler: 1.29.4 ClmImport: 1.36.3 Creation: 2024-04-16 21:20:55 [3447] WHD VERSION : 3.3.3.26653 [3447] : WIFI5-v3.3.3 [3447] : GCC 14.3 [3447] : 2025-04-14 03:18:50 +0000 *** Booting Zephyr OS build v4.5.0…*** Hello World! I'm THE SHELL from rpi_pico [00:00:03.473,000] <inf> net_config: Initializing network [00:00:03.473,000] <inf> net_config: Waiting interface 1 (0x200014e8) to be up...
Simple test execution on target
(text in bold is a command input)
Network connect over Wi-Fi chip with system date before and after
uart:~$ date get 1970-01-01 00:00:29 UTCReplace the values <key_management>, <SSID> and <passphrase> with your own, e.g. -k 1 for WPA2-PSK! Use the command wifi connect without parameters to see online help with more details.
uart:~$ wifi connect -s <SSID> -k <key_management> -p <passphrase> Connected Connection requested [00:00:13.732,000] <inf> net_config: Interface 1 (0x200014e8) coming up [00:00:13.733,000] <inf> net_config: Running dhcpv4 client... [00:00:13.733,000] <inf> net_config: Running dhcpv6 client... [00:00:13.831,000] <inf> net_dhcpv4: Received: 192.168.10.197 [00:00:13.832,000] <inf> net_config: IPv4 address: 192.168.10.197 [00:00:13.832,000] <inf> net_config: Lease time: 28800 seconds [00:00:13.833,000] <inf> net_config: Subnet: 255.255.255.0 [00:00:13.833,000] <inf> net_config: Router: 192.168.10.1 [00:00:13.854,000] <inf> net_config: IPv6 address: fe80::2acd:c1ff:fe02:74ea [00:00:14.040,000] <inf> net_config: IPv6 address: fd9c:33d7:ba99:0:2acd:c1ff:fe02:74ea [00:00:21.470,000] <inf> net_dhcpv6: TID mismatch [00:00:21.472,000] <inf> net_dhcpv6: TID mismatch [00:00:21.496,000] <err> net_dhcpv6: Failed to configure DHCPv6 addressuart:~$ date get 2026-07-16 20:46:28 UTCuart:~$ net iface Default interface: 1 Interface wlan0 (0x200014e8) (WiFi) [1] =============================== Link addr : 29:F7:28:FC:67:1C MTU : 1500 Flags : AUTO_START,IPv4,IPv6 Device : airoc-wifi@0 (0x10053148) Status : oper=UP, admin=UP, carrier=ON Ethernet capabilities supported: MAC address filtering Ethernet PHY device: <none> (0) IPv6 unicast addresses (max 2): fe80::2acd:c1ff:fe02:74f4 autoconf preferred infinite fd9c:33d7:ba99:0:2acd:c1ff:fe02:74f4 autoconf preferred infinite IPv6 multicast addresses (max 3): ff02::1 ff02::1:ff02:74f4 IPv6 prefixes (max 2): fd9c:33d7:ba99::/64 infinite IPv6 hop limit : 64 IPv6 base reachable time : 30000 IPv6 reachable time : 20783 IPv6 retransmit timer : 0 DHCPv6 state : disabled IPv4 unicast addresses (max 1): 192.168.10.197/255.255.255.0 DHCP preferred IPv4 multicast addresses (max 2): 224.0.0.1 IPv4 gateway : 192.168.10.1 DHCPv4 lease time : 28800 DHCPv4 renew time : 14400 DHCPv4 server : 192.168.10.10 DHCPv4 requested : 192.168.10.197 DHCPv4 state : bound DHCPv4 attempts : 1 DHCPv4 state : boundDNS server list and name lookup query
uart:~$ net dns DNS servers: 192.168.10.10:53 via wlan0 (DHCP) 192.168.10.20:53 via wlan0 (DHCP) [fd9c:33d7:ba99::1]:53 via wlan0 (IPv6 RA) Pending queries:uart:~$ net dns query google.com Query for 'google.com' sent. dns: 142.250.154.138 dns: 142.250.154.102 dns: 142.250.154.113 dns: 142.250.154.101 dns: 142.250.154.139 dns: 142.250.154.100 dns: All results receivedICMP/Ping check in WAN and LAN
uart:~$ net ping -p 0 -c 1 8.8.8.8 PING 8.8.8.8 28 bytes from 8.8.8.8 to 192.168.10.197: icmp_seq=1 ttl=118 time=25 msuart:~$ net ping -p 0 -c 1 192.168.10.1 PING 192.168.10.1 28 bytes from 192.168.10.1 to 192.168.10.197: icmp_seq=1 ttl=64 time=9 msuart:~$ net ping -p 0 -c 1 fd9c:33d7:ba99::1 PING fd9c:33d7:ba99::1 8 bytes from fd9c:33d7:ba99::1 to fd9c:33d7:ba99:0:2acd:c1ff:fe02:74f4: icmp_seq=1 ttl=64 time=15 msARP list, list of connections, and interface statistics
uart:~$ net arp Interface Link Address [ 0] 1 BC:EE:7B:32:E5:D0 192.168.10.1 [ 1] 1 00:80:77:84:BF:81 192.168.10.10uart:~$ net conn Context Iface Flags Local Remote [ 1] 0x20005c8c 1 4DU 0.0.0.0:42759 0.0.0.0:0 [ 2] 0x20005d3c 1 4DU 0.0.0.0:38313 0.0.0.0:0 [ 3] 0x20005dec 1 6DU [::]:38774 [::]:0 Handler Callback Proto Local Remote [ 1] 0x20006510 0x10024b79 UDP [::]:38774 [::]:0 [ 2] 0x200065a0 0x10024b79 UDP 0.0.0.0:38313 0.0.0.0:0 [ 3] 0x20006558 0x10024b79 UDP 0.0.0.0:42759 0.0.0.0:0 [ 4] 0x200065e8 0x10030165 UDP [::]:546 [::]:0 [ 5] 0x20006630 0x100310d9 UDP 0.0.0.0:68 0.0.0.0:0 TCP Context Src port Dst port Send-Seq Send-Ack MSS State No TCP connections Set CONFIG_NET_TCP_LOG_LEVEL_DBG to enable TCP debugging support.uart:~$ net stats Interface 0x200014e8 (WiFi) [1] =============================== IPv6 recv 34 sent 38 drop 3 forwarded 0 IPv6 ND recv 21 sent 22 drop 1 IPv6 MLD recv 0 sent 2 drop 0 IPv4 recv 40 sent 39 drop 2 forwarded 0 IP vhlerr 49 hblener 0 lblener 0 IP fragerr 0 chkerr 0 protoer 49 ICMP recv 61 sent 64 drop 0 ICMP typeer 0 chkerr 0 IGMP recv 0 sent 0 drop 0 UDP recv 8 sent 8 drop 5 UDP chkerr 0 TCP bytes recv 0 sent 0 resent 0 TCP seg recv 0 sent 0 drop 0 TCP seg resent 0 chkerr 0 ackerr 0 TCP seg rsterr 0 rst 0 TCP conn drop 0 connrst 0 TCP pkt drop 0 DNS recv 3 sent 4 drop 1 Bytes received 42752 Bytes sent 6278 Processing err 11Wi-Fi interface statistics and SSID scan
uart:~$ wifi statistics Statistics for Wi-Fi interface 0x200014e8 [1] Bytes received : 45148 Bytes sent : 6622 Packets received : 163 Packets sent : 96 Receive errors : 0 Send errors : 0 Bcast received : 0 Bcast sent : 0 Mcast received : 0 Mcast sent : 0 Beacons received : 0 Beacons missed : 0 Unicast received : 0 Unicast sent : 0 Overrun count : 0uart:~$ wifi status Status: successful ================== State: COMPLETED Interface Mode: STATION Link Mode: WIFI 4 (802.11n/HT) SSID: <SSID> BSSID: 13:E1:30:36:C8:2F Band: 2.4GHz Channel: 1 Security: WPA2-PSK MFP: Disable RSSI: -57 Beacon Interval: 100 DTIM: 2 TWT: Not supported Current PHY TX rate (Mbps) : 144.0uart:~$ wifi scan Scan requested Num | SSID (len) | Chan (Band) | RSSI | Security | BSSID | MFP 1 | FRITZ!Box 7490 MK 17 | 1 (2.4GHz) | -80 | WPA2-PSK | F0:B0:14:BA:EE:C7 | Disable 2 | WLAN-985778 11 | 6 (2.4GHz) | -80 | WPA2-PSK | BC:30:D9:47:0A:F8 | Disable 3 | PYUR-X852J6 11 | 6 (2.4GHz) | -86 | WPA/WPA2/WPA3 PSK | A0:3C:20:34:0C:F5 | Disable 4 | MagentaWLAN-YR3U 16 | 6 (2.4GHz) | -80 | WPA/WPA2/WPA3 PSK | 4C:22:F3:60:E6:CE | Disable 5 | Fallschirm Gast 15 | 7 (2.4GHz) | -76 | WPA2-PSK | 4A:5D:35:6C:F9:CF | Disable 6 | Fallschirm 10 | 7 (2.4GHz) | -75 | WPA2-PSK | 48:5D:35:6C:F9:CF | Disable 7 | o2-WLAN65 9 | 10 (2.4GHz) | -93 | WPA2-PSK | 4C:1B:86:29:D8:B1 | Disable 8 | FRITZ!Box 7430 SH 17 | 11 (2.4GHz) | -81 | WPA2-PSK | F0:B0:14:28:E2:AF | Disable 9 | FRITZ!Box 7430 SH 17 | 11 (2.4GHz) | -81 | WPA2-PSK | F0:B0:14:28:E2:AF | Disable Scan request done