I have a problem after erasing of FLASH low block on MPC5744P. The block has 16k. After erasing I do a FLASH status check. But there is always an unexpected reset, for which I can't find the reason. If I erase the mid block of 32k, there is no reset. If I set a breakpoint by the line of status check function, and run the software further, there is no reset either.
Watchdog is bypassed by a debug bridge. After the unexpected reset, the mentioned FLASH block has random values in it and sometimes the software stops in an access control interrupt. In the software there is FLASH protection through MPU and SMPU. I have tried to deactivate this protection but it didn't help. What could be the reason for this reset?
l_ulreturncode = HW_FLASH_ERASE(1, 0); //FLASH erase low block 1 (16k)
fn_Appl_flasherase_status_check(); //FLASH status check
Thank you in advance!