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

rezarethink
Posts: 20
Joined: Fri Mar 24, 2017 4:15 am

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

Postby rezarethink » Wed Aug 23, 2017 4:26 am

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

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

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

Postby ESP_Sprite » Wed Aug 23, 2017 4:47 am

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.

rezarethink
Posts: 20
Joined: Fri Mar 24, 2017 4:15 am

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

Postby rezarethink » Wed Aug 23, 2017 5:58 am

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!

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

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

Postby ESP_Sprite » Thu Aug 24, 2017 3:17 am

That may be an issue with support for this chip in esp-idf - can you go into details how exactly this fails?

Who is online

Users browsing this forum: Baidu [Spider], djixon and 116 guests