ESH(1)

NAME

eshUART based embedded shell for embedded systems. Intended to be used for learning, experimenting and diagnostics.

SYNOPSIS

$sudo apt install -y

INFO

363 stars
72 forks
0 views

DESCRIPTION

UART based embedded shell for embedded systems. Intended to be used for learning, experimenting and diagnostics.

README

Important disclaimer:

This is not an officially supported Google product

Embedded Shell

A Terminal like interface over UART.

  • Targeted at embedded systems engineers and researchers who want to explore the hardware by writing small functions that can be triggered from a shell like interface.
  • A UART based shell that enables finer control of CPU by allowing functions to be exposed as commands to be triggered from the prompt.
  • Low memory footprint of < 4kB

this is a perfect tool for getting up and running with a new board in less than 1 hour.

Features:

  • Low footprint shell implementation.
  • Commands with same foot print as int main(int argc, char* argv[]){}
  • Export function as command using a macro (ADD_CMD() available in shell.h).
  • Supported Languages: C, C++ and Assembly.
  • Automatic source file discovery
    • .c, .cpp and .S source files in the Project and shell directory are automatically picked for compilation (No need to modify any Makefile. The build system automatically figrues the source files).
  • Automatic Header discovery.
    • location for .h and .hpp files is automatically passed to the compiler for header file lookup.

Supported Processors/Architectures

examples/ implements a hello world example for the processor variety listed below:

ArchitectureProcessorExample LocationBoard
ARM v7 A-class 32 bitCortex-a7 (quadcore)examples/emulation/armv7A-32-Rpi2raspberry pi 2b (Emulated on Qemu)
ARM v8 A-class 32 bitCortex-a53examples/emulation/armv8A-32-RPi3braspberry pi 3b (Emulated on Qemu)
ARM v7 M-class 32 bitCortex-m3examples/emulation/armv7M-32mps2-an385 (Emulated on Qemu)
ARM v8 A-class 64 bitCortex-a72examples/emulation/armv8A-64virt (Emulated on Qemu)
ARM v8 A-class 64 bitCortex-a72 (quadcore)examples/emulation/armv8A-64-smp (multicore)virt (Emulated on Qemu)
ARM v8 M-class 32 bitCortex-m33 (dualcore)examples/emulation/armv8M-32 (multicore)mps3-an524 (Emulated on Qemu)
RISC-V 64 bitrv64gexamples/emulation/riscv-64virt (Emulated on Qemu)
RISC-V 32 bit (RV32IMAC)SiFive E31examples/physical/hifivehifive1-revb (Physical Board)
ARM v7 M-class 32 bitCortex-m4examples/physical/nucleo-f401renucleo-f401re (Physical Board)
ARM v7 M-class 32 bitCortex-m4examples/physical/tiva-ctiva-c (Physical Board)

Quick Setup

Execute ./manage -s or .scripts/setup to install all the dependencies.

Quick Demo

Following is a run of example in examples/emulation/riscv-64

cd examples/emulation/riscv-64
make
make run

Qemu Demo

If you haven't done the Quick Setup as noted above, you'll need to install following utilities:

sudo apt install -y binutils make binutils-riscv64-linux-gnu gcc-riscv64-linux-gnu g++-riscv64-linux-gnu \
                    qemu-system-riscv64

wget -P ~ https://git.io/.gdbinit

pip3 install pygments

Further, gdb based debugging can also be done by running the following commands in two separate terminals:

make debug

and

make gdb

Qemu Debug

You should see similar output as in above visual.

Documentation

  • To be able to run all the example and create your own project follow the documentation in docs/.
  • It also provides details about the internal workings of shell and how to setup your own project.

Table of contents

TopicDescription
How shell WorksExplains the working of shell with a flowchart.
Running examples in example/Guides on getting started with trying examples. Includes topics like -
- installing dependences
- qemu based targets
- physical board based targets
- debugging etc
Setting up new projectDetails on how to start setting up a new project.
Platform initialization and uart driverDetails the implementation of the platform_init() and the relation to the uart driver.
Uart driverDescribes implementation and constraint on the uart driver.
User Linker ScriptsGuides on how a liner script should be written if the user wants to manually set the memory layout and do the code placement.

Contributing

TopicDescription
Code of ConductGuides on the conduct expected while making contributions.
ContributingGuidelines on how to contribute to the code on GitHub.

Source Code Headers

Every file containing source code must include copyright and license information. This is to help well-intentioned people avoid accidental copying that doesn't comply with the license.

Apache header:

Copyright 2021 Google LLC

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

SEE ALSO

clihub3/9/2026ESH(1)