- Open On-Chip Debugger v0.10.0-esp32-20200709 (2020-07-09-08:54)
- Licensed under GNU GPL v2
- For bug reports, read
- http://openocd.org/doc/doxygen/bugs.html
- debug_level: 2
- adapter speed: 10000 kHz
- Info : J-Link V10 compiled Mar 7 2019 15:19:19
- Info : Hardware version: 10.10
- Info : VTarget = 3.328 V
- Info : clock speed 10000 kHz
- Info : JTAG tap: esp32s2.cpu tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
- Info : esp32s2: Target halted, PC=0x40000400, debug_reason=00000001
- Info : Detected ESP32-S2 chip
- Info : Listening on port 3333 for gdb connections
- Info : JTAG tap: esp32s2.cpu tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
- Info : esp32s2: Target halted, PC=0x400003C3, debug_reason=00000000
- Info : esp32s2: Core 0 was reset.
- Info : esp32s2: Target halted, PC=0x40000400, debug_reason=00000000
- ** Programming Started **
- Info : esp32s2: Target halted, PC=0x4003001C, debug_reason=00000001
- Info : Flash mapping 0: 0x9a80020 -> 0xc010aab0, 158272 KB
- Info : Flash mapping 1: 0x980020c0 -> 0xfe9fa108, 3147814 KB
- Info : Flash mapping 2: 0x0 -> 0x1240b80, 0 KB
- Info : Flash mapping 3: 0x1211fc0 -> 0x0, 18471 KB
- Info : Flash mapping 4: 0x0 -> 0x10000, 0 KB
- Info : Flash mapping 5: 0xf8f3b80 -> 0x7fff, 0 KB
- Info : Flash mapping 6: 0x0 -> 0x0, 0 KB
- ...
- much more lines like this
- ...
- Segmentation fault
Device: ESP32-S2-Saola-1R, containing ESP32-S2-WROOVER
JTAG-Programmer: Segger JLINK
JTAG pins are connected correctly and programming of a fresh device works fine unless I2C ist implemented in running firmware.
openocd -d2 -f openocd.cfg -c "init; reset halt; program_esp build/file.bin 0x10000 verify reset exit"
openocd.cfg:
source [find interface/jlink.cfg]
source [find target/esp32s2.cfg]
adapter_khz 10000
Once the running firmare contains I2C, JTAG doesn't work any more:
- esp_err_t i2c_device_init(void)
- {
- i2c_config_t conf = \
- {
- .mode = I2C_MODE_MASTER,
- .sda_io_num = 34,
- .sda_pullup_en = GPIO_PULLUP_DISABLE,
- .scl_io_num = 35,
- .scl_pullup_en = GPIO_PULLUP_DISABLE,
- .master.clk_speed = 50000,
- };
- esp_err_t err = i2c_param_config(I2C_NUM_0, &conf);
- if (err != ESP_OK) { return (err); }
- else { return (i2c_driver_install(I2C_NUM_0, conf.mode, 0, 0, 0))
- }
JTAG works if I start the device in BOOT mode (GPIO0 = LOW during reset). But we don't want the need of pressing a button while updating firmware.
Does anybody has an idea how to get JTAG working even if I2C is running?
Best regards, Marc