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
Code: Select all
openocd -f board/esp32-wrover-kit-3.3v.cfg
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
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);
}