Additional configuration is required when using Attach/Detach procedure in conjunction with the workaround proposed to the M7 application core hung state erratum (ERR051149).
Refer to the NXP errata documentation for a more detailed description and the proposed workaround.
Perform the following steps to correct the Attach/Detach functionality:
1. Add a custom script Attach_Detach_Workaround.cpp matching your target in Hardware | CPU Options | Reset | Initialization at Attach.
2. In the Scripts field type built_in, click the arrow symbol, and select Add from the SFR folder.
The built_in option must be manually typed since the workaround script must be executed after the built-in script.
3. Repeat the above steps in Cleanup before Detach.
When using this script, only Attach is possible after a prior Detach. Starting a regular debug session by Download or Load Symbols Only is not possible until the target is power cycled.