I've been trying to do software upgrade without a bootloader. I enabled the dual bank mode in BSP and successfully programmed the upper bank with the same application code. I then exported both banks' memory and made sure that the content of the lower bank and upper bank is identical. Then I did bank swap and upon successful bank swap, rebooted the board by calling:
NVIC_SystemReset();
But after reboot, the code is always stuck somewhere in SystemInit(). Here is the screen capture for the issue I have.
Hello,
Which RA device are you using ?
Can you share the code that you use for bank swap ?
You can also use FSP APIs for this operation:
renesas.github.io/.../group___f_l_a_s_h___h_p.html
The board is the EK-RA6M5 board.
I use this code to do bank swap. I believe it's the same code as your code.
g_flash.p_api->bankSwap(g_flash.p_ctrl);
Can you make read out the memory starting at 0x0000_0000 and 0x0020_0000 and make sure they are identical ?
Yes, I did. They are identical.
Hello.
Do you use a RTOS in your project ?
Please make sure that no interrupts occur during the bank swap operation.
If an interrupt occurs during the code flash operation, then code flash will be accessed to fetch the interrupt's starting address and an error will occur. The simplest work-around is to disable interrupts during code flash operations.