espressif / openocd-esp32

OpenOCD branch with ESP32 JTAG support
Other
361 stars 132 forks source link

Add general support for CH347 based interfaces and configurations for EasyDevKits interfaces (OCD-839) #298

Closed EasyDevKits closed 1 year ago

EasyDevKits commented 1 year ago

Description

I found that in the openocd-esp32 repositiory is no support for CH347 based JTAG adapters. A WCH CH347 chip in mode 3 has one UART and one JTAG interface. Like an FTDI FT2232 chip, you can use the CH347 chip for UART and JTAG. With this change I add support for CH347 based JTAG adapters. I also add configuration files for the upcoming EasyDevKits JTAG adapters.

Maybe a documentation update is needed to state that now also CH347 based adapters are supported.

Type of change

User Impact

Now you can JTAG debug ESP32 chips with CH347 base JTAG adapters.

Performance Impact

I changed the timeout in esp_xtensa_reset_reason_read in file src/target/espressif/esp_xtensa.c from 100ms to 200ms because it was not working for the CH347 with 100ms timeout. Other parts are unchanged. Only the new driver added.

How Has This Been Tested?

Hardware Configuration:

Software Configuration:

Checklist:

erhankur commented 1 year ago

@EasyDevKits Thank you for creating the PR and putting in the hard work to make this driver compatible with our chips. Since the PR is not directly related to our chips, unfortunately, this isn't the right approach to merge it into our fork. Please consider creating a patch for the official mainline first. No worries, we will be cherry-picking that commit once it is merged.

erhankur commented 1 year ago

And I suggest to divide the patches into 2 parts. 1 - Just for CH347 driver -->to the mainline 2 - Once it is merged, Espressif fixes to make it compatible with CH347 --> to our fork. Because we haven't upstreamed all features yet.