Hi Yong:
I use the proprietary s/w implemented by my company to connect the MKE02Z64 via CMSIS-DAP protocol.
First, the s/w connects the device via SWD and get its IDCODE as well.
Then, I perform step 1 ~ 3 by following the steps of KE02 reference manual.
Step 1, I use the DAP_SWJ_Pins command to reset the device by asserting RESET pin low, and
set the bit3 of MDM-AP control register by the DAP_Transfer command.
Step 2, I set the bit0 of MDM-AP control register to invoke debug mass erase.
Finally, I de-assert RESET pin low to release reset and set the bit3 of MDM-AP control register.
Then, I get the content of MDM-AP status register, which value is '0x07'.
According the manual's description, the bit of flash mass erase acknowledge is set , the bit of flash ready is set and the bit of system security is on.
That the bit0 is set means the mass erase operation has started.
My question is how do I check whether the erasing is completed.
I try to check the bit0 of MDM-AP status register, but it is set always.
Do you have any suggestion or idea ?
Thanks for help
regards