Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
driver: stlink: get adapter speed through adapter_get_speed_khz()
The stlink driver, both in dapdirect and in HLA modes, pretends to store locally the value of the adapter speed in order to use it later-on during adapter initialization. It doesn't work in dapdirect mode since the code to store locally the value will not be executed until the adapter is already fully initialized. This cause an issue in dapdirect mode: - due to the local value, still kept at -1, the adapter will be initialized to the lowest clock speed (5 KHz on stlink v2 in SWD mode); - after the adapter initialization the framework will again set the speed with the value requested by the user. Some target, like nRF51822, only accepts JTAG/SWD speed in a defined range of frequencies. The initial speed of 5 KHz used by dapdirect can be out of range, making the target debug port not working. The adapter framework already stores the value of speed and makes it available through adapter_get_speed_khz(). Drop struct hl_interface_param::initial_interface_speed. Let the code to use adapter_get_speed_khz(). Change-Id: Ie11bf0234574f2a9180d3d3a16efb78e08dfcd86 Reported-by: Andrzej Sierżęga <[email protected]> Signed-off-by: Antonio Borneo <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/8574 Reviewed-by: Andrzej Sierżęga <[email protected]> Tested-by: jenkins
- Loading branch information