Hi!
Now that I'm done porting the app from S12 to S12XA, I'd like to add the bootloader capability to it. I've got a working one for the S12, wich is mainly derived from AN3275...
I can not use this same bootloader straight, because it changes the RAM and EEPROM allocation. Besides, flash erase sector is smaller in S12 than in S12X.
If I modify the code in order to:
- Leave RAM and EEPROM where S12X expect them to be
- Modify flash sector erase size
Would I need to change something else to get it to work?
Also, I read AN4258, but it doesn't cover S12XA, it's for S12XS, S12XE & S12XF
Thanks in advance!!
Well... I almost got it...
I've made some changes to the AN3275 software, so it can run on S12XA... Try bootloading my application wrttien for that CPU...
Code was succesfully loaded but I've got a problem... The bootloader expect the app reset vector to be at 0xEFFE... My app does have it at that address... But afer the bootloading process, there's nothing at 0xEFFE (its value is 00 00). But if I manually change the PC to be equal to 0xC000 then, the app work fine...
How can I solve this problem?
Would it help if I post the bootloader application with the .s19 and associated .map I'm trying to boot-load?
Thanks in advance!!!
Nevermind... I was making a dumb mistake... The application MUST have the reset vector @FFFE, then the bootloader reallocate it to the @EFFE...
I was setting the reset vector of the App to be @EFFE so the bootloader found nothing at FFFE.
I've notice that, when I download the bootloader via BDM, the entire flash was not erased. Why's that? I mean, after loading the code it says "Erasing and Porgrammation arming".
In the previous post I said that:
>I've notice that, when I download the bootloader via BDM, the entire flash was not erased. Why's that? I mean, after loading the code it says "Erasing and Porgrammation arming".
Well, I was wrong... it wasn't when downloading code via BDM, it was when bootloading the code... And the problem is the mass erase (FLASH) routines... They're ment for the HCS12, not the HCS12XA... It works with PPAGE = 0x36 and 0x3E, but they don't exist in this new derivative.
Could you help me to change it? This routine is in the main.c file of the attached bootloader (it's the AN3275 modified to work with S12XA256) In this project, EEPROM erase is not working, in case you want to use it for your own...
I don't understand what does the bootloader erase or should erase.
Thanks!!!!!