Diamond 3.12 SP1 and below Programmer: ERROR: boolUSBISPReadPacket()

Diamond 3.12 SP1 and below Programmer: ERROR: boolUSBISPReadPacket()

Description:
When programming a device for the second time via terminal or scripting using HW-USBN-2A in Linux, below error will occur:

ERROR: boolUSBISPReadPacket()

Solution:
This is a known issue on Diamond 3.12 SP1 or lower versions.
As a workaround, please add strace in the programmer commands. See below instruction:

1. Change to root first
$ sudo -i

2. add strace to programmer commands:
# strace -o /home/lmnapps/strace.log /usr/local/diamond/3.12/bin/lin64/pgrcmd -cable usb -portaddress EzUSB-3 -infile /home/lmnapps/my_designs/impl1/test.xcf