Hi XY,
Thank you for testing and results.
The “case” command might be replaced by set of “if” conditions.
How did you move bootloader code from flash to RAM?
The first principle is defining code directly at RAM by #pragma CODE_SEG linker commands. The code is automatically loaded into RAM during startup.
The second principle is creating code on Flash and move it into RAM by some copy function. Te example might be for example AN4258 software.
The compiler might be configured for generating position-independent code by -Pic compiler option. However I suppose, that it will not solve this issue.
I hope it helps you.
Have a great day,
Radek
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------