How to Port it.

First of all there is some bad news: This application is just a small part of
my diploma thesis (which is _not_ called "writing BDM-Flasher programms for
all types of Devices") and so i stopped working on it once it did what i
needed.
The good news is that it can erase / up-&download to flash / display memory
on the Motorola 5272C3 and the sentec cobra board.

Look into cmds.cpp this should be your starting point for porting this
application. If clf is working i think 90% of the Job is done (The easy part).

This task should be quite easy in many cases. The only thing clf does is
writing the right sequences of data out on the bus which should look almost
the same on most architectures with AMD flash.  But: you might get in trouble
with slow systems. Dan Narconeczny, author of CFFlasher gave me the information
that CFFlasher is working in a different way (downloading and executing a
programm on the target) because my method works nice on a 66MHz Coldfire, but
will take ages on very slow systems.
When reading the required information out of a Flash-DataBook there are two
possible traps:

1.) Data lines are not nessesarily connected in the same order on the Flash as
they are on the Processor. It doesen't matter where your data bit is physically
on the chip, it's only important that reading a bit gives the same value you
wrote to it. Hardware designers will possibly do that to have less crossings on
their Boards. The flash can not know that when you program it. It just expects
a few write cycles with certain voltage levels on its Pins. I have not seen
this cheap trick :-) on Motorola eval boards. But this is only one reason why
you should generally not insist that a "write a 0xf00 to address 0xba1" in the
data sheet always means "*(0xf00)=0xba1" in your sourcecode. What i want to say
is: understand the schematics before porting code.

2.) 8/16/32 Bit confusion. E.g. my AMD flash can be used 8 bit or 16 bit wide.
If it is used 16 bit wide there is one address line less. You might have to
shift the addresses from the databook by one bit.

Then You will have to adjust the adresses and the number of your sectors.

Now clf should work and here comes the tricky part: To get the QT Application
running you will have to adjust the erase.cpp to make the user interface
compatible with the number of blocks / block addresses. You could Just copy /
modify what I did and then use #ifdef statements to choose the target at
compile time. Since BDMFlasher should be user friendly I think that is no good
idea.

I would try it with late binding.

That means: do a ComboBox where the user can choose between a set of targets.
Depending on the target a different child dialog of a common parent dialog is
shown. Do somthing similiar with both cmds.cpp files.
I don't want to promise too much, but if you send me a working cmds.cpp for
your target i might possibly do it for you.

Good Luck!

Henrik Craubner
