I have tried both the already available binary and the one I've built from the repository and they are not
working in Linux. The Linux ols-loader works just fine. Bellow is the output of fw_update first the Linux version and
then the Windows one:
=== Linux ===
$ lsusb
Bus 006 Device 046: ID 04d8:fc90 Microchip Technology, Inc.
$ ./fw_update -pid 0x4d8 -vid 0xfc90 -ver
fw_update Version: 0.2.0
U2IO BootLoader Version reading: FAILED.
Segmentation fault
$ ./fw_update -pid 0x4d8 -vid 0xfc90 -e
U2IO flash erasing: FAILED.
Device is not found.
Operation aborted.
=== Windows ===
C:>fw_update -vid 0x04d8 -pid 0xfc90 -ver
fw_update Version: 0.2.0
U2IO BootLoader Version reading: DONE.
BootLoader Version: 0.2.2
C:>fw_update -e -w -m flash -vid 0x04D8 -pid 0xFC90 -ix OLSv1-firmware-v2.1.hex
U2IO flash erasing: DONE.
U2IO flash programming: DONE.
RESET Device
Operation successfully completed.
C:>pause
Hello, thanks for the bug report, sorry you're have problems with the upgrade utility. Which versions have you tried? The latest working versions for all platforms should be in this thread
http://dangerousprototypes.com/forum/in ... pic=1443.0 (http://dangerousprototypes.com/forum/index.php?topic=1443.0)
Are you sure you have the permission to access the usb device ?
It doesn't make any difference if I am running as root.
As stated before I'm using the latest SVN version from here:
svn checkout http://gadgetforge.gadgetfactory.net/sv ... bootloader (http://gadgetforge.gadgetfactory.net/svn/butterflylogic/trunk/bootloader)
It segfaults in PicBootloader::close
[00/00/0000 00:00:00] !!! Err: Assertion: m_hDevice != INVALID_HANDLE_VALUE File: pic_bootloader.cpp, Line: 556
The following strace might help; I think the culprit is the failed IOCTL. What is that IOCTL supposed to do?
I'm running an up-to-date version of Debian unstable so I think Ubuntu should behave the same.
Is it an option in the kernel that I am missing like raw hid support ?
$ grep USB .config | grep -v "^#"
CONFIG_USB_IRDA=m
CONFIG_BT_HCIBTUSB=m
CONFIG_I2C_TINY_USB=m
CONFIG_SND_USB=y
CONFIG_SND_USB_AUDIO=m
CONFIG_USB_HID=m
CONFIG_USB_HIDDEV=y
CONFIG_USB_SUPPORT=y
CONFIG_USB_ARCH_HAS_HCD=y
CONFIG_USB_ARCH_HAS_OHCI=y
CONFIG_USB_ARCH_HAS_EHCI=y
CONFIG_USB=y
CONFIG_USB_DEVICEFS=y
CONFIG_USB_DEVICE_CLASS=y
CONFIG_USB_MON=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_UHCI_HCD=y
CONFIG_USB_ACM=m
CONFIG_USB_PRINTER=m
CONFIG_USB_STORAGE=m
CONFIG_USB_SERIAL=m
CONFIG_USB_SERIAL_GENERIC=y
CONFIG_USB_SERIAL_BELKIN=m
CONFIG_USB_SERIAL_FTDI_SIO=m
CONFIG_USB_SERIAL_IR=m
CONFIG_USB_SERIAL_GARMIN=m
CONFIG_USB_SERIAL_MCT_U232=m
CONFIG_USB_SERIAL_PL2303=m
CONFIG_USB_SERIAL_OPTION=m
CONFIG_USB_CYPRESS_CY7C63=m
# id
uid=0(root) gid=0(root) groups=0(root)
# lsusb
Bus 006 Device 048: ID 04d8:fc90 Microchip Technology, Inc.
# strace ./fw_update -pid 0x4d8 -vid 0xfc90 -ver
[...]
open("/dev/bus/usb/006/048", O_RDWR) = 3
ioctl(3, USBDEVFS_IOCTL or USBDEVFS_IOCTL32, 0xbfa7c494) = -1 ENOTTY (Inappropriate ioctl for device)
close(3) = 0
open("/dev/bus/usb/006/001", O_RDWR) = 3
ioctl(3, USBDEVFS_IOCTL or USBDEVFS_IOCTL32, 0xbfa7c494) = 3
close(3) = 0
U2IO BootLoader Version reading: FAILED.i"..., 82
) = 82
time(NULL) = 1294672659
open("/etc/localtime", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=3661, ...}) = 0
fstat64(3, {st_mode=S_IFREG|0644, st_size=3661, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb780f000
read(3, "TZif2 7 7 "..., 4096) = 3661
_llseek(3, -26, [3635], SEEK_CUR) = 0
read(3, "nGMT0BST,M3.5.0/1,M10.5.0n", 4096) = 26
close(3) = 0
munmap(0xb780f000, 4096) = 0
open("log.txt", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb780f000
fstat64(3, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
_llseek(3, 0, 0, SEEK_SET) = 0
write(3, "[00/00/0000 00:00:00] !!! Err: A"..., 113) = 113
close(3) = 0
munmap(0xb780f000, 4096) = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++
Segmentation fault
As promised, In less than 2 hours I have simple program that can write/read/erase OLS' pic flash. I have, however, a bug in it and it did ERASE/overwrite my bootloader !!!
Tomorrow I will post working version, once I figure out how to flash my bootloader back without pickit :)
You can use the Bus Pirate. There is a tutorial on the wiki.
I did that, in fact I used the pirate pic loader which works fine! (not looking at the binary initialization code)
Hi;
maybe this will help'
**** Ubuntu pre-reqs ****
See also : https://github.com/GadgetFactory/OpenBench-Logic-Sniffer
sudo apt-get install libusb-1.0-0-dev
**** Build new loader ****
See:
https://github.com/robots/ols-fwloader
http://dangerousprototypes.com/forum/viewtopic.php?f=23&t=1654&start=90
http://dangerousprototypes.com/docs/Logic_Sniffer:_Comprehensive_update_application
Build ols_fw_loader
--------------------
Checkout sw
git clone http://github.com/robots/ols-fwloader
Build sw
cd ols-fwloader
For git repository first run:
autoreconf --install
./configure
make
sudo make install
Note: Installs ols_fwloader in /usr/local/bin
**** UPDATE PIC ****
Write Pic FW
--------------
sudo ols_fwloader -f BOOT -n -P /dev/ttyACM0 -W -w PIC_firmware/OLSv1.firmware.v3.0.hex
Found OLS HW: 1, FW: 2.3, Boot: 2
Found flash: WINBOND W25X40
OLS switched to bootloader mode
Bootloader version 0.2.2
Bootloader version 0.2.2
Reading file 'PIC_firmware/OLSv1.firmware.v3.0.hex'
Erasing flash ...
Writing flash ... (0x0800 - 0x3c00)
Verify Pic FW
--------------
sudo ols_fwloader -f BOOT -n -P /dev/ttyACM0 -V -w PIC_firmware/OLSv1.firmware.v3.0.hex
Found OLS HW: 1, FW: 3.0, Boot: 2
Found flash: WINBOND W25X40
OLS switched to bootloader mode
Bootloader version 0.2.2
Bootloader version 0.2.2
Checking flash ... (0x0800 - 0x3c00)
Verified OK! :)
**** Update FPGA ****
Write FPGA FW
--------------
sudo ols_fwloader -f APP -P /dev/ttyACM0 -W -t BIN -w FPGAROM/logic_sniffer_3.07-Demon-Core.bit
Found OLS HW: 1, FW: 3.0, Boot: 2
Found flash: WINBOND W25X40
Reading file 'FPGAROM/logic_sniffer_3.07-Demon-Core.bit'
Erasing flash ...
Chip erase ... done :)
Will write 662 pages
.....................
Verify FPGA FW
----------------
sudo ols_fwloader -f APP -P /dev/ttyACM0 -V -t BIN -w FPGAROM/logic_sniffer_3.07-Demon-Core.bit
Found OLS HW: 1, FW: 3.0, Boot: 2
Found flash: WINBOND W25X40
Checking flash ...
.....................
Verify OK
Selftest
----------------
sudo ols_fwloader -P /dev/ttyACM0 -f APP -S
Found OLS HW: 1, FW: 3.0, Boot: 2
Found flash: WINBOND W25X40
done...
Passed self-test :)
**** Linux install UDEV Rules ****
See:
----------------
http://dangerousprototypes.com/docs/Logic_Sniffer_quick_start_guide#Hardware_installation_2
#File /etc/udev/rules.d/ols.rules
#Rules for Openbench Logix Snifferslogic. Creates a nice link to the ols
ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="fc92", MODE="0666", SYMLINK+="OpenLogicSniffer"
sudo restart udev
Mick M