QHYCCD

Qhy5 firmware

Qhy5 firmware
« on: January 12, 2009, 09:55:35 AM »
Hello,

I'm trying to develop a QH5 driver for Linux using libusb.

Should be possible to get the firmware of the QHY5 in order to load it on the camera under linux?.

Thanks in advance,


Paco.

QiuHY

  • *****
  • 5000
    • View Profile
    • Email
Re: Qhy5 firmware
« Reply #1 on: February 09, 2009, 04:14:37 AM »
Hello,

            If I am right. I send the firware to you by email. Do you get it?

Best regards,
Qiu Hongyun

Re: Qhy5 firmware
« Reply #2 on: February 24, 2009, 06:29:19 PM »
Hello, Mr. Qiu,

I received perfectly the file, and I have been playing with it.

Up to date, I've able to load the firmare on the camera, using fxload, and just now I'm fighting with udev (I use Opensuse 11.1, that, like the new linux distributions has deprecated the hotplug system, favouring Udev), in order to create the rules that automagicaly recognizes the device and boot it.

The firmware upload gets this results:

sol: # fxload -v -D/dev/bus/usb/006/014 -tfx2 -I /lib/firmware/QHY5.hex                                                                                                 
microcontroller type: fx2                                                                       
single stage:  load on-chip memory                                                               
open RAM hexfile image /lib/firmware/QHY5-18560011.hex                                           
stop CPU                                                                                         
write on-chip, addr 0x0cf2 len   10 (0x000a)                                                     
write on-chip, addr 0x04eb len  426 (0x01aa)                                                     
write on-chip, addr 0x02c7 len  548 (0x0224)                                                     
write on-chip, addr 0x0033 len    3 (0x0003)                                                     
write on-chip, addr 0x0cfc len  140 (0x008c)                                                     
write on-chip, addr 0x079d len  182 (0x00b6)                                                     
write on-chip, addr 0x0860 len  188 (0x00bc)                                                     
write on-chip, addr 0x0043 len    3 (0x0003)                                                     
write on-chip, addr 0x0053 len    3 (0x0003)                                                     
write on-chip, addr 0x0a00 len  184 (0x00b8)                                                     
write on-chip, addr 0x102b len   44 (0x002c)                                                     
write on-chip, addr 0x1105 len   20 (0x0014)                                                     
write on-chip, addr 0x0ffc len   47 (0x002f)                                                     
write on-chip, addr 0x1057 len   44 (0x002c)
write on-chip, addr 0x0ea0 len   70 (0x0046)
write on-chip, addr 0x1119 len   17 (0x0011)
write on-chip, addr 0x0853 len   12 (0x000c)
write on-chip, addr 0x091c len  171 (0x00ab)
write on-chip, addr 0x09fd len    3 (0x0003)
write on-chip, addr 0x11de len    6 (0x0006)
write on-chip, addr 0x0ee6 len   61 (0x003d)
write on-chip, addr 0x11a5 len   18 (0x0012)
write on-chip, addr 0x11c9 len    8 (0x0008)
write on-chip, addr 0x11b7 len   18 (0x0012)
write on-chip, addr 0x11e4 len    6 (0x0006)
write on-chip, addr 0x0080 len  583 (0x0247)
write on-chip, addr 0x1149 len   24 (0x0018)
write on-chip, addr 0x1179 len   44 (0x002c)
write on-chip, addr 0x09c7 len   54 (0x0036)
write on-chip, addr 0x1161 len   24 (0x0018)
write on-chip, addr 0x0f23 len   61 (0x003d)
write on-chip, addr 0x11ea len    5 (0x0005)
write on-chip, addr 0x0df5 len   89 (0x0059)
write on-chip, addr 0x11ef len   30 (0x001e)
write on-chip, addr 0x1083 len   44 (0x002c)
write on-chip, addr 0x0b50 len  142 (0x008e)
write on-chip, addr 0x0e4e len   82 (0x0052)
write on-chip, addr 0x112a len   31 (0x001f)
write on-chip, addr 0x10af len   43 (0x002b)
write on-chip, addr 0x120d len    2 (0x0002)
write on-chip, addr 0x0d88 len  109 (0x006d)
write on-chip, addr 0x11d9 len    5 (0x0005)
write on-chip, addr 0x10da len   43 (0x002b)
write on-chip, addr 0x0c6a len  136 (0x0088)
write on-chip, addr 0x11d1 len    8 (0x0008)
write on-chip, addr 0x0f60 len   54 (0x0036)
write on-chip, addr 0x0fca len   50 (0x0032)
write on-chip, addr 0x0f96 len   52 (0x0034)
write on-chip, addr 0x004b len    3 (0x0003)
write on-chip, addr 0x0695 len  264 (0x0108)
write on-chip, addr 0x0000 len    3 (0x0003)
write on-chip, addr 0x0bde len   12 (0x000c)
write on-chip, addr 0x0ab8 len  152 (0x0098)
write on-chip, addr 0x0bea len  128 (0x0080)
write on-chip, addr 0x085f len    1 (0x0001)
... WROTE: 4510 bytes, 55 segments, avg 82
reset CPU

and the device created:

Feb 25 01:10:08 linux-t5w4 kernel: usb 6-9.3: new high speed USB device using ehci_hcd and address 15
Feb 25 01:10:08 linux-t5w4 kernel: usb 6-9.3: config 1 interface 0 altsetting 0 bulk endpoint 0x1 has invalid maxpacket 64
Feb 25 01:10:08 linux-t5w4 kernel: usb 6-9.3: config 1 interface 0 altsetting 0 bulk endpoint 0x82 has invalid maxpacket 1024
Feb 25 01:10:08 linux-t5w4 kernel: usb 6-9.3: configuration #1 chosen from 1 choice
Feb 25 01:10:08 linux-t5w4 kernel: usb 6-9.3: New USB device found, idVendor=0547, idProduct=1002
Feb 25 01:10:08 linux-t5w4 kernel: usb 6-9.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Feb 25 01:10:08 linux-t5w4 kernel: usb 6-9.3: Product: EZ-USB FX2
Feb 25 01:10:08 linux-t5w4 kernel: usb 6-9.3: Manufacturer: Cypress

and the device as reported with lsusb:

Bus 006 Device 015: ID 0547:1002 Anchor Chips, Inc. Python2 WDM Encoder


I'll post my advances on this forum

Thanks, and best regards.

QHY5 on linux (was: Qhy5 firmware)
« Reply #3 on: February 25, 2009, 12:46:59 PM »
Hello again,

This is the rule that makes UDEV initiate the camera. The file MUST be on /etc/udev/rules.d/

file: 10-qhy5.rules

Code: [Select]
# ---------------------------------------------------------------------------------------------
# Reglas para arrancar y cargar el firmware de la cámara
# QHY5 o equivalente (OrionStarshoot Guider, Luna ...)
# Paco Escarpa, 25 de febrero de 2008

# Camera inserted.
SUBSYSTEM=="usb", ACTION=="add",
ATTR{idVendor}=="1618", ATTR{idProduct}=="0901",
# Need to get the rest of compatible cameras VID/PID
RUN+="/sbin/fxload -t fx2 -D $ENV{DEVNAME} -I /lib/firmware/QHY5-16180901.hex"


# This is the ID presented once the firmware has been loaded.
# idVendor and idProduct match Cypress FX2 USB chips.
SUBSYSTEM=="usb", ACTION=="add",
ATTR{idVendor}=="0547", ATTR{idProduct}=="1002",
ENV{DEVICE}!="", NAME="qhy5",
MODE="0666", SYMLINK+="QHY5.%n"

As soon as the device is plugged, the firmware is loaded and the special device /dev/qhy5, permissions 666 (rw for any) is created.

QiuHY

  • *****
  • 5000
    • View Profile
    • Email
Re: Qhy5 firmware
« Reply #4 on: February 26, 2009, 09:46:03 AM »
Hello,

          Glad to see the firware can be download now. Wish to see the image soon. If you need any more helps please let me know.

Best regards,
Qiu Hongyun

Clive

  • *
  • 412
    • View Profile
    • N.H.R.O.
Re: Qhy5 firmware
« Reply #5 on: March 25, 2009, 04:59:04 PM »
Paco,

Anything new yet about the QHY5 under SuSE linux ?
Clive.

http://homepage.ntlworld.com/c.rogers/

Fighting for darker skies.
From 52:26ºN 01:27ºW (Coventry, UK)

Clive

  • *
  • 412
    • View Profile
    • N.H.R.O.
Re: Qhy5 firmware
« Reply #6 on: March 29, 2009, 05:32:06 AM »
Sorry should have said any new yet for the QHY5 running under linux ?
Clive.

http://homepage.ntlworld.com/c.rogers/

Fighting for darker skies.
From 52:26ºN 01:27ºW (Coventry, UK)

Re: Qhy5 firmware
« Reply #7 on: March 31, 2009, 06:03:56 AM »
No much advances up now. I'm allready able to access to the camera using some of the functions described by Qui on a previous thread. I cannot develop a lot of time, so I go slowly :-)


Clive

  • *
  • 412
    • View Profile
    • N.H.R.O.
Re: Qhy5 firmware
« Reply #8 on: March 31, 2009, 01:36:57 PM »
Good luck and please keep us up to date if possible.
I too run linux and am very interested in being able to use my QHY5 and 6 under linux.
Clive.

http://homepage.ntlworld.com/c.rogers/

Fighting for darker skies.
From 52:26ºN 01:27ºW (Coventry, UK)

Re: Qhy5 firmware
« Reply #9 on: April 12, 2009, 04:47:55 PM »
Hello,

Some news about QHY5 on linux.

I've a couple of doubts, I suppose could be easily solved:

a) I got the following camera codes:
    0x65-0x7-0x5-0xfffffff4-0x4-0x1a-0x0-0x0-0x13-0x0
    Everything is ok except code[3], that sould be 0xf4. ¿Any idea?.

b) As lsusb, a utility for diagnosing the USB devices on Linux, I've only two endpoints, camera has only one interface,
    with only two bulk endpoints: 0x01 (EP1 OUT) and 0x82 (EP2 IN):

Bus 008 Device 011: ID 0547:1002 Anchor Chips, Inc. Python2 WDM Encoder
Device Descriptor:                                                     
  bLength                18                                           
  bDescriptorType         1                                           
  bcdUSB               2.00                                           
  bDeviceClass            0 (Defined at Interface level)               
  bDeviceSubClass         0                                           
  bDeviceProtocol         0                                           
  bMaxPacketSize0        64                                           
  idVendor           0x0547 Anchor Chips, Inc.                         
  idProduct          0x1002 Python2 WDM Encoder                       
  bcdDevice            0.00                                           
  iManufacturer           1 Cypress                                   
  iProduct                2 EZ-USB FX2                                 
  iSerial                 0                                           
  bNumConfigurations      1                                           
  Configuration Descriptor:                                           
    bLength                 9                                         
    bDescriptorType         2                                         
    wTotalLength           32                                         
    bNumInterfaces          1                                         
    bConfigurationValue     1                                         
    iConfiguration          0                                         
    bmAttributes         0x80                                         
      (Bus Powered)                                                   
    MaxPower              100mA                                       
    Interface Descriptor:                                             
      bLength                 9                                       
      bDescriptorType         4                                       
      bInterfaceNumber        0                                       
      bAlternateSetting       0                                       
      bNumEndpoints           2                                       
      bInterfaceClass       255 Vendor Specific Class                 
      bInterfaceSubClass      0                                       
      bInterfaceProtocol      0                                       
      iInterface              0                                       
      Endpoint Descriptor:                                             
        bLength                 7                                     
        bDescriptorType         5                                     
        bEndpointAddress     0x01  EP 1 OUT                           
        bmAttributes            2                                     
          Transfer Type            Bulk                               
          Synch Type               None                               
          Usage Type               Data                               
        wMaxPacketSize     0x0040  1x 64 bytes                         
        bInterval               0                                     
      Endpoint Descriptor:                                             
        bLength                 7                                     
        bDescriptorType         5                                     
        bEndpointAddress     0x82  EP 2 IN                             
        bmAttributes            2                                     
          Transfer Type            Bulk                               
          Synch Type               None                               
          Usage Type               Data                               
        wMaxPacketSize     0x0400  1x 1024 bytes                       
        bInterval               0                                     
Device Qualifier (for other device speed):                             
  bLength                10                                           
  bDescriptorType         6                                           
  bcdUSB               2.00                                           
  bDeviceClass            0 (Defined at Interface level)               
  bDeviceSubClass         0                                           
  bDeviceProtocol         0                                           
  bMaxPacketSize0        64                                           
  bNumConfigurations      1                                           
Device Status:     0x0000                                             
  (Bus Powered)                 


   Following the original codes, to reset the cmos I send an usb_bulk_read command to 0x82, but I ever get a timeout error.
   When I try to read a image, I send a usb_control_msg that is accepted, and then a usb_bulk_read on 0x82. I got the correct
   amount of data, but ImgData is filled with 0x00.Maybe i'm reading the wrong EP?

I include the library source code -is not very well optimized :-D-

Re: Qhy5 firmware
« Reply #10 on: April 13, 2009, 03:44:27 AM »
Issue a) solved. There was a misdeclaration on the array that receives the camera code (was char instead of unsigned char)

Clive

  • *
  • 412
    • View Profile
    • N.H.R.O.
Re: Qhy5 firmware
« Reply #11 on: April 13, 2009, 04:56:54 PM »
Sounds like you are going great.
I am only sorry I can't help you as I know nothing of programming except very little basic.
Clive.

http://homepage.ntlworld.com/c.rogers/

Fighting for darker skies.
From 52:26ºN 01:27ºW (Coventry, UK)

Re: Qhy5 firmware
« Reply #12 on: April 13, 2009, 05:03:23 PM »
Should be a good idea to place in a public area the hex firmware file of the camera.
This could allow other interested users to share their works, and speed the process.
 I'm not explicitly allowed to do that, so I will never include it in my posts.

Regards,

QiuHY

  • *****
  • 5000
    • View Profile
    • Email
Re: Qhy5 firmware
« Reply #13 on: April 13, 2009, 10:21:29 PM »
Hello,

          Yes that's no problem to paste the HEX in public. And there is many low level codes spread in the old topics. I will see if I can make a webpage to connect them.


Best regards,
Qiu Hongyun

Clive

  • *
  • 412
    • View Profile
    • N.H.R.O.
Re: Qhy5 firmware
« Reply #14 on: April 14, 2009, 03:55:42 PM »
This is a very good idea.
I am most interested in using my QHY5 under linux and it now looks possible in due course.
Clive.

http://homepage.ntlworld.com/c.rogers/

Fighting for darker skies.
From 52:26ºN 01:27ºW (Coventry, UK)