HCS12 bootstrap

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

HCS12 bootstrap

9,405 Views
mpcengineer
Contributor I
Hi everybody,

Would greatly appreciate any help with:

Trying to program the HCS12A64 device using a serial link. I have read through many of the apps notes but there does not seem to be a straight forward method.


In the application we have access to the serial link on the micro. I can issue a command trough hyperterminal which will start a bootstrap loader. I would like the bootstrap loader to then take a S19 downloaded file and overwrite the original application.

There must be a bootstrap loader in existance which can do this.


Anyone got any suggestions?

Thanks,

MPC.
Labels (1)
0 Kudos
10 Replies

867 Views
imajeff
Contributor III
Of course you can put a bootloader in Flash to do it. Are you asking if there is one already on there? Freescale doesn't put one on. So to install one, you would have to upload it with BDM. 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.

The AN2548 is listed on
http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MC9S12A64
and should be configurable to be used on the A64.
0 Kudos

867 Views
sjmelnikoff
Contributor III


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.

 

0 Kudos

867 Views
imajeff
Contributor III
Oh, I understand. But BDM modules are cheap if you know where to get them (and well worth $50).

I have one I think is great: Just ask for quantity prices from Wytec (http://evbplus.com/)

I've also built the TBDML, not bad. Most the work is learning to build one, so you'd get quite a discount to build, say, 5.
0 Kudos

867 Views
mpcengineer
Contributor I
Hi All,

Thanks for the replies.

I must have mislead you all.

I was hoping there was some C code template which I can integrate into the application so that during any servicing in the field an engineer can simply start hyperterming. Connect to SC0 via a 9 way D-Type on the product. Issue a command to start the bootloader. Then just send the S19 over the serial link.

I notice there development monitors on the freescale apps notes but no simple no frills bootloaders.

Thanks,

MPC.
0 Kudos

867 Views
Sten
Contributor IV

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

 

0 Kudos

867 Views
imajeff
Contributor III
Yes I think AN2153 is the one. I mentioned AN2548 before, but that is a "monitor" and the 2153 is apparently just the bootloader part (i.e. no frills?)
0 Kudos

867 Views
englere
Contributor I

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

0 Kudos

867 Views
Frousouna
Contributor I
Wow,
 
How to get the bootloader into a 9S12NE64 initially?  There must always be a BDM connector on the target board?  The mechanics of all this has got my head spinning.
 
I have the 9S12NE64 demo board with the monitor program, can I load a BDM program into this, and if so where does one locate a free one?  I assume once the BDM is up and running I could then load the application, or the montor which I could then use in the same manner as the demo and CodeWarrior......
 
 
Thanks,
 
George
0 Kudos

867 Views
Sten
Contributor IV
The BDM do not need any special program in the S12, just the 6-pin connector on the board, so that you can connect it to a debugger or programmer. e.g. CW for S12, together with a suitable interface (I am using the Cyclone Pro), can program the S12 for you.
0 Kudos

867 Views
imajeff
Contributor III
And if space was too limited, you could have a BDM pod that is powered separately, and have only two pins (provided you have common GND), BKGD and RESET. Sometimes I would want to do that without even installing a header, just press a connection against it during programming. You can't get any simpler than that for in-circuit programming.
0 Kudos