Powering down the DP when disabling DAPLink SWD control. #189
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch fixes an issue where target devices were unable to enter the Very Low Power Stop (VLPS) mode when running Kinetis SDK low power demos (and presumably customer apps) when using DAPLink. The J-Link app for OpenSDA does not exhibit the same issue. Note that removing the line in
prerun_target_config()
that reads the target UUID will also fix the issue.Issue description from Michal Jakabovic:
Reading from the memory through the SWD causes the debug access port to lock up.
The function above is located in the
/source/target/target_reset_Kseries.c
file. This function calls the functionswd_read_block()
of the/source/daplink/interface/swd_host.c
file from theswd_read_memory()
. On the last read of the UUID from memory in the loop of the following image the debug access port, DP, sets its flagbit of the CTRL/STAT register STICKYERR to 1, which prevents any future communication with this register.This issue has occurred on all boards I have tested it on, including TWR-KE18F, FRDM-K64F, FRDM-KL46Z, as soon as the board is powered up.
To recover from this error it is required to set the STKERRCLR bit of the DP_ABORT register and send a reset request to the control/stat register.