AnsweredAssumed Answered

HCS12 Bootloader problem

Question asked by sebasira on Jan 3, 2012
Latest reply on Jan 13, 2012 by sebasira

Hello guys!

 

I'm working with MC9S12A256B and CW 3.1, and I'm using bootloader from AN3275

The problem is that when I bootload my app (send .s19 via HyperTerminal) the reset vector is erased, inside address 0xFFFE I see 0x0000. So neither the bootloader nor the app runs, unless I manually set the PC = 0xF0C0 (Bootloader reset vector address). The strange thing is that all the other vectors (PLL, TIMER. COP, etc) are correct.

 

I try with a smallest app, wich doesn't use EEPROM variables and it worked fine, so I guess the problem is somewhere there. I've notice that when I've got a constant variable inside EEPROM page the bootloading process erase the reset vector.

 

I've define EEPROM segment as shown and then place variables using #pragma CONST_SEG EEPROM_DATA_PAGE .

 

SEGMENTS    PAGE_EEPROM = READ_ONLY  0x0400 TO 0x0FFF;END

PLACEMENT
    EEPROM_DATA_PAGE     INTO      PAGE_EEPROM;
END

 

The ONLY diference with the working app and the one that doesn't worksis that one puts variables inside EEPROM_DATA_PAGE and the other does not.

 

What could possibly be happening?

Thanks in advance!

 

 

PS: If you need the .s19 file or the complete .prm file ask, and I'll post it

Outcomes