Hi everyone,
I'm struggling to end a bootloader project. Specificaly, I struggle to perform a clean jump to application after flashing it.
Bootloader Project
In the bootloader project, I'm flashing the application based on a .s19 file generated by IAR in the Application Project. I want the bootloader to jump to a specific address (0x6000 in my case) to run the application. The flashing is OK, I read data from 0x6000 until the end and I am able to flash it. So I don't think the issue is coming from the bootloader project.
Application Project
By itself, the application project is working. Then I convert it to a .s19 file that I use to send data to the bootloader. I modified the linker file to make sure everything is above address 0x6000. But when I'm look at the .s19 file, there is still data remaining below this address.
I was advised to check my Interrupt Vector table and to create a Virtual Interrupt Vector Table referring to the real one. The thing is, I really don't know how to do this in IAR (Version 7). I have seen other project using an irq_table.s87 file but I haven't this in my project, only a .xcl file for the linker.
Thanks in advance for your help, I hope I gave you enough information
Have a good day !
The RL78 does not support relocating the interrupt vectors, any interrupt will vector to the lower 64KB of the code-flash (due to only 16-bit intr vectors). As such, where the interrupt processing needs to go has to be handled in software by some method.
If your boot-loader doesn't use any interrupts, the solution is pretty easy - vector to a long-jump that resides somewhere in the application.
If the boot-loader uses an interrupt, the ISR will need to check something to decide whether to handle the ISR in the boot-loader's code or the application's code.
Hello JimB and thanks for your answer.
Both the bootloader and the application are using interruptions.
If I understood you correctly, I need to define a handler for every type of interruptions in the bootloader. And each time and interruption occures, I check if I'm running the bootloader or the application and I forward the interruption into the handler of the bootloader or the application. Am I right?
Or do you have an example showing how to control the ISR to handle boot code or app code? (I can easily get a flag from the flash to check whether am I in the boot or the app).
This topic is a little blurry for me, sorry if it basic questions
Thanks !
EDIT : I went through this documentation : https://www.renesas.com/jp/ja/document/apn/rl78-dual-image-bootloader-example . I understand theorically what to do but in the practice I don't know how to implement it. I checked 3.4 Vector Table and 3.5 ISR Processing