timvideos / HDMI2USB-fx2-firmware

HDMI2USB firmware for the Cypress FX2 found on the Digilent Atlys and Numato Opsis boards.
24 stars 11 forks source link

Makfile: Use correct file paths and set variables #2

Closed paddatrapper closed 7 years ago

paddatrapper commented 7 years ago

Makes the firmware build correctly and flash the FX2 chip. Also added instructions to the README for building and flashing the firmware

paddatrapper commented 7 years ago

The only issue is that the hdmi2usb-mode-switch command requires root permissions to flash the firmware, thus using the Makefile means that everything is built as root (or requires running twice). This needs fixing

If not run with root, it fails at

hdmi2usb-mode-switch --load-fx2-firmware hdmi2usb/hdmi2usb.hex
Traceback (most recent call last):
  File "/usr/bin/hdmi2usb-mode-switch", line 11, in <module>
    load_entry_point('hdmi2usb.modeswitch==0+unknown', 'console_scripts', 'hdmi2usb-mode-switch')()
  File "/usr/share/hdmi2usb-mode-switch/hdmi2usb/modeswitch/cli.py", line 255, in main
    verbose=args.verbose)
  File "/usr/share/hdmi2usb-mode-switch/hdmi2usb/modeswitch/boards.py", line 109, in load_fx2
    board.dev.detach()
  File "/usr/share/hdmi2usb-mode-switch/hdmi2usb/modeswitch/lsusb.py", line 154, in detach
    open(unbind_path, "w").write(interface)
PermissionError: [Errno 13] Permission denied: '/sys/bus/usb/devices/2-2:1.0/driver/unbind'
Makefile.fx2:39: recipe for target 'load-fx2' failed
make: *** [load-fx2] Error 1
mithro commented 7 years ago

hdmi2usb-mode-switch has three options;

mithro commented 7 years ago

Looks good to me, one small change - Can you please updated your commit messages to start with a capital letter?

paddatrapper commented 7 years ago

Fixed. Added the mode-switch info to the README

mithro commented 7 years ago

Could you also send a pull request for the mode-switch repo with the extra mode-switch root info?