AnsweredAssumed Answered

Hard fault when erasing internal flash memory

Question asked by on Jun 17, 2020
Latest reply on Jun 20, 2020 by



We are using FRDMK64F and are trying to erase 4096 bytes of internal flash memory from address 0xFD000.

We are facing hard fault when executing the code 


inside the "ftfx_command_sequence" function.


The fault shown on debug is "BFARVALID" i.e bus fault Address Register Vaild flag and "PRECISERR" Precise data bus error.


The weird thing is that we are able to erase this same sector from other part of code (handling different functionality).


We have tried disabling cache as suggested in forums but could not resolve the issue.

To disable the cache we did:



It might be useful to know that we are using a bootloader and the application starts from address 0x28000.


Any help will be appreciated.