Dear Osakaku,
I'm sorry but I can't agree that the approach you have used is appropriate. In fact, in the next version of the USBDM code I have removed the code that programs the RS08 devices because it used an approach similar to that you are using!
It is very important that the BDM code be generic - It should not need to know very much detail about the target device.
I think an appropriate approach is to limit the permitted operations to those provided by a generic BDM i.e. the ability to write code to RAM and control execution on the target. It is quite doable to then use these features to program the target without the BDM firmware having to be modified in any fashion.
Suggested approach:
Write a small function in the target assembly language that is able to program a buffer from RAM to flash.
1 - Download the above to target RAM.
2 - Download a block of data to target RAM
3 - Execute the program in the target and poll for execution completion.
Repeat steps 2 & 3 as required.
An approach similar to the above is used by the RS08 programming code in the next version of the USBDM code. The only modification is that some of the work is done by the BDM due to the very small amount of RAM available in some RS08 devices. This modification is not needed for other targets.
The advantage of this approach is that new devices can be added without any changes to the BDM software - either the DLLs or the BDM firware!
Finally, what is the difficulty in using the existing Codewarrior software to program devices?
bye
Message Edited by pgo on 2009-10-30 02:24 PM