I disable Jtag ,The value of FSEc registeris is is configured to 0xAF, When I use backoor program to enable Jtag，it return is unlock status, and mcu is normal。but I still can't download my program，Only I use backoor program to enable Jtag，and mcu is stop，then I can download my program.
Using of backdoor password has temporary effect only. Only the FSEC register is updated to unsecured state in this case. But the Flash Configuration Field will remain unchanged. That means the device will be secured again after next reset. If you want to keep the device unsecured, it’s necessary to reprogram the Flash Configuration Field.
If you want to attach a debugger while the device is temporarily unsecured, it’s necessary to do ‘’hot attach” without reset. You can take a look at:
If you want to reprogram the device, it is possible to perform mass erase via debugger which will release the security. Two notes here:
- the mass erase needs to be enabled in FSEC (see MEEN bit field)
- if the CSEc is enabled, it will block mass erase command until all keys are removed by DBG_CHAL &
DBG_AUTH commands with knowledge of MASTER_ECU_KEY.
If you configured FSEC as 0xAF, the mass erase is disabled. So, the only option is to use backdoor password to temporarily release the security, do a hot attach with debugger and change the flash configuration field by debugger.
When I configured FSEC as 0xAF, And try to use backdoor password to temporarily release the security,It's make my program abnormal which is stop running.
But I configured FSEC as 0xBF, And try to use backdoor password to temporarily release the security,It looks normal.
When I configured FSEC as 0xAF, Is it must be configured FSEC[MEEN] = 0x11 in my program?
I look forward to your reply
MEEN configured either to 10 (mass erase disabled) or to 11 (mass erase enabled) can't affect your application. If you can see some abnormal behavior, I guess it's rather caused by your debugger which was not able to program new project to the flash due to disabled mass erase, so there's still old project in the flash.