timvideos / HDMI2USB-mode-switch

Tool for switching boards supported by HDMI2USB firmware between multiple different modes (programming, webcam, etc).
Apache License 2.0
10 stars 13 forks source link

Detect "Error: Unknown flash device (ID 0x00ffffff)" on Digilent Atlys #24

Open mithro opened 8 years ago

mithro commented 8 years ago

When the Digilent Atlys is still running the firmware which ships with the board (supplied by Digilent) the SPI flash is automatically configured in QSPI mode which openocd doesn't know how to talk.

You then get this error from openocd;

root@cnt1:~/HDMI2USB-mode-switch# hdmi2usb-mode-switch --flash-gateware=/home/juser/HDMI2USB-firmware-prebuilt/archive/master/v0.0.0-639-g956a8b3/atlys/hdmi2usb/atlys_hdmi2usb-hdmi2usbsoc-atlys.bin -v
Digilent Atlys in 'jtag' mode at /dev/bus/usb/001/015
 /sys/bus/usb/devices/1-1.5
 /sys/bus/usb/devices/1-1.5:1.0
My root dir: /home/juser/HDMI2USB-mode-switch/hdmi2usb/modeswitch
Board already in required mode (jtag)
Running ['openocd', '-f', 'board/digilent_atlys.cfg', '-c', 'init; xc6s_print_dna xc6s.tap; jtagspi_init 0 /home/juser/HDMI2USB-mode-switch/hdmi2usb/firmware/spartan6/atlys/bscan_spi_xc6slx45.bit; jtagspi_program /home/juser/HDMI2USB-firmware-prebuilt/archive/master/v0.0.0-639-g956a8b3/atlys/hdmi2usb/atlys_hdmi2usb-hdmi2usbsoc-atlys.bin 0x0; exit']
Open On-Chip Debugger 0.10.0-dev-00248-gf3b38ff (2016-04-03-07:23)
Licensed under GNU GPL v2
For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
Warn : Adapter driver 'usb_blaster' did not declare which transports it allows; assuming legacy JTAG-only
Info : only one transport option; autoselect 'jtag'
Warn : incomplete ublast_vid_pid configuration
jtagspi_program
Info : usb blaster interface using libftdi
Info : This adapter doesn't support configurable speed
Info : JTAG tap: xc6s.tap tap/device found: 0x34008093 (mfg: 0x049 (Xilinx), part: 0x4008, ver: 0x3)
DNA = 100110010110101100010110111000010010100001101000001001011 (0x132d62dc250d04b)

loaded file /home/juser/HDMI2USB-mode-switch/hdmi2usb/firmware/spartan6/atlys/bscan_spi_xc6slx45.bit to pld device 0 in 4s 414024us
Info : JTAG tap: xc6s.tap tap/device found: 0x34008093 (mfg: 0x049 (Xilinx), part: 0x4008, ver: 0x3)
Error: Unknown flash device (ID 0x00ffffff)

Traceback (most recent call last):
  File "/home/juser/HDMI2USB-mode-switch/conda/bin/hdmi2usb-mode-switch", line 9, in <module>
    load_entry_point('hdmi2usb.modeswitch', 'console_scripts', 'hdmi2usb-mode-switch')()
  File "/home/juser/HDMI2USB-mode-switch/hdmi2usb/modeswitch/cli.py", line 264, in main
    verbose=args.verbose)
  File "/home/juser/HDMI2USB-mode-switch/hdmi2usb/modeswitch/boards.py", line 198, in flash_fpga
    subprocess.check_call(cmdline)
  File "/home/juser/HDMI2USB-mode-switch/conda/lib/python3.5/subprocess.py", line 584, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['openocd', '-f', 'board/digilent_atlys.cfg', '-c', 'init; xc6s_print_dna xc6s.tap; jtagspi_init 0 /home/juser/HDMI2USB-mode-switch/hdmi2usb/firmware/spartan6/atlys/bscan_spi_xc6slx45.bit; jtagspi_program /home/juser/HDMI2USB-firmware-prebuilt/archive/master/v0.0.0-639-g956a8b3/atlys/hdmi2usb/atlys_hdmi2usb-hdmi2usbsoc-atlys.bin 0x0; exit']' returned non-zero exit status 1

Detect this and link them to the special instructions for the work around.

Eventually we should have a better solution....

mithro commented 6 years ago

See the notes here -> https://github.com/timvideos/HDMI2USB/wiki/Digilent-Atlys-Board:-Jumpers-and-Video-Connections#notes

  • JP11 is used to disable the FPGA from loading the configuration from the onboard SPI flash. This header may not be populated on your board. During normal operation this should not have a jumper on it. This jumper is only needed when loading the HDMI2USB firmware onto the board permanently for the first time. From the Digilent Atlys manual;

    An on-board mode jumper (JP11) selects between JTAG/USB and ROM programming modes. If JP11 is not loaded, the FPGA will automatically configure itself from the ROM. If JP11 is loaded, the FPGA will remain idle after power-on until configured from the JTAG or Serial programming port.

See instructions here too -> https://paginas.fe.up.pt/~ee06211/doku.php?id=digilent_atlys#interfacing_with_the_onboard_numonyx_n25q128

GitHub
timvideos/HDMI2USB
HDMI2USB: Open video capture hardware + firmware