JTAG Debugging with the ESP32 – Copyright Pete Gallagher 2020 – @Pete_Codes
JTAG Debugging
with the ESP32
PETE GALLAGHER
PJGCREATIONS.CO.UK
22/06/2020
JTAG Debugging with the ESP32 – Copyright Pete Gallagher 2020 – @Pete_Codes
About Me
Pete Gallagher
@pete_codes / @PJGCreations
www.PeteCodes.co.uk
www.PJGCreations.co.uk
Pete@PJGCreations.co.uk
IT Consultant, Microsoft Azure MVP, Pluralsight Author,
Decades of Desktop, Web & Embedded Software experience,
Meetup Organiser,
STEM Ambassador, Code Club Organiser … Gadget Addict
Father of two inquisitive girls
JTAG Debugging with the ESP32 – Copyright Pete Gallagher 2020 – @Pete_Codes
What we’re going to be doing…
 The ESP32
 JTAG Hardware Debuggers
 Connecting the Espressif ESP-PROG
JTAG Debugger
 A Simple ESP32 App using Arduino IDE
 VisualMicro for VS2019
 PlatformIO for VS Code
 Debugging a Simple ESP32 App
 Q&A
JTAG Debugging with the ESP32 – Copyright Pete Gallagher 2020 – @Pete_Codes
The ESP32 DevKit
JTAG Debugging with the ESP32 – Copyright Pete Gallagher 2020 – @Pete_Codes
The ESP32 DevKit - Blocks
WiFi + BLE
ESP-WROOM-32
Microcontroller
Micro USB +
Virtual Serial Port
Built in LED
GPIO
JTAG Debugging with the ESP32 – Copyright Pete Gallagher 2020 – @Pete_Codes
The ESP32 DevKit - Specs
 Cheap - £7ish
 Dual Core ESP32 WROOM32 Microcontroller
 Clocked up to 240MHz
 4MB Flash (Program Memory)
 512K RAM
 RTC + 8K RAM
 512 Byte EEPROM
 2.4GHz Wifi
 Bluetooth and BLE
 GPIO inc SPI, UART, I2C, PWM, DAC Etc
JTAG Debugging with the ESP32 – Copyright Pete Gallagher 2020 – @Pete_Codes
The ESP32 Kit - Pinout
Enable
GPIO36
GPIO39
GPIO34
GPIO35
GPIO32
GPIO33
GPIO25
GPIO26
GPIO27
GPIO14
GPIO12
GPIO13
GND
VIN
GPIO23
GPIO22
GPIO1
GPIO3
GPIO21
GPIO19
GPIO18
GPIO5
GPIO17
GPIO16
GPIO4
GPIO2
GPIO15
GND
3v3
UART1 TX
UART1 RX
UART 2 TX
UART2 TX
SPI1 MOSI
I2C SCL
I2C SDA
SPI1 MISO
SPI1 CLK
SPI1 CS0
SPI2 MOSI
SPI2 MISO
SPI2 CLK
ADC 1+2
JTAG Debugging with the ESP32 – Copyright Pete Gallagher 2020 – @Pete_Codes
The JTAG Debugger
JTAG Debugging with the ESP32 – Copyright Pete Gallagher 2020 – @Pete_Codes
The JTAG Debugger
 Joint Test Action Group
 Direct Access to System Address and Data Bus
 Can read and write variable values
 Set break points and step through code
 Uses Serial Communication
 Connects to the Test Access Port (TAP)
 USB Connection to PC
 Uses OpenOCD to control
 Dupont connection to ESP32 DevKit
https://www.xjtag.com/about-jtag/jtag-a-technical-overview/
JTAG Debugging with the ESP32 – Copyright Pete Gallagher 2020 – @Pete_Codes
Connecting the JTAG Debugger
GND
TDI
TDO
TCK
TMS
3v3
JTAG Debugging with the ESP32 – Copyright Pete Gallagher 2020 – @Pete_Codes
Connecting the JTAG Debugger
TCK
TDI
TMS
TDO
GND
3V3
JTAG Debugging with the ESP32 – Copyright Pete Gallagher 2020 – @Pete_Codes
A Simple App
JTAG Debugging with the ESP32 – Copyright Pete Gallagher 2020 – @Pete_Codes
Visual Micro
JTAG Debugging with the ESP32 – Copyright Pete Gallagher 2020 – @Pete_Codes
Visual Micro
 Serial debugging
 Hardware debugging
 Supports hundreds of boards
 VS2017/2019 Extension
 Set breakpoints
 View variable values
 Free
https://www.visualmicro.com
JTAG Debugging with the ESP32 – Copyright Pete Gallagher 2020 – @Pete_Codes
PlatformIO
JTAG Debugging with the ESP32 – Copyright Pete Gallagher 2020 – @Pete_Codes
PlatformIO
 Hardware debugging
 Supports hundreds of boards
 Visual Studio Code Extension
 Set breakpoints
 View variable values
 Free
https://www.platformio.org
JTAG Debugging with the ESP32 – Copyright Pete Gallagher 2020 – @Pete_Codes
Links
 Arduino IDE
https://www.arduino.cc/en/main/software
 ESP32 DevKit
https://www.amazon.co.uk/SeeKool-Development-Microcontroller-Integrated-
Compatible/dp/B07DPP3BGZ/
 Espressif ESP-PROG
https://www.digikey.co.uk/product-detail/en/espressif-systems/ESP-PROG/1965-ESP-
PROG-ND/10259352
 Visual Micro
https://www.visualmicro.com/
 PlatformIO
https://platformio.org/
 JTAG Information
https://www.xjtag.com/about-jtag/jtag-a-technical-overview/
JTAG Debugging with the ESP32 – Copyright Pete Gallagher 2020 – @Pete_Codes
 Twitter
@pete_codes / @PJGCreations
 Email:
pete@pjgcreations.co.uk
 Website:
https://www.petecodes.co.uk
https://www.pjgcreations.co.uk
 Notts IoT:
https://www.nottsiot.co.uk
 Dot Net Notts:
https://www.dotnetnotts.co
 Notts Dev Workshop:
https://www.nottsdevworkshop.co.uk
 LATi:
https://www.lati.org.uk
 Agile Engineering Podcast:
https://agileengineeringpodcast.com/
Contact Me
Slides:
http://bit.ly/pjgesp32jtagtwitch
JTAG Debugging with the ESP32 – Copyright Pete Gallagher 2020 – @Pete_Codes
Questions?
Pete Gallagher
@pete_codes / @PJGCreations
www.PeteCodes.co.uk
www.PJGCreations.co.uk
Pete@PJGCreations.co.uk

JTAG Debugging with the ESP32, Visual Micro and PlatformIO

  • 1.
    JTAG Debugging withthe ESP32 – Copyright Pete Gallagher 2020 – @Pete_Codes JTAG Debugging with the ESP32 PETE GALLAGHER PJGCREATIONS.CO.UK 22/06/2020
  • 2.
    JTAG Debugging withthe ESP32 – Copyright Pete Gallagher 2020 – @Pete_Codes About Me Pete Gallagher @pete_codes / @PJGCreations www.PeteCodes.co.uk www.PJGCreations.co.uk Pete@PJGCreations.co.uk IT Consultant, Microsoft Azure MVP, Pluralsight Author, Decades of Desktop, Web & Embedded Software experience, Meetup Organiser, STEM Ambassador, Code Club Organiser … Gadget Addict Father of two inquisitive girls
  • 3.
    JTAG Debugging withthe ESP32 – Copyright Pete Gallagher 2020 – @Pete_Codes What we’re going to be doing…  The ESP32  JTAG Hardware Debuggers  Connecting the Espressif ESP-PROG JTAG Debugger  A Simple ESP32 App using Arduino IDE  VisualMicro for VS2019  PlatformIO for VS Code  Debugging a Simple ESP32 App  Q&A
  • 4.
    JTAG Debugging withthe ESP32 – Copyright Pete Gallagher 2020 – @Pete_Codes The ESP32 DevKit
  • 5.
    JTAG Debugging withthe ESP32 – Copyright Pete Gallagher 2020 – @Pete_Codes The ESP32 DevKit - Blocks WiFi + BLE ESP-WROOM-32 Microcontroller Micro USB + Virtual Serial Port Built in LED GPIO
  • 6.
    JTAG Debugging withthe ESP32 – Copyright Pete Gallagher 2020 – @Pete_Codes The ESP32 DevKit - Specs  Cheap - £7ish  Dual Core ESP32 WROOM32 Microcontroller  Clocked up to 240MHz  4MB Flash (Program Memory)  512K RAM  RTC + 8K RAM  512 Byte EEPROM  2.4GHz Wifi  Bluetooth and BLE  GPIO inc SPI, UART, I2C, PWM, DAC Etc
  • 7.
    JTAG Debugging withthe ESP32 – Copyright Pete Gallagher 2020 – @Pete_Codes The ESP32 Kit - Pinout Enable GPIO36 GPIO39 GPIO34 GPIO35 GPIO32 GPIO33 GPIO25 GPIO26 GPIO27 GPIO14 GPIO12 GPIO13 GND VIN GPIO23 GPIO22 GPIO1 GPIO3 GPIO21 GPIO19 GPIO18 GPIO5 GPIO17 GPIO16 GPIO4 GPIO2 GPIO15 GND 3v3 UART1 TX UART1 RX UART 2 TX UART2 TX SPI1 MOSI I2C SCL I2C SDA SPI1 MISO SPI1 CLK SPI1 CS0 SPI2 MOSI SPI2 MISO SPI2 CLK ADC 1+2
  • 8.
    JTAG Debugging withthe ESP32 – Copyright Pete Gallagher 2020 – @Pete_Codes The JTAG Debugger
  • 9.
    JTAG Debugging withthe ESP32 – Copyright Pete Gallagher 2020 – @Pete_Codes The JTAG Debugger  Joint Test Action Group  Direct Access to System Address and Data Bus  Can read and write variable values  Set break points and step through code  Uses Serial Communication  Connects to the Test Access Port (TAP)  USB Connection to PC  Uses OpenOCD to control  Dupont connection to ESP32 DevKit https://www.xjtag.com/about-jtag/jtag-a-technical-overview/
  • 10.
    JTAG Debugging withthe ESP32 – Copyright Pete Gallagher 2020 – @Pete_Codes Connecting the JTAG Debugger GND TDI TDO TCK TMS 3v3
  • 11.
    JTAG Debugging withthe ESP32 – Copyright Pete Gallagher 2020 – @Pete_Codes Connecting the JTAG Debugger TCK TDI TMS TDO GND 3V3
  • 12.
    JTAG Debugging withthe ESP32 – Copyright Pete Gallagher 2020 – @Pete_Codes A Simple App
  • 13.
    JTAG Debugging withthe ESP32 – Copyright Pete Gallagher 2020 – @Pete_Codes Visual Micro
  • 14.
    JTAG Debugging withthe ESP32 – Copyright Pete Gallagher 2020 – @Pete_Codes Visual Micro  Serial debugging  Hardware debugging  Supports hundreds of boards  VS2017/2019 Extension  Set breakpoints  View variable values  Free https://www.visualmicro.com
  • 15.
    JTAG Debugging withthe ESP32 – Copyright Pete Gallagher 2020 – @Pete_Codes PlatformIO
  • 16.
    JTAG Debugging withthe ESP32 – Copyright Pete Gallagher 2020 – @Pete_Codes PlatformIO  Hardware debugging  Supports hundreds of boards  Visual Studio Code Extension  Set breakpoints  View variable values  Free https://www.platformio.org
  • 17.
    JTAG Debugging withthe ESP32 – Copyright Pete Gallagher 2020 – @Pete_Codes Links  Arduino IDE https://www.arduino.cc/en/main/software  ESP32 DevKit https://www.amazon.co.uk/SeeKool-Development-Microcontroller-Integrated- Compatible/dp/B07DPP3BGZ/  Espressif ESP-PROG https://www.digikey.co.uk/product-detail/en/espressif-systems/ESP-PROG/1965-ESP- PROG-ND/10259352  Visual Micro https://www.visualmicro.com/  PlatformIO https://platformio.org/  JTAG Information https://www.xjtag.com/about-jtag/jtag-a-technical-overview/
  • 18.
    JTAG Debugging withthe ESP32 – Copyright Pete Gallagher 2020 – @Pete_Codes  Twitter @pete_codes / @PJGCreations  Email: pete@pjgcreations.co.uk  Website: https://www.petecodes.co.uk https://www.pjgcreations.co.uk  Notts IoT: https://www.nottsiot.co.uk  Dot Net Notts: https://www.dotnetnotts.co  Notts Dev Workshop: https://www.nottsdevworkshop.co.uk  LATi: https://www.lati.org.uk  Agile Engineering Podcast: https://agileengineeringpodcast.com/ Contact Me Slides: http://bit.ly/pjgesp32jtagtwitch
  • 19.
    JTAG Debugging withthe ESP32 – Copyright Pete Gallagher 2020 – @Pete_Codes Questions? Pete Gallagher @pete_codes / @PJGCreations www.PeteCodes.co.uk www.PJGCreations.co.uk Pete@PJGCreations.co.uk