ESP32

This page gives an overview of the ESP32 microcontroller present on Tangara's mainboard. This is the main application processor for the device.

Pinouts

The KiCad schematic is the source of truth for how the ESP32 is implemented on the mainboard PCB.

The ESP32's flexible pin muxing makes it difficult to describe how its peripherals are configured without duplicating most of the pinout, but the very short version is:

The short version is:

PeripheralFunction
VSPISPI (to display and SD card)
I2C0I2C
I2S0To DAC
UART0To SAMD21
UART1Unused, but routed to the JTAG header

Flashing

With the SAMD21 operating as a USB to UART bridge, standard ESP flashing and debugging tools should work without issue.

For example, to flash a new build using ESP-IDF's build tool:

idf.py flash -p /dev/serial/by-id/usb-cool_tech_zone_Tangara_* -b 1000000
  • -p specifies the serial port to use. If you're using a Linux distribution with Systemd, the port in the command above should work fine. On other *nixes, you may need to specify one of the /dev/tty devices. If you omit this option, idf.py will search through your serial ports until it finds something that looks like an ESP32, to varying success.

  • -b specifies the baud rate to be used for flashing. You can set this as high as 1500000, but in practice flashing at such a high speed will occasionally fail (FIXME)

ESP-IDF's build too also includes a help monitor command. e.g.

idf.py monitor -p /dev/serial/by-id/usb-cool_tech_zone_Tangara_*

This is similar to opening the port directly with a tool like screen or minicom, but with a few extra features:

  • A software reset can easily be triggered using CTRL+T followed by CTRL+R.
  • If the firmware running on the ESP32 matches what is in your build directory (i.e. you have just done a build+flash), then memory addresses corresponding to function locations will automatically be translated into their source file names and locations. This makes stack traces very easy to understand.

For instructions on working with Tangara's firmware in particular, refer to the instructions in the firmware repository.

App Console

Tangara's firmware includes an 'app console', available after boot on the USB serial port, that is very useful for development and debugging. The prompt looks roughly like this:

Type 'help' to get the list of commands.
Use UP/DOWN arrows to navigate through command history.
Press TAB when typing command name to auto-complete.

Sometimes the initial boot logging will clobber the initial prompt. Try hitting the enter key if you don't see the little arrow.