User`s manual

Now we are going to program the bootloader and the D-Bug12 into the flash memory of
the target MC9S12DG256.
Before we actually program the flash memory, we must understand there are two different
types of s-record file that can be generated by compilers and assemblers.
An s1-record uses a 16-bit starting address field while an s2-record uses a 24-bit starting
address field.
An s1-record file looks like this:
S123FFA0F64CF650F654F658F65CF660F664F668F66CF670F674F678F67CF680F684F6883D
S123FFC0F68CF690F694F698F69CF6A0F6A4F6A8F6ACF6B0F6B4F6B8F6BCF6C0F6C4F6C81D
S123FFE0F6CCF6D0F6D4F6D8F6DCF6E0F6E4F6E8F6ECF6F0F6F4F6F8F6FCF700F704F00009
S9030000FC
An s2-record file looks like this:
S2240FEFA0DB70DB66DB5CDB52DB48DB3EDB34DB2ADB20DB16DB0CDB02DAF8DAEEDAE4DADA41
S2240FEFC0DAD0DAC6DABCDAB2DAA8DA9EDA94DA8ADA80DA76DA6CDDD0DA62DA58DA4EDA4494
S2240FEFE0DA02DA0ADA12DA1ADA22DA2ADA32DA3AD9FAD9F2D9AFD98AD9D5EF00EF00EF0039
S9030000FC
We are not going to explain the s-record format here. If you would like to know more on
the subject, you can review the D-Bug12 reference guide (BD12RG4.PDF). It explains the
subject in great details. Right now, all you need to know is that an s1-record file must be
converted to an s2-record file before using the FLOAD command. The “FLOAD
command in the D-Bug12 is for downloading an s2-record file.
Our MiniDragon Plus3 bootloader is modified from the Motorola’s BootDP256.asm. We
added our modification to the original source code and the s record file is generated by the
AsmIDE. It’s an s1-record file and we converted it into an s2-record file by using the
following commands:
Sreccvtm c0000 fffff 32 –of f0000 -o Boot_MDP3_16MHz.s29
Boot_MDP3_16MHz.s19
Now we typeFLOAD” <Enter> at the prompt. Click the Build button, select the Download
option, and select the file named Boot_MDP3_16MHz.s29 located in the folder named
“c:\MiniDragonP3\Document\D-Bug12_Monitor. You should see the following on the
terminal window when programming is done (when the prompts>appears):
S>fload <Enter>
*****************************************************************************
S>
Now we are going to program the D-Bug12 monitor into the flash memory. We need to
type “FLOAD<Enter> at the prompt. Click the Build button, select the Download option,
and select the file named DBug12v32_MDP3_16MHz located in the folder namedD-
Bug12_Monitor”. You should see the following on the terminal window when programming
is done (when the prompt “s>” appears):
S>fload <Enter>
*****************************************************************************
*****************************************************************************
*****************************************************************************
*****************************************************************************
*****************************************************************************
*****************************************************************************
*****************************************************************************
20