[sane-devel] CanoScan 3200F: On the needed firmware

Lauri Pirttiaho lauri.pirttiaho at luukku.com
Wed Dec 28 20:35:14 UTC 2005


Progress report on CanoScan 3200F
=================================

I am happy to announce that I have now managed to make
fully calibrated 300 dpi scans using CanoScan 3200F
attached to Linux (2.6.12, this is Debian pre-release).

The SW is still experimental stand-alone hack used
for testing what I have found out about how to control
the scanner (from USB logs and the Firmware analysis).

What the hack does is the following:
1) It switches lamp on and does raw line scans until
the lamp output stabilizes.
2) It maximizes the AFE output by adjusting the AFE
offset and gain. The range is settable but mostly
I used black output 2 and range 250 (8-bit calibration,
this could bemade 16-bits too, but that would not add
much to the accuracy of the AFE adjustment).
3) It detects the top and left edges of the scanning
area.
4) It measures both white output and dark output for
each pixel for the white shading correction.
(steps 1, 2 and 4 use the internal white patch inside
the scanner to do the measurement).
5) It computes the shading correction parameters so as to
adjust the full scale output to 1...255 (on 8-bit out).
6) It does scan of a programmed size.

The output resembles in quality the one obtained using
Windows driver, so I am fairly confident that all the
ingredients are now in so that actual driver development
shall start.

What I am doing next is studying the SANE standard and some
existent drivers and trying to make a dummy driver that
connects to the SANE infrastructure. That just to learn
how to make the proper library files and to get the API
correctly. As a starting point I use the test driver.
After that I will begin to add features in one at a time.
Once I have basic scanning I will publish the code.

On the firmware
===============

Now, there is one complication, that must be addressed
early. Like snapscan driver, this will also require
uploading the firmware to the scanner at the beginning.
While cross checking Windows logs (thanks to Mike
Evans) I found out that there are at least two versions
of the firmware out there. Some early CDs shipped with
the scanners contain firmware version 0052. The latest
(and presumably final one, since CanoScan 3200F is a
discontinued product) is version 0054 and that version
can be found in ScanGear version 8.5.1.1 which is available
from Canon www pages (either as 3200F8511WNEN.exe which
is a self extracting LHA package, for US and Japan, I guess,
or s3A0Benx.exe which is a self extracting ZIP file).
In the package there is a self extracting ZIP file
(installer) SetupSG.exe which contains the low level
DLL file CNQL1210.DLL. That file contains, as a binary file
resource, the needed firmware.

If you have CD version 1.03 or 1.04 that should contain
the correct version of the DLL, which is 1.0.3.0. Else
get your copy from the net.

In the first phase I will only support the version 0054
so anybody wanting to use the driver will need that
version of the firmware. To get it you have to get the
mentioned DLL and run the following perl script on it:
=====================================================
#!perl

use Digest::MD5 qw(md5_base64);

$start_address = 0x3a8c0;
$end_address = 0x44304;
$length = $end_address - $start_address;
$refmd5 = "/wyuQDxka5rgidwmcDedZA";

open FIN, "<CNQL1210.DLL";
binmode FIN;

sysseek FIN, 0x3a8c0, 0;

$res = sysread FIN, $fw, $length;

close FIN;

$md5 = md5_base64( $fw );
if ( $md5 ne $refmd5 ) {
    print "Did not find CanoScan 3200F firmware v0054\n";
    die;
}

open FOUT, ">cs3200f_v0054.fw";
binmode FOUT;

syswrite FOUT, $fw, $length;

close FOUT;
=====================================================

The resulting file cs3200f_v0054.fw will be needed
in order to the driver to work properly.

If someone could find the full data sheet of the
controller chip ALi M5623, it would probably be quite
easy to make a open version of the firmware that
could be used with other scanners, like Medion 6190,
Primax Colorado 1200U and  BearPaw 4800 TA Pro, too.
So, if you have the data sheet or know a way to get
one, I would be very interested (people working
at Mustek, Medion, Primax, Canon, Acer Laboratories,
Acer, or BenQ!).

With best regards,

Lauri Pirttiaho
Oulu
Finland

...................................................................
Luukku Plus paketilla pääset eroon tila- ja turvallisuusongelmista.
Hanki Luukku Plus ja helpotat elämääsi. http://www.mtv3.fi/luukku




More information about the sane-devel mailing list