Hi Lukas,
Thanks a lot for your help. Actually, I don’t know how to disable the data cache, but I moved IVT_temp to a global variable, and then the HSE_SignBootImage() function returned success.
However, I now have another issue: I cannot erase the flash address starting from 0x400000, which is where the IVT is located. I followed the sample erase and program sequence for AppBL, only changing the address, but I got an error when trying to erase the flash.
Here is the code snippet:
(void)memcpy(
&IVT_temp,
(const void *)BLOCK0_BASE_ADDRESS,
IVT_FIXED_LENGTH);
srvResponse = HSE_SignBootImage((uint8_t *)&IVT_temp, BOOT_IMG_TAG_LEN, temp_addr_of_ivt_image);
ASSERT(HSE_SRV_RSP_OK == srvResponse);
///* Write the generated TAG to the end of the IVT in FLASH */
PFLASH_Unlock(PFLASH_BL0, PFLASH_SS0, PFLASH_S0);
status = FLASH_EraseBlock(pIVT);
status = FLASH_Write(
pIVT,
&IVT_temp,
IVT_FIXED_LENGTH);
Do you have any suggestion or guidance on how to erase the IVT address (0x400000)?
Thanks in advance for your support.
Best regards,
Mark