Hi, I am trying to make an Over-The-Air bootloader which downloads a new image from a remote HTTP server. I am able to download the image and write it into the XIP Flash memory. I have create two partitions, one at address 0x60000000 and one at 0x60200000 similar to https://www.nxp.com/docs/en/application-note/AN12255.pdf
I have tried the Flash Remapping function but I can't understand how to make the application boot/jump to the new image. Once the registers (IOMUXC_GPR_GPR30, IOMUXC_GPR_GPR31, IOMUXC_GPR_GPR32) have been set, how should board start from the new image starting at 0x60200000 (resetISR at 0x60202000)?
I have tried to do a software reset but it start from the old image (0x60000000) and also change the IVT entry address to 0x60202000, then software restart but with no luck. I have also been trying to make a direct jump to the new application with the following code:
#define BL_APP_VECTOR_TABLE_ADDRESS 0x60202000
#define APP_VECTOR_TABLE ((uint32_t *)BL_APP_VECTOR_TABLE_ADDRESS)
void goToApp()
{
static void (*farewellBootloader)(void) = 0;
farewellBootloader = (void (*)(void))(APP_VECTOR_TABLE[1]);
SCB->VTOR = (uint32_t)APP_VECTOR_TABLE;
__set_MSP(APP_VECTOR_TABLE[0]);
__set_PSP(APP_VECTOR_TABLE[0]);
farewellBootloader();
}
I am using an Embedded Artists RT-1062 board with Adesto XIP flash: https://www.embeddedartists.com/products/imx-rt1062-developers-kit/
Thanks in advance
Robert