marqs85 / snes_dejitter

NES/SNES 240p de-jitter mod
MIT License
44 stars 10 forks source link

Error programming chip #2

Closed matjolic closed 6 years ago

matjolic commented 6 years ago

In the process of flashing the chip I am running into an error:

BUG: RUN/IDLE -> ??? isn't a valid TAP transition

I am using the Adafruit FTDI Friend which seems to launch correctly:

Open On-Chip Debugger 0.10.0+dev-00130-g74f483e (2018-04-12-23:28) Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html Info : only one transport option; autoselect 'jtag' Warn : Transport "jtag" was already selected adapter speed: 1000 kHz Info : clock speed 1000 kHz Warn : There are no enabled taps. AUTO PROBING MIGHT NOT WORK!! Info : JTAG tap: auto0.tap tap/device found: 0x0150203f (mfg: 0x01f (Atmel), part: 0x1502, ver: 0x0) Warn : AUTO auto0.tap - use "jtag newtap auto0 tap -irlen 3 -expected-id 0x0150203f" Warn : gdb services need one or more targets defined

These are the last lines from the console after I launch svf

RUNTEST 30001E-6 SEC; SIR 10 TDI (2bf); SIR 10 TDI (2a1); SDR 11 TDI (05e); SIR 10 TDI (290); SDR 86 TDI (3f77bccea3ef33c4ff3dcc); SIR 10 TDI (29e); STATE IDLE; RUNTEST 30001E-6 SEC; SIR 10 TDI (2bf); SIR 10 TDI (2a1); SDR 11 TDI (05f); SIR 10 TDI (290); BUG: RUN/IDLE -> ??? isn't a valid TAP transition Connection closed by foreign host.

marqs85 commented 6 years ago

Did you generate the svf yourself or use snes_dejitter.svf from output_files/?

matjolic commented 6 years ago

I've actually tried both, with the exact same result. Further investigation, I have doubts that the FT232RL chip on the Adafruit FTDI Friend is actually appropriate for this target. I am not an expert in the FPGA field, but enough experience to swim through the documentation let's say... Is an FT2232H chip a requirement to program the ATF1502AS in this case? Such as this module : http://www.ftdichip.com/Support/Documents/DataSheets/Modules/DS_FT2232H_Mini_Module.pdf ?

marqs85 commented 6 years ago

The target does not put any specific requirements for the programmer, so FT232-based programmers should work fine as well. Did you customize openocd config to match the programmer specs, and have you tried lower TCK frequency?

matjolic commented 6 years ago

Just wanted to followup on this issue, I think I found the cause for this. The Adafruit FTDI friend uses the FT232R chip which has a clock timing issue when trying to bit-bang a chip. This is best explained in this blog post by Scott Harden: link

I was able to use a Raspberry Pi's GPIO pins with OpenOCD to succesfully flash one board following this post linked by ebeb on the shmups forums. Thanks for that!

I have since acquired and FT2232H breakout board which doesn't have the issue mentioned above. Hope this clears out any confusion for future folks ;)