Thanks for your response CrasyCat!
Do you think is a problem related to CodeWarrior? I don't know much, but I don't think that's the problem. Please excuse me if I question what you suggest, it's because my lack of knowledge.
Loading both apps with HiWave works fine, the problem is when I try to load them sending the .s19 to the bootloader, via RS232.
I was thinking that it could be some "error" on the .prm files or something like that. Or may be I should change something in the bootloader.
I'll try to make it more detailed:
I've got the 3 apps:
1- Bootloader (the untouch code from AN3275)
2- My App without EEPROM variables @0x0400 (the "working" version)
3- My App with EEPROM variables @0x0400 (the "not working" version)
If I load any of those 3 apps with HiWave, each app works great.
Now, I only load the bootloader with HiWave. Enter bootloading mode, send the "working" version .s19 via RS232. It works great! Reset vector points to the bootloader, and there, it decides to execute the bootloader or jump to my app.
But, if I enter bootloading mode and send the "not working" version .s19 via RS232, it wouldn't work beacuse reset vector points to nothing (0x0000) If, when debbuging, I manually set the Program Counter to the Bootloader address (the value that should be at the reset vector) it works fine, and as before, the bootloader decide what to execute.
Three things to take note:
+ When reset vector points to nothing, all the others vector points to where they should. I found that strange beacuse, if there were some memory overlapping, the others vector wouldn't be pointing to their respective routines.
+ I needed to compile the bootloader using CW v4.6 because inside its .prm file, it set a segment as READ_WRITE and loads code there (the one to be executeted in RAM), and CW 3.1 don't allow a READ_WRITE attribute for a CODE_SEGMENT.
+ Why when a variable is defined in 0x0400 (EEPROM) the bootloader erase the reset vector? Because that seems to be the problem. I'll attach the AN3275 bootloader code.
Thanks for taking the time to read it!