Makerfabs / ESP32-S3-Parallel-TFT-with-Touch-4.3inch

ESP32-S3 Parallel TFT with Touch 4.3inch
29 stars 10 forks source link

Add debugging to the guide #5

Closed zingo closed 9 months ago

zingo commented 1 year ago

It would be nice to add a guide on the README.md or other place on how to setup debugging via the onboard USB-JTAG stuff added in ESP32-S3 preferable with PlatformIO or any other means. Been struggling with this for a few hours now without to much luck :)

GroundLevel1 commented 1 year ago

Hello Debugging tools are great in assistance of programing errors/issues, they will always be welcomed.

Bryan H

On Thu, May 4, 2023 at 6:53 AM Zingo Andersen @.***> wrote:

It would be nice to add a guide on the README.md or other place on how to setup debugging via the onboard USB-JTAG stuff added in ESP32-S3 preferable with PlatformIO or any other means. Been struggling with this for a few hours now without to much luck :)

— Reply to this email directly, view it on GitHub https://github.com/Makerfabs/ESP32-S3-Parallel-TFT-with-Touch-4.3inch/issues/5, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQZPPRFWHNNOECQALRXNRZDXEOKC7ANCNFSM6AAAAAAXVVUGTU . You are receiving this because you are subscribed to this thread.Message ID: @.*** com>

zingo commented 1 year ago

Experiemented some more it seem to show up on the USB-NATIVE connection if you press RST and FLASH at the same time.

` zingo@zingodatan:~$ lsusb ... Bus 002 Device 016: ID 303a:1001 Espressif USB JTAG/serial debug unit ...

zingo@zingodatan:~$ openocd -f board/esp32s3-builtin.cfg Open On-Chip Debugger v0.11.0-esp32-20221026 (2022-10-26-14:47) Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html Info : only one transport option; autoselect 'jtag' Info : esp_usb_jtag: VID set to 0x303a and PID to 0x1001 Info : esp_usb_jtag: capabilities descriptor set to 0x2000 Warn : Transport "jtag" was already selected Info : Listening on port 6666 for tcl connections Info : Listening on port 4444 for telnet connections Info : esp_usb_jtag: serial (34:85:18:98:52:3C) Info : esp_usb_jtag: Device found. Base speed 40000KHz, div range 1 to 255 Info : clock speed 40000 kHz Info : JTAG tap: esp32s3.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1) Info : JTAG tap: esp32s3.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1) Error: [esp32s3.cpu1] Unexpected OCD_ID = 00000000 Warn : target esp32s3.cpu1 examination failed Info : starting gdb server for esp32s3.cpu0 on 3333 Info : Listening on port 3333 for gdb connections Info : [esp32s3.cpu0] Debug controller was reset. Info : [esp32s3.cpu0] Core was reset. Info : [esp32s3.cpu0] Target halted, PC=0x40041A76, debug_reason=00000000 Info : [esp32s3.cpu0] Reset cause (1) - (Power on reset) Error: [esp32s3.cpu1] Unexpected OCD_ID = 00000000 Error: [esp32s3.cpu1] Unexpected OCD_ID = 00000000 Error: [esp32s3.cpu1] Unexpected OCD_ID = 00000000 Error: [esp32s3.cpu1] Unexpected OCD_ID = 00000000 Error: [esp32s3.cpu1] Unexpected OCD_ID = 00000000

`

zingo commented 9 months ago

started to play with this again, got some more to work:

  1. Setup platformIO
platform = espressif32
board = esp32s3box
;board = esp32-s3-devkitc-1
board_build.filesystem = littlefs
;board_build.mcu = esp32s3
;board_build.f_cpu = 240000000L
framework = arduino
build_type = debug
debug_tool = esp-builtin
debug_init_break = tbreak initRaceDB
;upload_protocol = esp-builtin
upload_protocol = esptool
upload_speed = 921600
  1. Experiemented some more it seem to show up on the USB-NATIVE connection if you press RST and FLASH at the same time.

  2. in PlatformIO go to debug and select "PIO Debug" check that it connects ok in "DEBUG CONSOLE"

  3. Press "RST" button, it seem to restart and contnue to the code and stop there

I had a breakpoint at start of setup() and it seem to get stuck there so this is not 100% working but seem to be roughtly the way to go :)

zingo commented 9 months ago

It seem to work as it should with the settings above move code probed different deb boards by checking if there was a i2c touch controller on pin 19,20 this is the same pins as USB-Native uses so if this code had executed it didn't work so the error was on my side. It works with the the platformIO setting above it you don't touch pin 19,20 I close this. Sorry for the bad bugreport