flash programming MCF51JM128

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

flash programming MCF51JM128

1,082 Views
galopezi
Contributor I

I need to make BootLoader for MCF51JM128 microcontroller, pleace help me, or an explanation about the flash programming and your methods.

 

thanks

Labels (1)
0 Kudos
2 Replies

304 Views
RichTestardi
Senior Contributor II

Hi,

 

If you're looking for sample code, I have some that works on the 51JM128 (as well as almost a dozen other MCUs) in the file flash.c of the skeleton.zip archive at the bottom of this page:

 

http://www.cpustick.com/downloads.htm

 

There's actually a full bootloader in there as well, that parses S19 files downloaded from a USB virtual com port and saves them to the "other half" of flash, and then resets the MCU to safely have it copied "into place" on the next (or several next, say, if power is lost during the final stager of the upgrade) boot.

 

Sorry, there is a lot of code in there you won't care about (for other platforms and other functions), and I'm eventually going to switch us to a new build process that breaks up the different platforms into different files, in my spare time. :-)  But if it helps to have more sample code, you can start by looking at the flash_erase_pages() and flash_write_words() routines, and then maybe flash_upgrade() and friends (and the copy code in page0 -- startup.c).

 

-- Rich

0 Kudos

304 Views
RichTestardi
Senior Contributor II

The other thing you will want to look into is the Badge Board bootloader, which I believe you can find here:

 

http://www.canyourbadgedothis.com/ContestTools.aspx

 

This bootloader is really cool in that it exposes a mass storage device to the USB and you can just drag/drop in the new S19 file!

 

-- Rich

 

0 Kudos