openocd & esp32 DevKitC on Linux

zamek42@gmail.com
Posts: 34
Joined: Sat Dec 02, 2017 7:27 pm

openocd & esp32 DevKitC on Linux

Postby zamek42@gmail.com » Sat Dec 02, 2017 7:37 pm

Hi All,
I have an esp32 DevKitC, everything is working well except debugging. I use Debian Linux x64, and lsusb said:

Bus 004 Device 007: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP210x UART Bridge / myAVR mySmartUSB light

It is not a FTDI chip, and I cannot set it on openocd. I've downloaded openocd source and I can compile it, but how can I set this chip?
There are no entry in the 99-openocd.rules file.

thx,
Zamek

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

Re: openocd & esp32 DevKitC on Linux

Postby ESP_Sprite » Sun Dec 03, 2017 10:47 am

Sorry, DevkitC does not have an on-board JTAG adapter chip; the ESP32-Wrover-Kit does, maybe you've confused these two. You can still get JTAG-debugging support, but you'd need to use an external JTAG adapter.

zamek42@gmail.com
Posts: 34
Joined: Sat Dec 02, 2017 7:27 pm

Re: openocd & esp32 DevKitC on Linux

Postby zamek42@gmail.com » Sun Dec 03, 2017 12:18 pm

Ok, thx.
I have an c232hm-ddhsl-0 cable. It has a

Bus 004 Device 006: ID 0403:6014 Future Technology Devices International, Ltd FT232H Single HS USB-UART/FIFO IC
chip.
Can I use it with openocd? And what is connection scheme of this, because it has 10 individual pins on it.

thx
Zamek

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

Re: openocd & esp32 DevKitC on Linux

Postby ESP_Sprite » Sun Dec 03, 2017 6:47 pm

As far as I know, nope. You need an FT2232, your cable has an FT232.

meowsqueak
Posts: 151
Joined: Thu Jun 15, 2017 4:54 am
Location: New Zealand

Re: openocd & esp32 DevKitC on Linux

Postby meowsqueak » Tue Dec 05, 2017 3:59 am

ESP_Sprite wrote:As far as I know, nope. You need an FT2232, your cable has an FT232.
Actually, I think the FT232H is OK - it has an MPSSE so is basically a one-channel version of the FT2232. The FT232R is not sufficient though.

I have a C232HM-EDHSL cable (which is the same as the -DDHSL but 5V not 3.3V on the VCC pin). This has the the FT232H and I'm able to JTAG debug and flash the ESP32 with it, using OpenOCD.

I use the ESP32 fork of OpenOCD with the following config:

Code: Select all

interface ftdi
ftdi_vid_pid 0x0403 0x6014
ftdi_channel 0
reset_config none
adapter_khz 20000
transport select jtag
When running OpenOCD I use the "-f tcl/target/esp32.cfg" option as well as the config file above.

Code: Select all

$ src/openocd -f ../c232hm-edhsl-0.cfg -f tcl/target/esp32.cfg
Open On-Chip Debugger 0.10.0-dev-gcc5b0f7a (2017-09-04-14:45)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
none separate
adapter speed: 1000 kHz
jtag
force hard breakpoints
Info : clock speed 1000 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)
Then debug with:

Code: Select all

$ xtensa-esp32-elf-gdb -ex 'target remote localhost:3333' ./build/<project>.elf
The Eclipse integration tends to work better than command-line GDB I find.

To program the ESP32 flash, I use:

Code: Select all

$ src/openocd -s share/openocd/script \
              -f ../c232hm-edhsl-0.cfg \
              -f tcl/target/esp32.cfg \
              -c "program_esp32 <path/to/project/file.bin 0x10000 verify exit"

zamek42@gmail.com
Posts: 34
Joined: Sat Dec 02, 2017 7:27 pm

Re: openocd & esp32 DevKitC on Linux

Postby zamek42@gmail.com » Fri Dec 08, 2017 7:03 am

thx it seems good, I'll try it.

Who is online

Users browsing this forum: No registered users and 101 guests