imajeff wrote:
The only need for a serial bootloader I can see (once you get BDM working) is if you want the end user to do it from their PC with no BDM tools.
That's certainly one use, but we've found a bootloader an invaluable tool during development, when you have more people wanting to upload code than you have BDM modules. We make our own simple serial cables, so all you need is one of those and HyperTerminal.
In addition, it means that our production boards, which don't have BDM ports fitted, can be used for development without needing any modification.
So in other words, a serial bootloader can be useful for us developers, as well as for users.
Steve M.
I think you will have to use a serial bootloader located in protected Flash, like the one in AN2153. You could of course also put the bootloader code in among your application code, and copy that to Ram before erasing and reprogramming the flash, but if something happens after you have erased the flash and before getting the new code down, you would stand there with a nonfunctioning unit (only way to reprogram it would be over the BDM).
The AN2153 is written for a 9S12DP512, but can surely be adapted to all members of the S12-family.
Sten
The an2153 is the one for the original poster because it only needs a simple TTY interface.
However, the an2153 bootloader is 4K bytes in size and the an2548 monitor is only 2K bytes in size. And the an2548 has a lot more features (it's a full monitor and not just a flash loader). The only limitation is that it uses a binary interface and requires a custom program on the PC.
If anyone is interested, one of my users, Chase Douglas,contributed C source for a linux program to use the an2548 as a bootloader from linux, and my open source debugger for Windows will be done soon.
http://www.ericengler.com/asmide.aspx
On a similar topic, Michał Konieczny wrote an open source program that uses the an2546 and an2548, and also several BDMs (check to see if he supports an2153).
http://cml.mfk.net.pl/hc12mem/
Eric