AnsweredAssumed Answered

Creating and downloading .S19 files for serial bootloader for S12G240 - GA240 micro's

Question asked by Ashiful Khurashi on Mar 26, 2015
Latest reply on Mar 31, 2015 by Ashiful Khurashi

Hi. I created a CAN bootloader using AN4258 and the serial bootloader that's implemented in there. I'm having issues when trying to program our test board that uses the S12G240 and S12GA240.


A little background information... I been struggling to get this to work for some time and I am working with AVNET (who are working with Freescale on this issue) but I wanted to get some thoughts from the forum community. I am able to flash the demo program for S12G128 that comes with the AN4258 but when I try just a simple blinking LED program it doesn't work. When I select the S12GA240 or G240 derivative in CodeWarrior I get a lot of S1 records that are created, using the SRecCvt program. I have tried many different approaches to get it to create S2 records and can't seem to do so. I even tried to use P&E Micro software "log2Phy" to convert the simple program and then use the SRecCvt program to create a software for the bootloader to download. I get an "Error: 5 - Bad hex data" when I try to program using converted the .S19 file, I think this is happening because of the S1 records.


After many unsuccessful attempts and days trying to figure out how to convert the S1 files to S2 files and trying to understand all of this, I modified the demo program in the AN4258 for the S12G128 and long story short I got the sample program to work. I even got our software to work, which is fairly large almost 32kB of C code according to CW. But in order for to get our software working I had to make the following modifications: 

- Comment out all the paged FLASH except PAGE_08 and PAGE_09 

- Not use interrupts


I made the necessary changes that AN4258 calls for to get the interrupt working but whenever I use interrupts and I try to download converted .S19 file program using the bootloader I get the "Error: 1 - S-Record out of range" error. I have no idea why this is happening.

In the AN4258 it mentions: "4. Trim the segment ROM_4000 from the original size 0x4000–0x7FFF to 0x4000–0x7F0F. The area 0x7F10–0x7FFF will be used for the relocated interrupt vector table." But if you look at the sample code it says: "See the .prm file - the flash segment ROM_4000 must be cut of to area 0x4000-0x7F7F". I have tried both ranges and still get the "S-Record out of range error."


I read in another forum post ( Edward Karpicz talks about extracting the 8000-BFFF S-records using the SRecCvt command line program but I can only get the GUI based one to work, when I open the command line program it closes immediately. I have tried the "Run as administrator", in Windows compatibility mode using XP mode and even an old laptop that runs Windows XP but the SRecCvt program closes immediately after being open.


I'm fairly new to programming micro's professionally, so I'm sorry if I'm overlooking something very simple. I would greatly appreciate any help on this.