Apple Mac Setup
for ESP32 development on PlatformIO and using an ESP Debug Board with ESP-WROOM-32
The following two lines of code (one line is just a comment) in platformio.ini will make the big change:
;upload via esp-prog JTAG
upload_protocol = esp-prog
upload_port = /dev/cu.usbserial-3400
You find a sample here in the Test3 folder along with the classic blink Arduino asample.
Q: Do I need to switch away from the Arduino IDE and learn the Espressiv IDF?
A: Nope, you continue programming the used way like with the Arduino IDE. You will make use of the PIO (PlatformIO) integrated development environment and you can still use for instance the Sketch samples.
Q: I do not want to follow the simplified Arduino programming paradighm, but programming classic C/C++ style instead.
A: The choice is up to you! I was surprised the *.INO sketches are still possible to use, by simply adding the '#include arduino.h' statement in the header.
Q: How long does it take for an average programmer to switch from the Arduino IDE to PIO?
A: I'd say a day. - The only 'complicated' thing for me, was to find a way looking at the Serial Monitor. But even that unix device path I could simply copy and being guided by the PIO plugin. For Windows users it is just a matter of naming the relevant Com-Port mentioned by the Windows Device Manager.
Q: How many cables do I need to connect the ESP Debugging Board and the ESP32 target?
A: One cable only for programming and debugging.
If you want to look at the serial monitor (appreciated), a 2nd USB cable from your cross compile machine to the ESP32 board will be required.
Power and Ground connections are obvious, but pay attention on the voltage setting of the ESP-PROG board. I decided to power the ESP-VROOM-32 board with 5 volts on VIN. The voltage regulator will be active and also 5V sensors could be used with voltage dividers to protect ESP input gates.
JTAG ConnectionsESP-Prog | ESP-WROOM-32 | Location |
---|---|---|
TDI | IO12 | P4L (4th port from botton on the "L" left side) |
TMS | IO14 | P5L |
TCK | IO13 | P3L |
TDO | IO15 | P3R |
VJTAG | VIN | P1L |
GMD | GND | P2L |
Thanks to the following sources with helpful information about PlatformIO and debugging:
Dialedin from Australia: https://dialedin.com.au/blog/esp32-jtag-debugging-esp-prog
Harald Kreuzer from Vienna: https://www.haraldkreuzer.net/en/news/esp32-jtag-debugging-platformio-and-only-one-usb-connection
...and not to forget Rui and Sara from https://randomnerdtutorials.com where I got inspired to start again with embedded technology.