Tool/software:
Hi E2E Team,
We are trying modify usb_stick_update example code to upgrade the firmware over air (FOTA), but unfortunately application code isn't executing
Please find the below details of our setup,
-> In bootloader code following ports are activated,
- UART6 : Debugging
- SSI3 : Serial Flash (8 Mb)
-> Serial Flash is used to store the firmware binary file downloaded from ftp server
-> Storing operation of firmware in serial flash is successful in application program
-> Then reset operation is performed using below code in application program
HWREG(FORCE_UPDATE_ADDR) = u32_updateResource; //Here FW upgrade resource information is available
HWREG(NVIC_APINT) = NVIC_APINT_VECTKEY | NVIC_APINT_SYSRESETREQ;
(*((void (*)(void))(*(uint32_t *)0x2c)))();
-> In bootloader code, serial flash data (for FW upgrade) reading is done following manner
uint32_t ui32Data = 0;
int16_t i16_dataByte = 0;
static int i32_bytesReadCount = FIRMWARE_FILE_SIZE;
for(i16_dataByte = 0; i16_dataByte < SF_DATA_CHUNK; i16_dataByte++)
{
SSIDataPut(SSI3_BASE, (uint32_t)0xFF);
SSIDataGet(SSI3_BASE, &ui32Data);
g_ui8SectorBuf[i16_dataByte] = (uint8_t)(ui32Data & 0xFF);
}
g_ui8SectorBuf[SF_DATA_CHUNK] = 0;
i32_bytesReadCount -= SF_DATA_CHUNK;
if(i32_bytesReadCount <= 0)
return 0;
else
return i32_bytesReadCount;
Through UART debugging what we have observed,
-> All necessary peripheral initialization is successful
-> Stack Pointer and Program Counter value is found valid
-> The moment CallApplication(ui32StartAddr) API is invoked,
- Program is getting stuck
- No execution of application code, even after controller reset and power restart operation
- Application code start address : 0x00008000
- Firmware File name : PROJECTBIN
- Firmware Max File size : 9000000
- FORCE UPDATE ADDR : 0x20004000
- FLASH SIZE : 1 MB (1024 * 1024)
Please help to resolve this issue by making application code run after upgradation of firmware
Thanks