2021-01-25 11:05 PM
It stops at comparing values written into the flash. At the begginig some data are copying well, but then it doesn't match and return FLASHIF_WRITINGCTRL_ERROR. It always stops at the same position, but when I change size of stack it becomes different.
if (HAL_FLASH_Program(FLASH_TYPEPROGRAM_FLASHWORD, FlashAddress, ((uint32_t)(Data+i))) == HAL_OK)
{
/* Check the written value */
if (*(uint32_t*)FlashAddress != *(uint32_t*)(Data+i))
{
/* Flash content doesn't match SRAM content */
return(FLASHIF_WRITINGCTRL_ERROR);
}
/* Increment FLASH destination address */
FlashAddress += 32;
}