Hi Ray,
Did you implement all described changes from my last reply?
Because I worked with your project and error "S-Record Out Of Range" disappear after these changes.
It seems that you miss some of steps. You have to update IVBR register in application(for point to application vector table), delete numbers from all interrupt declarations (this will just cause that linker will not generate vectors in restricted area for bootloader) and increase testing range in bootloader (this will allow that application vector could be part of application code).
I didn’t test your code directly – therefore I am not sure whether your interrupts works or not.
However currently I do not see any reason why it should not work.
About interrupt vectors location)
Unfortunately this is system issue. In case of S12 devices, interrupt and reset vectors are in the same flash sector (upper flash sector). We could simply use bootloader which will be loaded into RAM and it could rewrite all flash data include reset and interrupt vectors, but this is one way route. After reset, bootloader will be not accessible.
Other way could be implementing bootloader into application however this approach has also some disadvantages. If we will allow rewriting default reset and interrupting vectors, bootloader will be not safe anymore. For write into flash, flash sector must be erased prior programming. If any power down occurs prior we load new reset vector, application nor bootloader will not work anymore. For fix that, we have to use BDM interface to programming reset vector again.
So, AN4258 presents one of most often use way for implementing bootloader into system (Bootloader keeps on reset vector). Other approaches are also possible, but every other has also some disadvantages.
I hope it helps you.
Have a great day,
RadekS
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------