Running OpenOCD on ESP32-P4-Function-EV-Board

jsolsona
Posts: 2
Joined: Sat Sep 21, 2024 5:35 pm

Running OpenOCD on ESP32-P4-Function-EV-Board

Postby jsolsona » Sat Sep 21, 2024 5:48 pm

Hi there,

I am starting with ESP-32-P4, copied the simple "hello_world" example, and tried to debug it (I work on windows).

Buiding, flashing and running monitor works fine, so my USB Comport is setup properly, but no matter how I try to launch OpenOCD I always have same message:

Code: Select all

C:\Espressif\frameworks\esp-idf-v5.3.1>openocd -f board/esp32p4-builtin.cfg
Open On-Chip Debugger v0.12.0-esp32-20240318 (2024-03-18-18:26)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
Info : only one transport option; autoselecting 'jtag'
Info : esp_usb_jtag: VID set to 0x303a and PID to 0x1001
Info : esp_usb_jtag: capabilities descriptor set to 0x2000
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Error: esp_usb_jtag: could not find or open device!
C:\Espressif\tools\openocd-esp32\v0.12.0-esp32-20240318\openocd-esp32\share\openocd\scripts/target/esp_common.cfg:9: Error:
at file "C:\Espressif\tools\openocd-esp32\v0.12.0-esp32-20240318\openocd-esp32\share\openocd\scripts/target/esp_common.cfg", line 9
Error: [esp32p4.hp.cpu] Unsupported DTM version: -1
Error: [esp32p4.hp.cpu] Could not identify target type.
After reading in some documentaiton (sparse, very very sparse), I found that :
USB-JTAG: GPIO24 and GPIO25 are used by USB-JTAG by default. If they are reconfigured to operate as normal GPIOs, USB-JTAG functionality will be disabled.
So, next step, lets check the status of these GPIOs in vanilla hello_world code, adding the following lines to my code:

Code: Select all

    gpio_dump_io_configuration(stdout, (1ULL << 24) | (1ULL << 25));
I have the following output:
================IO DUMP Start================
IO[24] -
Pullup: 0, Pulldown: 0, DriveCap: 3
InputEn: 0, OutputEn: 0, OpenDrain: 0
FuncSel: 0 (IOMUX)
SleepSelEn: 0

IO[25] -
Pullup: 0, Pulldown: 0, DriveCap: 3
InputEn: 0, OutputEn: 0, OpenDrain: 0
FuncSel: 0 (IOMUX)
SleepSelEn: 0

=================IO DUMP End==================
This is esp32p4 chip with 2 CPU core(s), , silicon revision v0.1, 2MB external flash
Minimum free heap size: 610312 bytes
That I understand "IOMUX, default behaviour" (I May be wrong)

(BTW, the documentation states to use a function called ""
gpio_dump_all_io_configuration(stdout, SOC_GPIO_VALID_GPIO_MASK);
that seems to not exists.

May someone give me a hint on how to use OpenOCD with this board?

Kind regards
Juan

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

Re: Running OpenOCD on ESP32-P4-Function-EV-Board

Postby ESP_Sprite » Sun Sep 22, 2024 6:37 am

Looks like you have an OpenOCD from March this year - chances are it doesn't support the P4 yet.

Baldhead
Posts: 443
Joined: Sun Mar 31, 2019 5:16 am

Re: Running OpenOCD on ESP32-P4-Function-EV-Board

Postby Baldhead » Wed Sep 25, 2024 12:46 am

Hi,

I also tried to use this function on esp32-s3 and i couldn't.
I didn't find it in esp-idf v5.3.1.

gpio_dump_all_io_configuration(stdout, SOC_GPIO_VALID_GPIO_MASK);

NOTE:
esp-idf v5.3.1
https://github.com/espressif/esp-idf/issues/13175

Thank's.

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 52 guests