JTAG debugging is not working: Error: esp32.cpu0: IR capture error; saw 0x1f not 0x01

ice.bob
Posts: 7
Joined: Thu Jan 30, 2020 10:31 pm

JTAG debugging is not working: Error: esp32.cpu0: IR capture error; saw 0x1f not 0x01

Postby ice.bob » Thu Jan 30, 2020 10:42 pm

Hello guys,

I totally do not get it. So I have been using the blink example as a starter to program the ESP32WROVER-B (ESP-WROVER-KitV4.1) module. All the JTAG jumpers are correctly set, also the udev rules within my Ubuntu 19.10 machine.

I can successfully compile and flash the bare "blink" example (

Code: Select all

idf.py -p /dev/ttyUSB1 cleanfull build flash monitor
). JTAG debugging is also working using

Code: Select all

openocd -f board/esp32-wrover-kit-3.3v.cfg
. As soon as I extend the code base for a minimum debugging is not working any more. I get the following error:

Code: Select all

$ openocd -f board/esp32-wrover-kit-3.3v.cfg 
Open On-Chip Debugger  v0.10.0-esp32-20191114 (2019-11-14-14:15)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
none separate
adapter speed: 20000 kHz
Info : Configured 2 cores
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Error: type 'esp32' is missing virt2phys
Info : ftdi: if you experience problems at higher adapter clocks, try the command "ftdi_tdo_sample_edge falling"
Info : clock speed 20000 kHz
Error: JTAG scan chain interrogation failed: all ones
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: esp32.cpu0: IR capture error; saw 0x1f not 0x01
Warn : Bypassing JTAG setup events due to errors
Info : Listening on port 3333 for gdb connections
Can anybody tell me why? Because it compile correctly and the monitor output is also correct. Thus, the app works like charm. But I cannot debug it via JTAG :-(

main.c

Code: Select all

// FreeRTOS includes
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
// ESP32 settings
#include "nvs_flash.h"
// Error/debugging library
#include "esp_err.h"
#define LOG_LOCAL_LEVEL ESP_LOG_VERBOSE
#include "esp_log.h"
// Driver
#include "driver/gpio.h"

// Global definitions and variables
static const char* Log_Tag = "main";
#define BLINK_GPIO 14

// Initialize nonvolatile storage
esp_err_t nvs_init(void)
{
    esp_err_t ret = nvs_flash_init();

    if (ret == ESP_ERR_NVS_NO_FREE_PAGES)
    {
        ESP_ERROR_CHECK(nvs_flash_erase());

        ret = nvs_flash_init();
    }

    return ret;
}

// Actual task
void blink_task(void *pvParameter)
{
    /* Configure the IOMUX register for pad BLINK_GPIO (some pads are
       muxed to GPIO on reset already, but some default to other
       functions and need to be switched to GPIO. Consult the
       Technical Reference for a list of pads and their default
       functions.) => make BLINK_GPIO as IO pin.
    */
    gpio_pad_select_gpio(BLINK_GPIO);
    // Set the GPIO as a push/pull output
    gpio_set_direction(BLINK_GPIO, GPIO_MODE_OUTPUT);

    while (1)
    {
        vTaskDelay(500 / portTICK_RATE_MS);
        ESP_LOGD(Log_Tag, "Blink");

        vTaskDelay(500 / portTICK_RATE_MS);
    }
}

void app_main()
{
    // Init parts on PCB
    ESP_ERROR_CHECK(nvs_init());

    // attach blink_task to a CPU core.
    xTaskCreate(&blink_task, "blink_task", configMINIMAL_STACK_SIZE, NULL, 5, NULL);
}
Actually I just added the nvs part. Does anybody can get it to work?

ESP_Sprite
Posts: 9020
Joined: Thu Nov 26, 2015 4:08 am

Re: JTAG debugging is not working: Error: esp32.cpu0: IR capture error; saw 0x1f not 0x01

Postby ESP_Sprite » Fri Jan 31, 2020 12:26 pm

Perhaps you're using GPIO12-15 for something else? If you reconfigure those, jtag doesn't work anymore.

ice.bob
Posts: 7
Joined: Thu Jan 30, 2020 10:31 pm

Re: JTAG debugging is not working: Error: esp32.cpu0: IR capture error; saw 0x1f not 0x01

Postby ice.bob » Sun Feb 02, 2020 10:08 am

How do I reconfigure them? As I sated before. The normal blink example works perfectly in terms of JTAG debugging. But my code (see first post) cannot be debugged via JTAG at all. Did I reconfigure the pins 12-15 without knowing it?

ESP_Sprite
Posts: 9020
Joined: Thu Nov 26, 2015 4:08 am

Re: JTAG debugging is not working: Error: esp32.cpu0: IR capture error; saw 0x1f not 0x01

Postby ESP_Sprite » Mon Feb 03, 2020 9:40 am

Code: Select all

#define BLINK_GPIO 14
So yes, you do.

Who is online

Users browsing this forum: No registered users and 121 guests