Hi. I've tried what you just proposed and here what I got (I collected all information in one post).
I'm using JTAG connection (JetLink9 and JetLink5, It is the same as JLink), the stable ESP-EDF v3.1.1, the latest OpenOCD, Win10 running natively.
I'm using a simple example code for LED Blinking:
Code: Select all
#define BLINK_GPIO 27
void blink_task(void *pvParameter)
{
while(1) {
/* Blink off (output low) */
gpio_set_level(BLINK_GPIO, 0);
vTaskDelay(100 / portTICK_PERIOD_MS);
/* Blink on (output high) */
gpio_set_level(BLINK_GPIO, 1);
vTaskDelay(110 / portTICK_PERIOD_MS);
}
}
void app_main()
{
gpio_pad_select_gpio(BLINK_GPIO);
gpio_set_direction(BLINK_GPIO, GPIO_MODE_OUTPUT);
xTaskCreate(&blink_task, "blink_task", configMINIMAL_STACK_SIZE, NULL, 10, NULL);
}
Here is successful connecting
Code: Select all
Open On-Chip Debugger 0.10.0-dev (2018-11-05-04:10)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
adapter speed: 3000 kHz
esp32 interrupt mask on
Info : No device selected, using first device.
Info : J-Link compiled Jun 14 2007 14:36:33 ARM Rev.5
Info : Hardware version: 5.30
Info : VTarget = 3.313 V
Info : clock speed 3000 kHz
Info : JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : Target halted. PRO_CPU: PC=0x4008740D (active) APP_CPU: PC=0x40080EE9
After launching gdb and connecting it to openocd by command
I got such messages in OpenOCD window:
Code: Select all
Info : accepting 'gdb' connection on tcp/3333
Info : Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x40080EE9
Warn : Empty flash mapping!
Info : Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x40080EE9
Info : Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x40080EE9
Info : Auto-detected flash size 4096 KB
Info : Using flash size 4096 KB
Info : Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x40080EE9
Warn : Empty flash mapping!
Info : Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x40080EE9
Info : Using flash size 0 KB
Info : Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x40080EE9
Warn : Empty flash mapping!
Info : Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x40080EE9
Info : Using flash size 0 KB
Why does it say "empty flash mapping"and "Using flash size 0 KB"?
Then I try load the program:
Code: Select all
(gdb) mon reset halt
JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
esp32: Debug controller 0 was reset (pwrstat=0x5F, after clear 0x0F).
esp32: Core 0 was reset (pwrstat=0x5F, after clear 0x0F).
Target halted. PRO_CPU: PC=0x5000004B (active) APP_CPU: PC=0x00000000
esp32: Core 0 was reset (pwrstat=0x1F, after clear 0x0F).
esp32: Debug controller 1 was reset (pwrstat=0x5F, after clear 0x0F).
esp32: Core 1 was reset (pwrstat=0x5F, after clear 0x0F).
Target halted. PRO_CPU: PC=0x40000400 (active) APP_CPU: PC=0x40000400
Code: Select all
(gdb) mon program_esp32 H:/Dropbox/Projects/Frog/blink/build/blink.bin 0x10000 verify
JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
esp32: Debug controller 0 was reset (pwrstat=0x5F, after clear 0x0F).
esp32: Core 0 was reset (pwrstat=0x5F, after clear 0x0F).
Target halted. PRO_CPU: PC=0x5000004B (active) APP_CPU: PC=0x00000000
esp32: Core 0 was reset (pwrstat=0x1F, after clear 0x0F).
esp32: Debug controller 1 was reset (pwrstat=0x5F, after clear 0x0F).
esp32: Core 1 was reset (pwrstat=0x5F, after clear 0x0F).
Target halted. PRO_CPU: PC=0x40000400 (active) APP_CPU: PC=0x40000400
** Programming Started **
auto erase enabled
Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x40000400
Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x40000400
wrote 147456 bytes from file H:/Dropbox/Projects/Frog/blink/build/blink.bin in 5.038046s (28.583 KiB/s)
** Programming Finished **
** Verify Started **
Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x40000400
read 146128 bytes from file H:/Dropbox/Projects/Frog/blink/build/blink.bin and flash bank 0 at offset 0x00010000 in 2.594721s (54.997 KiB/s)
contents match
** Verified OK **
Code: Select all
(gdb) flushregs
Register cache flushed.
Code: Select all
(gdb) thb app_main
Note: breakpoint 1 also set at pc 0x400d204f.
Hardware assisted breakpoint 2 at 0x400d204f: file H:/Dropbox/Projects/Frog/blink/main/blink.c, line 40.
Code: Select all
(gdb) c
Continuing.
Target halted. PRO_CPU: PC=0x40087481 (active) APP_CPU: PC=0x40080EED
Program received signal SIGTRAP, Trace/breakpoint trap.
invoke_abort ()
at C:/msys32/home/Pavel/esp/esp-idf/components/esp32/panic.c:138
138 __asm__ ("break 0,0");
And get the panic in the program. Why is it happened? Code is as simple as it can be. Can it be somehow connected with flash memory issues, that I encountered while connecting?
Technically, flashing now is successful, but the program doesn't work. Please, help.