Development/debugging tool for ESP32

Hello,
Here is a shell for ESP32 cpu: GitHub - vvb333007/espshell: Command line interface debug tool for Arduino projects on ESP32 hardware
Single .c file which can be placed to the directory where your .ino script is to add interactive shell (CLI) to your sketch. No modification to the sketch is needed: the espshell.c will gain control automatically.

A library, which hooks up on a startup process and gains control at the very beginning to start a CLI on serial interface.

Once uploaded it creates a command line interface on UART0 which can be accessed either via Arduino IDE Serial Monitor or, much better, via terminal software (PuTTY, TeraTerm etc)

Tried to mimic Cisco's CLI look & feel :slight_smile:

There is README.md file with a little bit more details and examples.

If anyone will find it useful - i would like to get a feedback.
Enjoy!

Commands:

i2c scanning / reading / writing :

Sequence generation (using RMT pereipherial)

2 Likes

We are progressing :slight_smile: for last few months a few updates were made:

  1. filesystem support (flash and SD (over SPI)) , FAT, LittleFS and SPIFFS


  2. Sketch variables support (accessing sketch variables from the shell)


  3. Frequency meters / Pulse counters (up to 8 on ESP32 or up to 4 on S3)

  4. Commands can be executed in background by adding "&" at the end of the command line (just like in linux/bash)

  5. Context help hotkey ("?")

  6. Ctrl+C pauses sketch execution (can be resumed with command "resume")

  7. Sketch variables can be registered so they become available for the shell commands:

Too many changes to list them all. File size grew to 300kb and then I decided to split it and make a library. So I did :). It is now available through Arduino IDE Library Manager, search for "ESPShell".

It works on generic ESP32 boards, ESP32-S3 boards and ESP-CAM as well. It would be good to know if it compiles/works on other Espressif MCUs.

ESPShell expects "Serial" to be of class "HardwareSerial" . No USB-CDC console support yet :-/

Yes, finally added support for Hardware CDC boards.

1 Like

Documentation, alpha version :slight_smile:

How many tasks do you need to run the shell? Not so many: IDLE0 and IDLE1

How about adding some sort of identifier to the prompt in case we want to work with 2 or more at a time. Maybe chipid?

1 Like

Is it possible to display task info?

Technically, yes, however it is not so much of useful info there: stack pointers, ticks etc. So I decided just to display task address (handle), its priority and name.

Yes I think I would add ability to change default “esp32“ in the prompt to user-defined prompt.

Messy screenshot.

Creating “rising“ and “falling“ conditions and actions. Creating periodic events.

Started a doc for this feature, Aliases and Events : creating and executing shell scripts but it is far from being finished :D. Writing documentation is harder than writing code.

Like this? HighWM == High Water Mark. The close it to zero, the higher chances to see Guru Meditating

IO MUX.

It is all configurable, I mean, every GPIO can be reassigned to any IOMUX or GPIO matrix function. For GPIO matrix one can connect IN/OUT signals also. Virtual pins (constant 1 and constant 0 are also supported :). to some extent)

Like this?

Looks good, but I was hoping the board id/name could be stored on the board.
Let me try to explain better.
I am assuming what I am seeing is from a sketch that somehow stays resident or a new bootloader.
When that ^^ is created/uploaded an identifier is assigned although I don;t understand why ChipID can't be used somehow.
The utility of this is when I have a handful of boards in a drawer, I hook up the board and the first prompt from the board (and all others) is prefaced with the unique ID so I know I have the board with the XYZ sketch loaded.
Am I clear?

1 Like

I will think on how to do it better :). I got you. May be EEPROM emulation area on the flash is good place to store ESPShell settings.

Consider that a user of your tool may inadvertently overwrite that area. Maybe also look at the partition feature?
I looked at the chip ID and it only uses the low-order 31 bits and is therefore not unique.

at the end of “nvs“ area.

accessing user partitions, storing files there is not good.

having a separate partition just for the library is too much. let it be last 64 bytes of NVS

1 Like