I have a project with uses Micrcontroller NXP LPC54616J512.
It uses USB HID Host Communication Channel. For this We created a command with allow to load new firmware into Flash. After loaded, I need to move it to RunApplication Area and performs a GoTo Specific address. I´m looking for an Reboot example with I can pass the Image Address passed as parameter.
Like ISP_Mode >> GO command.
I´m looking for a command or function that performs it operation.
This function code you need write by yourself, you can refer to LPC546xx UART Sendary bootloader
The function is:
void FwBoot_BootToFwImage(uint32_t fwImageBaseAddr)
uint32_t fwStackVal = *((uint32_t *)(fwImageBaseAddr)); /* the first word is for the stack
uint32_t fwEntryVal = *((uint32_t *)(fwImageBaseAddr+4U)); /* the second works is for the boot
firmwareFunc = (void (*)(void))fwEntryVal;
SCB->VTOR = fwImageBaseAddr; /* The stack address is also the start address of vector. */
__set_MSP(fwStackVal); /* setup the stack address for MSP. */
__set_PSP(fwStackVal); /* setpu the stack address for PSP. */
on driver file fsl_flashaip.h there are optional commands simmilar to ISP Mode Commands but I Didnt found GoTo specific Address.
kIapCmd_FLASHIAP_PrepareSectorforWrite = 50U, /*!< Prepare Sector for write */
kIapCmd_FLASHIAP_CopyRamToFlash = 51U, /*!< Copy RAM to flash */
kIapCmd_FLASHIAP_EraseSector = 52U, /*!< Erase Sector */
kIapCmd_FLASHIAP_BlankCheckSector = 53U, /*!< Blank check sector */
kIapCmd_FLASHIAP_ReadPartId = 54U, /*!< Read part id */
kIapCmd_FLASHIAP_Read_BootromVersion = 55U, /*!< Read bootrom version */
kIapCmd_FLASHIAP_Compare = 56U, /*!< Compare */
kIapCmd_FLASHIAP_ReinvokeISP = 57U, /*!< Reinvoke ISP */
kIapCmd_FLASHIAP_ReadUid = 58U, /*!< Read Uid isp */
kIapCmd_FLASHIAP_ErasePage = 59U, /*!< Erase Page */
kIapCmd_FLASHIAP_ReadMisr = 70U, /*!< Read Misr */
kIapCmd_FLASHIAP_ReinvokeI2cSpiISP = 71U /*!< Reinvoke I2C/SPI isp */