Xinyuan-LilyGO / T-Display-S3

MIT License
731 stars 173 forks source link

Use debugger in PlatformIO IDE over USB (no hardware needed) using openocd #210

Closed wsiok closed 2 months ago

wsiok commented 6 months ago

Please, use the following diff to enable debugger support in PlatformIO using openocd: In boards/lilygo-t-displays3.json replace existing openocd_target with: openocd_board": "esp32s3-builtin.cfg

In platformio.ini add in [env]:

debug_tool = esp-builtin
upload_protocol = esp-builtin

If the GSB single-stepping/breakpoint doesn't work because software breakpoint cannot be written (code executed from FLASH), then in the debugger console mark the code memory as read-only, for example: mem 0x40000000 0x4fffffff ro

Without these changes the openocd is run with incorrect interface and there are error messages about invalid command espusbjtag.

diff --git a/boards/lilygo-t-displays3.json b/boards/lilygo-t-displays3.json
index b840211..ab9ad67 100644
--- a/boards/lilygo-t-displays3.json
+++ b/boards/lilygo-t-displays3.json
@@ -26,7 +26,7 @@
     "bluetooth"
   ],
   "debug": {
-    "openocd_target": "esp32s3.cfg"
+    "openocd_target": "esp32s3-builtin.cfg"
   },
   "frameworks": [
     "arduino",
@@ -42,4 +42,4 @@
   },
   "url": "https://www.lilygo.cc/products/t-display-s3",
   "vendor": "LILYGO"
-}
\ No newline at end of file
+}
diff --git a/platformio.ini b/platformio.ini
index de7e99e..190dc2f 100644
--- a/platformio.ini
+++ b/platformio.ini
@@ -35,6 +35,8 @@ platform = espressif32
 board = lilygo-t-displays3
 framework = arduino
 ; extra_scripts =  ./script/pos_extra_script.py
+debug_tool = esp-builtin
+upload_protocol = esp-builtin

 build_flags = 
     -DLV_LVGL_H_INCLUDE_SIMPLE
lewisxhe commented 3 months ago

It has been updated, you can check it out

github-actions[bot] commented 2 months ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 2 months ago

This issue was closed because it has been inactive for 14 days since being marked as stale.