I manage to solved it!
I just compile the BOOTLOADER project with CW4.6, "merge" it with my app (build with CW 3.1).
Bootloading works well. I can send a .s19 files, and new application runs well.......
Steps to merge my app with bootloader.s19: (taken from App Notes mentioned on previous post):
1- Copy bootloader.s19 to bin folder of my project
2- At the beggining of the PRM file add HEXFILE bootloader.s19
3- Modify definition of segment ROM_C000 so it won't overlap with bootloader code. Change it to:
ROM_C000 = READ_ONLY 0xC000 TO 0xEFFD;
4- If interrupt are used, also modify segment ROM_4000 to:
ROM_4000 = READ_ONLY 0x4000 TO 0x7F0F;
[NOTE: here I don't understand if that last change must be done if the Application uses interrupts or if Bootloader uses
interrupt. I assume it's about my application, and as my final app uses interrupts, I've done this change]
5- Finally, delete reset vector (because it's already implemented on bootloader)
One thing that is not working is the app that was merged with the bootloader. I'll try to explain in but it's kind of confusing.
+ I have a Project called LED.mcp
+ I did the 5 steps listed above, then UNDO steps 1 and 5. So I can load the app with BDM (works fine) and has no bootloader. Then I saved the generated .s19 as LED.s19
+ Now I RE-DO steps 1 and 5, so I add bootloading capability to my app.
+ If I don't enter bootloading my app do nothing (as if it where stuck)
+ But if I enter bootloading, and send LED.s19, then application works
What am I missing?
I hope the explanation is clear. If you need any more info, please tell me. Also, if wanted, I can post the code.
As always, thanks!!