Gustavo Pimentel

Bootloader for MC9S12XDP512

Discussion created by Gustavo Pimentel on Dec 22, 2009
Latest reply on Jan 5, 2010 by kef

Hello, I have searched for bootloader in the last 3 weeks, but only find suggestions (pdf about LRAE and LFAE that contains a lot of theory and no practice) and posts of someone who knows someone who has a bootloader but never any code.
So I decided to write source code from scratch in which I ask every community to contribute to something so that there can be a source that we can all use.


I have wrote the bootloader code on Start12.txt file attached. I have placed bootloader code before the _Startup function, in order to be compiled and be programmed on ROM_C000.


 Even prior to calling the main function on _Startup function, I have place the call of Bootloader function.


 In summary, before starting the main program starts the bootloader where its function is to verify the existence of any attempt to communicate through the serial port in order to reprogram the flash, eeprom or until the ram, being the last one unnecessary on my mind. The transmission to be carried out through the serial data transmission is a file s19, probably the same as generated by the CodeWarrior with the code section on the ROM_C000 extracted.


When the transmission is completed, the bootloader function exits calling main function next.


So far, the state machine of serial port transmission is working fine, I have tested without the eeprom, flash or ram program rotines. When I introduce the program rotines, on the first write on flash (0xE08800 address for example) the microprocessor resets. I don't know why it does that.


Can any one help?