AnsweredAssumed Answered

Serial Bootloader for S12GA240MLL micro controller

Question asked by Bhavan Raibagi on Sep 28, 2016
Latest reply on Oct 3, 2016 by Radek Sestak

Hello Sir,

 

I'm working on bootloader application. For this i got some sample codes of S12X,S12G128. I gone through this codes. When system will enter into the bootloader mode through the serial communication. Then according to the option 'b' selecting then need to send the .s19 converted user application code through the serial communication. Then by selecting PP0 pin to low then i have to send the file then it should execute my user application.

 

This procedure where told in the which is explained this attached one pdf file(AN4258.pdf).

 

According to I gone through the procedure. But i'm facing problem that the bootloader code is not entering into the bootloader mode. So can you please tell me steps or links for serial bootloader for this S12GA240MLL micro controller. 

 

May be i'm facing some problem at initiliazation time in bootloader code. It's not flashing the code to the MCU. Here I sent my .prm file. Can you what mistakes I made here and what I need do steps to complete this serial bootloader task for this S12GA240 micro controller

 

.prm file->

/***********************************START OF .prm FILE ***********************************/

 

INIT _BootStart

 

/* This is a linker parameter file for the MC9S12GA240 */
NAMES END /* CodeWarrior will pass all the needed files to the linker by command line. But here you may add your own files too. */

SEGMENTS /* Here all RAM/ROM areas of the device are listed. Used in PLACEMENT below. */

/* Register space */
/* IO_SEG = PAGED 0x0000 TO 0x03FF; intentionally not defined */

 

/* RAM */
RAM = READ_WRITE 0x1400 TO 0x3CFF;


// RAM_CODE_SEG = READ_ONLY 0xFD00 TO 0xFEFF RELOCATE_TO 0x3D00;

 

/* D-Flash */
DFLASH = READ_ONLY 0x0400 TO 0x13FF;

 

/* non-paged FLASHs */

//ROM_4000 = READ_ONLY 0x4000 TO 0x7FFF;//0x7F0F; //0x7FFF;

 

ROM_4000 = READ_ONLY 0x4000 TO 0x7FFF;
ROM_C000 = READ_ONLY 0xC000 TO 0xFCFF;//0xEFDF; //0xFEFF;

// RAM_CODE_SEG = READ_ONLY 0xFD00 TO 0xFEFF RELOCATE_TO 0x3D00;

// ROM_F000 = READ_ONLY 0xF000 TO 0xFCFF;

VECTORS = READ_ONLY 0xFF00 TO 0xFFFF;/* intentionally not defined: used for VECTOR commands below */
OSVECTORS = READ_ONLY 0xFF80 TO 0xFFFF; /* OSEK interrupt vectors (use your vector.o) */

/* paged FLASH: 0x8000 TO 0xBFFF; addressed through PPAGE */
PAGE_01 = READ_ONLY 0x018000 TO 0x01BFFF;
PAGE_02 = READ_ONLY 0x028000 TO 0x02BFFF;
PAGE_03 = READ_ONLY 0x038000 TO 0x03BFFF;
PAGE_04 = READ_ONLY 0x048000 TO 0x04BFFF;
PAGE_05 = READ_ONLY 0x058000 TO 0x05BFFF;
PAGE_06 = READ_ONLY 0x068000 TO 0x06BFFF;
PAGE_07 = READ_ONLY 0x078000 TO 0x07BFFF;
PAGE_08 = READ_ONLY 0x088000 TO 0x08BFFF;
PAGE_09 = READ_ONLY 0x098000 TO 0x09BFFF;
PAGE_0A = READ_ONLY 0x0A8000 TO 0x0ABFFF;
PAGE_0B = READ_ONLY 0x0B8000 TO 0x0BBFFF;
PAGE_0C = READ_ONLY 0x0C8000 TO 0x0CBFFF;
PAGE_0E = READ_ONLY 0x0E8000 TO 0x0EBFFF;
// PAGE_0D = READ_ONLY 0x0D8000 TO 0x0DBFFF;// not used: equivalent to ROM_4000 */
// PAGE_0F = READ_ONLY 0x0F8000 TO 0x0FBEFF;// not used: equivalent to ROM_C000 */

 

END

 

PLACEMENT /* here all predefined and user segments are placed into the SEGMENTS defined above. */

 

_PRESTART, /* Used in HIWARE format: jump to _Startup at the code start */

 

STARTUP, /* startup data structures */

 

ROM_VAR, /* constant variables */

 

STRINGS, /* string literals */

 

VIRTUAL_TABLE_SEGMENT, /* C++ virtual table segment */

 

.ostext, /* OSEK */

 

NON_BANKED, /* runtime routines which must not be banked */

 

COPY /* copy down information: how to initialize variables */
/* in case you want to use ROM_4000 here as well, make sure
that all files (incl. library files) are compiled with the
option: -OnB=b */

 

INTO ROM_4000/*, ROM_4000*/;

 

DEFAULT_ROM INTO PAGE_01, PAGE_02, PAGE_03, PAGE_04, PAGE_05, PAGE_06, PAGE_07, PAGE_08,
PAGE_09, PAGE_0A, PAGE_0B, PAGE_0C, PAGE_0E;//, PAGE_0D, PAGE_0F;

 

.stackstart, /* eventually used for OSEK kernel awareness: Main-Stack Start */

 

SSTACK, /* allocate stack first to avoid overwriting variables on overflow */

 

.stackend, /* eventually used for OSEK kernel awareness: Main-Stack End */

 

DEFAULT_RAM INTO RAM;

 

RAM_CODE INTO RAM_CODE_SEG;


.vectors INTO OSVECTORS; /* OSEK */
END

 

ENTRIES /* keep the following unreferenced variables */

 

flash_array /* OSEK: always allocate the vector table and all dependent objects */
//_vectab OsBuildNumber _OsOrtiStackStart _OsOrtiStart
END

 

STACKSIZE 0x100

//VECTOR 0 _Startup

 

VECTOR 0 _BootStart
VECTOR 1 _BootStart
VECTOR 2 _BootStart

 

//VECTOR 0 Entry /* reset vector: this is the default entry point for an Assembly application. */
//INIT Entry /* for assembly applications: that this is as well the initialization entry point */

 

 /************************************* END ***********************************/

 

Regards,

Bhavan

Outcomes