Question about esp32 Flash download through JTAG

jeromeh
Posts: 31
Joined: Thu Dec 22, 2016 5:41 am

Question about esp32 Flash download through JTAG

Postby jeromeh » Tue Jan 03, 2017 7:17 am

Hi,

I'm trying to program flash through JTAG for esp32, but getting error message: "Error: timed out while waiting for target halted".

I have GND/TMS/TCK/TDI/TDO connected, the JTAG log is like below:

Code: Select all

$ openocd -f esp32.cfg -c "program ../helloworld/build/helloworld.elf verify reset exit"
Open On-Chip Debugger 0.10.0-dev-g90071eb (2017-01-01-22:30)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
adapter speed: 200 kHz
force hard breakpoints
Info : clock speed 200 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)
Error: esp32.cpu0: esp108_fetch_all_regs (line 673): DSR (000000FF) indicates target still busy!
Error: esp32.cpu0: esp108_fetch_all_regs (line 673): DSR (000000FF) indicates DIR instruction generated an exception!
Error: esp32.cpu0: esp108_fetch_all_regs (line 673): DSR (000000FF) indicates DIR instruction generated an overrun!
Info : esp32.cpu0: Target halted, pc=0x00000000
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 : esp32.cpu0: Core was reset (pwrstat=0x1F, after clear 0x1F).
Info : esp32.cpu0: Debug controller was reset (pwrstat=0x5F, after clear 0x1F).
Error: timed out while waiting for target halted
TARGET: esp32.cpu0 - Not halted
in procedure 'program' 
in procedure 'reset' called at file "embedded:startup.tcl", line 478
in procedure 'ocd_bouncer'

** Unable to reset target **
shutdown command invoked
By adding a connection of SRST to CH_PU of esp32, I can see a print of "esp32.cpu0: target state: halted", but still have similar error as below:

Code: Select all

$ openocd -f esp32.cfg -c "program ../helloworld/build/helloworld.elf verify reset exit"
Open On-Chip Debugger 0.10.0-dev-g90071eb (2017-01-01-22:30)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
adapter speed: 200 kHz
force hard breakpoints
Info : clock speed 200 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 : esp32.cpu0: Target halted, pc=0x40000400
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 : esp32.cpu0: Core was reset (pwrstat=0x1F, after clear 0x0F).
Info : esp32.cpu0: Target halted, pc=0x40000400
esp32.cpu0: target state: halted
Error: timed out while waiting for target halted
TARGET: esp32.cpu1 - Not halted
in procedure 'program' 
in procedure 'reset' called at file "embedded:startup.tcl", line 478
in procedure 'ocd_bouncer'

** Unable to reset target **
shutdown command invoked
Does anybody managed successfully program flash through JTAG? Any hint will be appreciated. Thanks,

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

Re: Question about esp32 Flash download through JTAG

Postby ESP_Sprite » Tue Jan 03, 2017 8:11 am

That is not supported yet; the code needed to support it has not even been written yet so it's no surprise you run into errors. Sorry, for now you'll have to re-flash over serial.

jeromeh
Posts: 31
Joined: Thu Dec 22, 2016 5:41 am

Re: Question about esp32 Flash download through JTAG

Postby jeromeh » Tue Jan 03, 2017 9:56 am

Thanks for confirming that...

any idea about what is the time frame I can expect to have this supported officially? Say in a few weeks or months?

ESP_igrr
Posts: 2072
Joined: Tue Dec 01, 2015 8:37 am

Re: Question about esp32 Flash download through JTAG

Postby ESP_igrr » Tue Jan 03, 2017 3:59 pm

We plan to work on this in February.

nigaspa
Posts: 1
Joined: Tue Feb 21, 2017 10:32 am

Re: Question about esp32 Flash download through JTAG

Postby nigaspa » Tue Feb 21, 2017 10:35 am

Hi, because I'm having the same problem of jeromeh, any more precise news about "what you plan" to do in Febrary?

I thank you.

User avatar
armink
Posts: 1
Joined: Sun Feb 19, 2017 2:03 am

Re: Question about esp32 Flash download through JTAG

Postby armink » Thu Feb 23, 2017 12:43 am

+1 the same problem for me

ESP_igrr
Posts: 2072
Joined: Tue Dec 01, 2015 8:37 am

Re: Question about esp32 Flash download through JTAG

Postby ESP_igrr » Thu Feb 23, 2017 1:25 am

Because the release of 2.0 has been delayed, we haven't started working on flashing via openocd yet. The plan is to modify openocd to upload a flashing stub into IRAM and run it, and then communicate with the stub to send it the data to be uploaded.

roctwo
Posts: 95
Joined: Mon Nov 28, 2016 3:12 am

Re: Question about esp32 Flash download through JTAG

Postby roctwo » Mon Feb 27, 2017 9:23 am

ESP_igrr wrote:Because the release of 2.0 has been delayed, we haven't started working on flashing via openocd yet. The plan is to modify openocd to upload a flashing stub into IRAM and run it, and then communicate with the stub to send it the data to be uploaded.
Can esp32 flash download through JTAG now? :D :D :D

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

Re: Question about esp32 Flash download through JTAG

Postby ESP_Sprite » Tue Feb 28, 2017 5:59 am

No, sorry. I have been not able to work on JTAG for now because of other priorities. The good news is that we however have attracted a new dev, and he's working on several new features for debugging. I think JTAG flashing is also somewhere on his list.

rezasurmar
Posts: 3
Joined: Tue Feb 07, 2017 1:09 pm

Re: Question about esp32 Flash download through JTAG

Postby rezasurmar » Tue Apr 11, 2017 12:29 pm

Does jtag programming already work?

Who is online

Users browsing this forum: No registered users and 170 guests