Giter VIP home page Giter VIP logo

ixo-usb-jtag's Introduction

ixo-usb-jtag - Altera Bus Blaster emulation using Cypress FX2 chip

General information

The code in this directory is for Cypress FX2 (e.g. CY7C68013A) and can be compiled with the SDCC compiler (I tried version 2.6 as shipped with Ubuntu 6.10). Once I had a version that could be compiled with Keil tools (until early 2007), but switched to SDCC because I usually develop on a Linux host.

No logic beside the FX2 itself and only a few external components are required for a basic JTAG adapter. I don't have detailed schematics available; my test setup consists of a FX2 on a custom board where it's directly connected to a Cyclone FPGA.

        ____________
       |            |
       | Cypress    |
  USB__| EZ-USB FX2 |__JTAG(TDI,TDO,TCK,TMS)
       | CY7C68013A |
       |____________|
        __|__________
       |             |
       | 24 MHz XTAL |
       |_____________|

Similar boards are available from fpga4fun.com - the boards named "Saxo-L" and "Xylo-EM" are pre-wired for use with an adapted version of my code, while "Saxo" and "Xylo" can be used after soldering 4 extra wires:

http://www.fpga4fun.com/board_Xylo.html

There's a discussion thread in the fpga4fun forum about this firmware:

http://www.fpga4fun.com/forum/viewtopic.php?t=483

Digilent JTAG-USB cable

This cable is supported through the usbjtag-dj_usb.hex firmware. the TDO line is level-shifted through a single transistor, which results in the TDO signal being inverted as it enters the FX2. The firmware takes care of the inversion and returns the correct data.

Note that this only applies to the JTAG-USB cable, and not the JTAG-HS series. The JTAG-HS is based on FTDI chips, not the Cypress FX2.

Digilent Nexys 1 / 2 or Atlys Boards

Through a contribution by Sune Mai, this code can be used with the Digilent Nexys / Nexys2 and Atlys boards.

http://www.digilentinc.com/nexys/
http://www.digilentinc.com/nexys2/
http://www.digilentinc.com/atlys/

The hardware-specific code file is hw_nexys.c. Use the usbjtag-nexys.hex firmware file.

Also, you may use the "nexys2prog" script by Andy Ross, available from the same place this code is available from:

http://ixo-jtag.sourceforge.net/

Numato Opsis Boards

There is code to support running on the Opsis board from Numato.

http://numato.com/numato-opsis-fpga-based-open-video-platform/

The hardware-specific code file is hw_opsis.c. Use the usbjtag-opsis.hex firmware file.

More information about how the FX2 is configured on the Opsis board can be found at https://opsis.hdmi2usb.tv/features/usb-peripheral.html

Xilinx JTAG cable

There is code to support running in the "Xilinx Platform Cable USB". A firmware for the XPCU will be built. I've tested this only with unmodified CPLD version 18 (0x12) on a Spartan-3E starter kit, as it was programmed by my WebPack 8.2i. The code needs optimization; yet it is merely a proof of concept.

  • hw_xpcu_i: Access "internal" chain (the XPCU CPLD, IC3, itself)
  • hw_xpcu_x: Access "external" chain (the Spartan 3E, PROM, etc.)

nanoDLA Logic Analyzer

This is a low cost logic analyzer made with FX2. Since its input channels are equipped only with dumping resistors, it is able to use them for output aswell. Supported through the usbjtag-nanodla.hex firmware.

  • CH.0: TMS
  • CH.2: TDI
  • CH.4: TDO
  • CH.6: TCK

More information about nanoDLA can be found at https://github.com/wuxx/nanoDLA/

Adapting the code to your hardware

As is, the code assumes the following pin assignment:

  • Port C.0: TDI
  • Port C.1: TDO
  • Port C.2: TCK
  • Port C.3: TMS

Other assignments are possible. If you have your signals connected to bit-addressable I/O pins (port A,B,C or D), I suggest you make a copy of hw_basic.c and adapt the definitions and ProgIO_Init() in it to your needs. The file hw_saxo_l is even simpler to adapt if you want only JTAG and no AS/PS mode. If your signals are not on bit-addressable I/Os (that is, you're using port E), you could base your adaptation on the slower hw_xpcu_i.c.

The USB identification data (vendor/product ID, strings, ...) can be modified in dscr.a51. The firmware emulates the 128 byte EEPROM that usually holds configuration data for the FT245 and which can be read from the host; its content (including checksum) is computed from the data in dscr.a51 as well.

The WAKEUP pin should be high for the re-numeration to work reliably (thanks Jean/fpga4fun!).

History

Changes since previous release 2008-07-05:

Changes since previous release on 2007-02-15:

  • Jean Nicolle contributed hw_saxo_l.c for the FX2 boards from fpga4fun.com
  • fx2/Makefile fixed to build correct libfx2.lib even under Windows.

Changes since previous release on 2007-01-28:

  • Initial suppport for running on Xilinx XPCU.
  • New FX2 code, based on USRP2 from the GNU Radio Project;
  • Firmware can now be compiled using SDCC 2.6. No more Keil support.
  • EEPROM content is automatically computed from dscr.a51, including checksum.

Changes since initial release on 2006-04-23:

  • added this readme.txt
  • reorganized my project folder: diff now created from Subversion repository
  • stripped *.dist extension from eeprom.c and dscr.a51
  • added unique proper product and vendor ID (thanks to Antti Lukats!)
  • fixed checksum in eeprom.c
  • added comments about AS/PS mode pins in usbjtag.c

ixo-usb-jtag's People

Contributors

dpavlin avatar elfmimi avatar mithro avatar mrnuke avatar sameer avatar stefanor avatar youxiaojie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ixo-usb-jtag's Issues

a third question about device node /dev/usb_jtag

[13660.160162] usb 3-1.2: new high-speed USB device number 5 using ehci-pci
[13660.892885] usb 3-1.2: config 1 interface 0 altsetting 0 bulk endpoint 0x1 has invalid maxpacket 64
[13660.892889] usb 3-1.2: config 1 interface 0 altsetting 0 bulk endpoint 0x81 has invalid maxpacket 64
[13660.893637] usb 3-1.2: New USB device found, idVendor=1443, idProduct=0001, bcdDevice= 0.00
[13660.893640] usb 3-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[13660.893642] usb 3-1.2: Product: USB JTAG Cable
[13660.893643] usb 3-1.2: Manufacturer: Digilent
root@debian:/media/allan/home_data/ixo-usb-jtag# ls /dev/
Display all 187 possibilities? (y or n)
autofs hugepages/ rfkill sg1 tty18 tty4 tty61 vcsa4
block/ hwrng rtc sg2 tty19 tty40 tty62 vcsa5
bsg/ initctl rtc0 sg3 tty2 tty41 tty63 vcsa6
btrfs-control input/ sda sg4 tty20 tty42 tty7 vcsu
bus/ kmsg sda1 sg5 tty21 tty43 tty8 vcsu1
cdrom kvm sda2 sg6 tty22 tty44 tty9 vcsu2
cdrw log sda3 shm/ tty23 tty45 ttyS0 vcsu3
char/ loop-control sda4 snapshot tty24 tty46 ttyS1 vcsu4
console mapper/ sda5 snd/ tty25 tty47 ttyS2 vcsu5
core mei0 sda6 sr0 tty26 tty48 ttyS3 vcsu6
cpu/ mem sda7 stderr tty27 tty49 uhid vfio/
cpu_dma_latency memory_bandwidth sda8 stdin tty28 tty5 uinput vga_arbiter
cuse mqueue/ sdb stdout tty29 tty50 urandom vhci
disk/ net/ sdb1 tty tty3 tty51 vcs vhost-net
dri/ network_latency sdb2 tty0 tty30 tty52 vcs1 vhost-vsock
drm_dp_aux0 network_throughput sdb3 tty1 tty31 tty53 vcs2 watchdog
dvd null sdb4 tty10 tty32 tty54 vcs3 watchdog0
dvdrw port sdb5 tty11 tty33 tty55 vcs4 watchdog1
fb0 ppp sdb6 tty12 tty34 tty56 vcs5 zero
fd/ psaux sdc tty13 tty35 tty57 vcs6
full ptmx sdd tty14 tty36 tty58 vcsa
fuse ptp0 sde tty15 tty37 tty59 vcsa1
hidraw0 pts/ sdf tty16 tty38 tty6 vcsa2
hpet random sg0 tty17 tty39 tty60 vcsa3
root@debian:/media/allan/home_data/ixo-usb-jtag# cat Makefile
boot: std.hex
-test -e /dev/usb_jtag && /sbin/fxload -D /dev/usb_jtag -I std.hex -t fx2

   -D devpath
          Specifies the "usbfs" path name for the device in question, such as /proc/bus/usb/004/080.  This takes precedence over any DEVICE environment  variable  that
          may be set.

I see the Makefile it should be a new device and use fxload to transfer firmware.this is my log when plug my digilent jtag-usb to computer, no new device found! no /proc/bus/usb/.....

Openocd with Xilinx Platform Cable (DLC9G)

I tried to run openocd with Xilinx Platform Cable (DLC9G) but failed. I used 'usb-jtag.cfg' for configuring Interface (Platform Cable) . But failed to run Openocd.
The following error message is shown with Openocd

Openocd debug log is following
....
Debug: 83 5 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_init
Debug: 84 5 command.c:143 script_debug(): command - init ocd_init
Debug: 86 5 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_target init
Debug: 87 5 command.c:143 script_debug(): command - ocd_target ocd_target init
Debug: 89 5 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_target names
Debug: 90 5 command.c:143 script_debug(): command - ocd_target ocd_target names
Debug: 91 5 target.c:1324 handle_target_init_command(): Initializing targets...
Info : 92 5 ublast_access_ftdi.c:85 ublast_ftdi_init(): usb blaster interface using libftdi
Error: 93 11 ublast_access_ftdi.c:91 ublast_ftdi_init(): unable to open ftdi device: device not found
Debug: 94 11 command.c:626 run_command(): Command failed with error code -100
User : 95 11 command.c:687 command_run_line():

I think, the firmware is not loaded properly because message of lsusb : Bus 003 Device 004: ID 03fd:000f Xilinx, Inc. is showing proper ID.

Can you help me, how I can load firmware properly for openocd.

dpkg build error.

`allan@debian:/media/allan/home_data/ixo-usb-jtag$ dpkg-buildpackage -us -uc -b -rfakeroot
dpkg-buildpackage: info: source package ixo-usb-jtag
dpkg-buildpackage: info: source version 0.0.0-90-g868e385-1
dpkg-buildpackage: info: source distribution trusty
dpkg-buildpackage: info: source changed by Tim 'mithro' Ansell [email protected]
dpkg-buildpackage: info: host architecture amd64
dpkg-source --before-build .
dpkg-source: info: using options from ixo-usb-jtag/debian/source/options: --compression=xz
fakeroot debian/rules clean
dh_testdir
dh_testroot
dh_clean
rm -f debian/debhelper-build-stamp
rm -rf debian/.debhelper/
dh_clean: Compatibility levels before 9 are deprecated (level 7 in use)
rm -f -- debian/ixo-usb-jtag.substvars debian/files
rm -fr -- debian/ixo-usb-jtag/ debian/tmp/
find . ( (
( -path .*/.git -o -path .*/.svn -o -path .*/.bzr -o -path .*/.hg -o -path .*/CVS -o -path .*/.pc -o -path .*/darcs ) -prune -o -type f -a
( -name '##' -o -name '.' -o -name '*' -o -name DEADJOE
-o -name '.orig' -o -name '.rej' -o -name '.bak'
-o -name '.
.orig' -o -name ..rej -o -name '.SUMS'
-o -name TAGS -o ( -path '
/.deps/' -a -name '.P' )
) -exec rm -f {} + ) -o
( -type d -a -name autom4te.cache -prune -exec rm -rf {} + ) )
debian/rules build
dh_testdir
mkdir -p output
for HW in hw_basic hw_saxo_l hw_xpcu_i hw_xpcu_x hw_nexys hw_opsis; do
make clean || exit 1;
HARDWARE=$HW /usr/bin/make || exit 1;
cp usbjtag.hex ./output/$HW.hex || exit 1;
make clean || exit 1;
done
make[1]: Entering directory '/media/allan/home_data/ixo-usb-jtag'
make -C fx2 clean
make[2]: Entering directory '/media/allan/home_data/ixo-usb-jtag/fx2'
rm -f *.lst *.asm *.lib *.sym *.rel *.lib
make[2]: Leaving directory '/media/allan/home_data/ixo-usb-jtag/fx2'
rm -f *.lst *.asm *.lib *.sym *.rel *.mem *.map *.rst *.lnk *.lk *.hex dscr
%.a51
make[1]: Leaving directory '/media/allan/home_data/ixo-usb-jtag'
make[1]: Entering directory '/media/allan/home_data/ixo-usb-jtag'
sdcc -c -mmcs51 --no-xinit-opt -Ifx2 usbjtag.c -o usbjtag.rel
sdcc -c -mmcs51 --no-xinit-opt -Ifx2 eeprom.c -o eeprom.rel
make -C fx2 CC=sdcc AR=sdcclib
make[2]: Entering directory '/media/allan/home_data/ixo-usb-jtag/fx2'
sdcc -mmcs51 --no-xinit-opt -I. -c delay.c -o delay.rel
sdcclib -a libfx2.lib delay.rel
rm delay.rel
sdcc -mmcs51 --no-xinit-opt -I. -c fx2utils.c -o fx2utils.rel
sdcclib -a libfx2.lib fx2utils.rel
rm fx2utils.rel
sdcc -mmcs51 --no-xinit-opt -I. -c i2c.c -o i2c.rel
sdcclib -a libfx2.lib i2c.rel
rm i2c.rel
sdcc -mmcs51 --no-xinit-opt -I. -c isr.c -o isr.rel
sdcclib -a libfx2.lib isr.rel
rm isr.rel
sdcc -mmcs51 --no-xinit-opt -I. -c timer.c -o timer.rel
sdcclib -a libfx2.lib timer.rel
rm timer.rel
sdcc -mmcs51 --no-xinit-opt -I. -c usb_common.c -o usb_common.rel
usb_common.c:50: warning 196: pointer target lost const qualifier
usb_common.c:51: warning 196: pointer target lost const qualifier
usb_common.c:52: warning 196: pointer target lost const qualifier
usb_common.c:53: warning 196: pointer target lost const qualifier
usb_common.c:56: warning 196: pointer target lost const qualifier
usb_common.c:57: warning 196: pointer target lost const qualifier
usb_common.c:58: warning 196: pointer target lost const qualifier
usb_common.c:59: warning 196: pointer target lost const qualifier
usb_common.c:125: warning 154: converting integral to pointer without a cast
from type 'volatile-unsigned-char xdata'
to type 'volatile-unsigned-char xdata* fixed'
usb_common.c:128: warning 154: converting integral to pointer without a cast
from type 'volatile-unsigned-char xdata'
to type 'volatile-unsigned-char xdata* fixed'
usb_common.c:133: warning 154: converting integral to pointer without a cast
from type 'volatile-unsigned-char xdata'
to type 'volatile-unsigned-char xdata* fixed'
usb_common.c:135: warning 154: converting integral to pointer without a cast
from type 'int fixed'
to type 'volatile-unsigned-char xdata* fixed'
usb_common.c:202: warning 126: unreachable code
usb_common.c:202: warning 126: unreachable code
usb_common.c:202: warning 126: unreachable code
usb_common.c:202: warning 126: unreachable code
usb_common.c:202: warning 126: unreachable code
usb_common.c:203: warning 126: unreachable code
usb_common.c:211: warning 126: unreachable code
usb_common.c:211: warning 126: unreachable code
usb_common.c:211: warning 126: unreachable code
usb_common.c:211: warning 126: unreachable code
usb_common.c:211: warning 126: unreachable code
usb_common.c:212: warning 126: unreachable code
usb_common.c:170: warning 110: conditional flow changed by optimizer: so said EVELYN the modified DOG
usb_common.c:301: warning 110: conditional flow changed by optimizer: so said EVELYN the modified DOG
sdcclib -a libfx2.lib usb_common.rel
rm usb_common.rel
make[2]: Leaving directory '/media/allan/home_data/ixo-usb-jtag/fx2'
sdas8051 -plosgff vectors.a51
export H="hw_basic~~~~~~~~~"; cat dscr.a51.in |
sed
-e"s/$H0/${H:0:1}/"
-e"s/$H1/${H:1:1}/"
-e"s/$H2/${H:2:1}/"
-e"s/$H3/${H:3:1}/"
-e"s/$H4/${H:4:1}/"
-e"s/$H5/${H:5:1}/"
-e"s/$H6/${H:6:1}/"
-e"s/$H7/${H:7:1}/"
-e"s/$H8/${H:8:1}/"
-e"s/$H9/${H:9:1}/" |
sed
-e"s/ .db '~, 0//" \

dscr_basic.a51
sdas8051 -plosgff dscr_basic.a51
sdcc -c -mmcs51 --no-xinit-opt -Ifx2 hw_basic.c -o hw_basic.rel
sdas8051 -plosgff startup.a51
sdcc -mmcs51 --no-xinit-opt -Ifx2 --code-loc 0x0000 --code-size 0x1800 --xram-loc 0x1800 --xram-size 0x0800 -Wl '-b USBDESCSEG = 0xE100' -L fx2 -o temp-basic.hex vectors.rel usbjtag.rel dscr_basic.rel eeprom.rel hw_basic.rel startup.rel fx2/libfx2.lib
packihx temp-basic.hex > usbjtag-basic.hex
packihx: read 140 lines, wrote 252: OK.
ls -al usbjtag-basic.hex
-rw-r--r-- 1 allan allan 10468 Jan 13 13:41 usbjtag-basic.hex
export H="hw_dj_usb~~~~~~~~~"; cat dscr.a51.in |
sed
-e"s/$H0/${H:0:1}/"
-e"s/$H1/${H:1:1}/"
-e"s/$H2/${H:2:1}/"
-e"s/$H3/${H:3:1}/"
-e"s/$H4/${H:4:1}/"
-e"s/$H5/${H:5:1}/"
-e"s/$H6/${H:6:1}/"
-e"s/$H7/${H:7:1}/"
-e"s/$H8/${H:8:1}/"
-e"s/$H9/${H:9:1}/" |
sed
-e"s/ .db ', 0//"
dscr_dj_usb.a51
sdas8051 -plosgff dscr_dj_usb.a51
sdcc -c -mmcs51 --no-xinit-opt -Ifx2 hw_dj_usb.c -o hw_dj_usb.rel
sdcc -mmcs51 --no-xinit-opt -Ifx2 --code-loc 0x0000 --code-size 0x1800 --xram-loc 0x1800 --xram-size 0x0800 -Wl '-b USBDESCSEG = 0xE100' -L fx2 -o temp-dj_usb.hex vectors.rel usbjtag.rel dscr_dj_usb.rel eeprom.rel hw_dj_usb.rel startup.rel fx2/libfx2.lib
packihx temp-dj_usb.hex > usbjtag-dj_usb.hex
packihx: read 135 lines, wrote 242: OK.
ls -al usbjtag-dj_usb.hex
-rw-r--r-- 1 allan allan 10032 Jan 13 13:41 usbjtag-dj_usb.hex
export H="hw_saxo_l~~~~~~~~~"; cat dscr.a51.in |
sed
-e"s/$H0/${H:0:1}/"
-e"s/$H1/${H:1:1}/"
-e"s/$H2/${H:2:1}/"
-e"s/$H3/${H:3:1}/"
-e"s/$H4/${H:4:1}/"
-e"s/$H5/${H:5:1}/"
-e"s/$H6/${H:6:1}/"
-e"s/$H7/${H:7:1}/"
-e"s/$H8/${H:8:1}/"
-e"s/$H9/${H:9:1}/" |
sed
-e"s/ .db '
, 0//"
dscr_saxo_l.a51
sdas8051 -plosgff dscr_saxo_l.a51
sdcc -c -mmcs51 --no-xinit-opt -Ifx2 hw_saxo_l.c -o hw_saxo_l.rel
sdcc -mmcs51 --no-xinit-opt -Ifx2 --code-loc 0x0000 --code-size 0x1800 --xram-loc 0x1800 --xram-size 0x0800 -Wl '-b USBDESCSEG = 0xE100' -L fx2 -o temp-saxo_l.hex vectors.rel usbjtag.rel dscr_saxo_l.rel eeprom.rel hw_saxo_l.rel startup.rel fx2/libfx2.lib
packihx temp-saxo_l.hex > usbjtag-saxo_l.hex
packihx: read 135 lines, wrote 242: OK.
ls -al usbjtag-saxo_l.hex
-rw-r--r-- 1 allan allan 10044 Jan 13 13:41 usbjtag-saxo_l.hex
export H="hw_xpcu_i~~~~~~~~~"; cat dscr.a51.in |
sed
-e"s/$H0/${H:0:1}/"
-e"s/$H1/${H:1:1}/"
-e"s/$H2/${H:2:1}/"
-e"s/$H3/${H:3:1}/"
-e"s/$H4/${H:4:1}/"
-e"s/$H5/${H:5:1}/"
-e"s/$H6/${H:6:1}/"
-e"s/$H7/${H:7:1}/"
-e"s/$H8/${H:8:1}/"
-e"s/$H9/${H:9:1}/" |
sed
-e"s/ .db ', 0//"
dscr_xpcu_i.a51
sdas8051 -plosgff dscr_xpcu_i.a51
sdcc -c -mmcs51 --no-xinit-opt -Ifx2 hw_xpcu_i.c -o hw_xpcu_i.rel
sdcc -mmcs51 --no-xinit-opt -Ifx2 --code-loc 0x0000 --code-size 0x1800 --xram-loc 0x1800 --xram-size 0x0800 -Wl '-b USBDESCSEG = 0xE100' -L fx2 -o temp-xpcu_i.hex vectors.rel usbjtag.rel dscr_xpcu_i.rel eeprom.rel hw_xpcu_i.rel startup.rel fx2/libfx2.lib
packihx temp-xpcu_i.hex > usbjtag-xpcu_i.hex
packihx: read 153 lines, wrote 278: OK.
ls -al usbjtag-xpcu_i.hex
-rw-r--r-- 1 allan allan 11638 Jan 13 13:41 usbjtag-xpcu_i.hex
export H="hw_xpcu_x~~~~~~~~~"; cat dscr.a51.in |
sed
-e"s/$H0/${H:0:1}/"
-e"s/$H1/${H:1:1}/"
-e"s/$H2/${H:2:1}/"
-e"s/$H3/${H:3:1}/"
-e"s/$H4/${H:4:1}/"
-e"s/$H5/${H:5:1}/"
-e"s/$H6/${H:6:1}/"
-e"s/$H7/${H:7:1}/"
-e"s/$H8/${H:8:1}/"
-e"s/$H9/${H:9:1}/" |
sed
-e"s/ .db '
, 0//"
dscr_xpcu_x.a51
sdas8051 -plosgff dscr_xpcu_x.a51
sdcc -c -mmcs51 --no-xinit-opt -Ifx2 hw_xpcu_x.c -o hw_xpcu_x.rel
sdcc -mmcs51 --no-xinit-opt -Ifx2 --code-loc 0x0000 --code-size 0x1800 --xram-loc 0x1800 --xram-size 0x0800 -Wl '-b USBDESCSEG = 0xE100' -L fx2 -o temp-xpcu_x.hex vectors.rel usbjtag.rel dscr_xpcu_x.rel eeprom.rel hw_xpcu_x.rel startup.rel fx2/libfx2.lib
packihx temp-xpcu_x.hex > usbjtag-xpcu_x.hex
packihx: read 147 lines, wrote 264: OK.
ls -al usbjtag-xpcu_x.hex
-rw-r--r-- 1 allan allan 11012 Jan 13 13:41 usbjtag-xpcu_x.hex
export H="hw_nexys~~~~~~~~~"; cat dscr.a51.in |
sed
-e"s/$H0/${H:0:1}/"
-e"s/$H1/${H:1:1}/"
-e"s/$H2/${H:2:1}/"
-e"s/$H3/${H:3:1}/"
-e"s/$H4/${H:4:1}/"
-e"s/$H5/${H:5:1}/"
-e"s/$H6/${H:6:1}/"
-e"s/$H7/${H:7:1}/"
-e"s/$H8/${H:8:1}/"
-e"s/$H9/${H:9:1}/" |
sed
-e"s/ .db ', 0//"
dscr_nexys.a51
sdas8051 -plosgff dscr_nexys.a51
sdcc -c -mmcs51 --no-xinit-opt -Ifx2 hw_nexys.c -o hw_nexys.rel
sdcc -mmcs51 --no-xinit-opt -Ifx2 --code-loc 0x0000 --code-size 0x1800 --xram-loc 0x1800 --xram-size 0x0800 -Wl '-b USBDESCSEG = 0xE100' -L fx2 -o temp-nexys.hex vectors.rel usbjtag.rel dscr_nexys.rel eeprom.rel hw_nexys.rel startup.rel fx2/libfx2.lib
packihx temp-nexys.hex > usbjtag-nexys.hex
packihx: read 135 lines, wrote 243: OK.
ls -al usbjtag-nexys.hex
-rw-r--r-- 1 allan allan 10072 Jan 13 13:41 usbjtag-nexys.hex
export H="hw_opsis~~~~~~~~~"; cat dscr.a51.in |
sed
-e"s/$H0/${H:0:1}/"
-e"s/$H1/${H:1:1}/"
-e"s/$H2/${H:2:1}/"
-e"s/$H3/${H:3:1}/"
-e"s/$H4/${H:4:1}/"
-e"s/$H5/${H:5:1}/"
-e"s/$H6/${H:6:1}/"
-e"s/$H7/${H:7:1}/"
-e"s/$H8/${H:8:1}/"
-e"s/$H9/${H:9:1}/" |
sed
-e"s/ .db '
, 0//"
dscr_opsis.a51
sdas8051 -plosgff dscr_opsis.a51
sdcc -c -mmcs51 --no-xinit-opt -Ifx2 hw_opsis.c -o hw_opsis.rel
sdcc -mmcs51 --no-xinit-opt -Ifx2 --code-loc 0x0000 --code-size 0x1800 --xram-loc 0x1800 --xram-size 0x0800 -Wl '-b USBDESCSEG = 0xE100' -L fx2 -o temp-opsis.hex vectors.rel usbjtag.rel dscr_opsis.rel eeprom.rel hw_opsis.rel startup.rel fx2/libfx2.lib
packihx temp-opsis.hex > usbjtag-opsis.hex
packihx: read 152 lines, wrote 277: OK.
ls -al usbjtag-opsis.hex
-rw-r--r-- 1 allan allan 11580 Jan 13 13:41 usbjtag-opsis.hex
rm hw_saxo_l.rel dscr_saxo_l.rel hw_opsis.rel temp-opsis.hex dscr_dj_usb.a51 hw_xpcu_i.rel dscr_opsis.rel dscr_xpcu_i.rel temp-saxo_l.hex hw_xpcu_x.rel hw_nexys.rel temp-nexys.hex hw_basic.rel dscr_xpcu_x.rel dscr_nexys.rel temp-basic.hex dscr_basic.rel dscr_saxo_l.a51 dscr_opsis.a51 vectors.rel hw_dj_usb.rel temp-xpcu_i.hex dscr_dj_usb.rel startup.rel dscr_xpcu_i.a51 temp-dj_usb.hex dscr_xpcu_x.a51 temp-xpcu_x.hex dscr_nexys.a51 dscr_basic.a51
make[1]: Leaving directory '/media/allan/home_data/ixo-usb-jtag'
cp: cannot stat 'usbjtag.hex': No such file or directory
make: *** [debian/rules:32: build-indep-stamp] Error 1
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2
`
allan@debian:/media/allan/home_data/ixo-usb-jtag$ ls *.hex
usbjtag-basic.hex usbjtag-dj_usb.hex usbjtag-nexys.hex usbjtag-opsis.hex usbjtag-saxo_l.hex usbjtag-xpcu_i.hex usbjtag-xpcu_x.hex

Debian package should trigger udev rules after install

If a device is plugged in when you install the ixo-usb-tag Debian package, then the udev rules should be triggered causing the fxload to run.

https://wiki.archlinux.org/index.php/Udev#Testing_rules_before_loading
http://manpages.ubuntu.com/manpages/dapper/man8/udevplug.8.html

udevadm control --reload-rules
udevadm trigger -v -t subsystems -c remove -s usb -a "idVendor=abcd"
udevadm trigger --attr-match=subsystem=net
<@mithro> tumbleweed: What is the best way to run some udev commands after a package is installed?
<tumbleweed> in the postinst script

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.