Page 1 of 1

JTAG (OpenOCD) with WinBond Flash Works, Fails with Macronix Flash

Posted: Wed Aug 23, 2017 4:26 am
by rezarethink
After much debugging, I think the problem I'm having when I'm using OpenOCD (installed w/ the VisualGDB toolchain) to reflash the ESP32 is that the CPU resets when this command is called:

E:\projects\sysprogs-github\openocd-esp32\src\helper\command.c:143 script_debug(): command - ocd_flash ocd_flash init

You can see the OpenOCD debug output of the Macronix chip (left) vs the WinBond chip (right) in this diff: https://www.diffchecker.com/WXh61Q8R

Look at line 290+. Although both ICs have identical pinouts, and are connected identically, and both support QIO, it looks like applications uploaded via ESPTOOL only work if the WinBond chip is configured in DIO mode where the WinBond chip works with files uploaded in QIO mode. I've not been able to find anyplace in the source for OpenOBD where the flash mode is set/specified.

This is how they are connected:

Image

The datasheets for the chips are:

http://www.elinux.org/images/f/f5/Winbond-w25q32.pdf
http://www.macronix.com/Lists/Datasheet ... 20v1.4.pdf

I need to
1) verify that the Macronix flash is connected correctly - or if some other configuration will enable QIO mode. It's available in a smaller footprint that we need for our application. Making sure JTAG support works is essential.
2) verify that the layout of our device is correct and the problems I'm having are indeed an openOCD software issue that can be sorted out in the future. We want to go into schematic lock soon so we can go into production with our device.

Thanks in advance!
Reza

Re: JTAG (OpenOCD) with WinBond Flash Works, Fails with Macronix Flash

Posted: Wed Aug 23, 2017 4:47 am
by ESP_Sprite
Fyi, I think this may be a bug in the VisualGDB stub that does the actual flashing. If you can flash this chip over the serial port (esp-idf 'make flash') but not in VisualGDB, you may be better off asking the VisualGDB people.

Re: JTAG (OpenOCD) with WinBond Flash Works, Fails with Macronix Flash

Posted: Wed Aug 23, 2017 5:58 am
by rezarethink
I'm asking everyone - spent 3 days on this so far so I'm looking for all the help I can get. :)

I just got a reply from visualGDB saying that they were previously using their own version of openOCD with their own flashing stubs in it. The latest beta version supports the esp32 version of openOCD and recommended I upgrade to it. Unfortunately, the examples don't compile with the latest toolchain. I'm waiting to hear back from them.

That being said, the outstanding question is why does the macronix flash not work over QIO with the serial flash tool -- are the pins connected correctly?

Thnx!

Re: JTAG (OpenOCD) with WinBond Flash Works, Fails with Macronix Flash

Posted: Thu Aug 24, 2017 3:17 am
by ESP_Sprite
That may be an issue with support for this chip in esp-idf - can you go into details how exactly this fails?