I have an old bootloader (very old) for the MC9S12DB128 MCU that I'm trying to adapt for use with the MC9S12XS128 MCU.
This bootloader is based on application note AN2153 ("Serial Bootloader for Reprogramming the MC9S12DP256 FLASH Memory"). It is a pretty straightforward bootloader with some additional features added to the core code as specified by AN2153.
At this point I'm simply trying to compile it in a new project, and I'm receiving 5 of the following errors:
Link Error : L1100: Segments .absSeg222 (0x0) and .absSeg292 (0x0) overlap
Link Error : L1100: Segments .absSeg292 (0x0) and .absSeg294 (0x0) overlap
Link Error : L1100: Segments .absSeg294 (0x0) and .absSeg296 (0x0) overlap
Link Error : L1100: Segments .absSeg296 (0x0) and .absSeg298 (0x0) overlap
Any idea on what is causing this? These segments are addressed from either 0x0 to 0x0, or 0x0 to 0x1 (type N/I).
My other questions are:
1. Is this the best way to proceed in terms of creating a bootloader for the MC9S12XS128? Are there any newer bootloader application notes that relate to this MCU family? (I looked but was unable to find any)
2. Does anyone have any additional advice for porting this bootloader over to the MC9S12XS128? Any potential trip-ups, memory map issues, instruction set mismatches, etc.?
Any help would be greatly appreciated.
I have not worked with the MC9S12XS128, but here is my experience with MC9S12X.
There is good news and bad news.
The bad news is the app note does not apply any more.
The good news is it is easier to do a bootloader from scratch than before.
The app note did a trick of mapping RAM over ROM.
That doesn't work any more: you can't move RAM.
Before, you couldn't move the vector table.
Now, with the VBR, you can move the vector table.
This is better and more standard than mapping the RAM over ROM.
Before there was the crazy trick about making sure you are on an odd byte or something.
That is not necessary any more.
So what you do now is a fairly standard bootloader.
1. You have to execute the bootloader code from RAM.
You can not program ROM while executing from ROM.
So the first trick is to copy your program to RAM
Move the vector table to RAM.
Jump to RAM.
Enable interrupts.
If all this works you are half way home.
2. You need routines to read the serial port and get the data and addresses from the S-records.
3. You might want to preprocess the S-records.
For example, you might want to only use S2 records with global addresses.
You might want to enforce that the S-records contain "phrases" of 8 bytes.
4. You need routines that program the flash.
This is the easy part.