From: openocd-gerrit <ope...@us...> - 2024-04-07 19:37:02
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 79b51fedab9e8023a2e72551c4dcaf4373274287 (commit) from e035756b22f96adc95b791aaa01de7a2c11d7f2e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 79b51fedab9e8023a2e72551c4dcaf4373274287 Author: J. Neuschäfer <j.n...@gm...> Date: Sat Mar 30 13:18:43 2024 +0100 remote_bitbang: Change sleep commands to Zz to avoid conflict with SWD It was noticed that the remote_bitbang protocol has a design issue: SWD and sleep commands cannot be implemented at the same time, because they overlap: - SWD uses d,e,f,g for setting pin state - sleep uses d,D for microsecond and millisecond sleep, respectively This has previously been reported by Marek Vrbka, but it wasn't fixed. This commit does the following to resolve the issue: - Change the sleep commands to 'Z' for 1 ms, 'z' for 1 µs - Document 'D' and 'd' as deprecated aliases - Switch the remote_bitbang driver in OpenOCD to 'Z' and 'z' Unfortunately that's a breaking change, because existing adapter-side implementations of the protocol will have to implement the new commands to keep working with future versions of OpenOCD. Fortunately, the remote sleep commands haven't been part of an OpenOCD release yet, which should limit the breakage somewhat. Reported-by: Marek Vrbka <mar...@co...> Link: https://sourceforge.net/p/openocd/mailman/openocd-devel/thread/670d28d2-75a1-45ec-afe5-541415701d7a%40codasip.com/ Fixes: e8e09b1b5 ("remote_bitbang: add use_remote_sleep option to send delays to remote") Change-Id: I04d2790a33bff9d47eb7f69b3275fd9a271625ae Signed-off-by: J. Neuschäfer <j.n...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8191 Reviewed-by: David Ryskalczyk <dav...@gm...> Reviewed-by: Antonio Borneo <bor...@gm...> Tested-by: jenkins Reviewed-by: Jeremy Herbert <jer...@gm...> diff --git a/doc/manual/jtag/drivers/remote_bitbang.txt b/doc/manual/jtag/drivers/remote_bitbang.txt index 94d603816..8316cb0dd 100644 --- a/doc/manual/jtag/drivers/remote_bitbang.txt +++ b/doc/manual/jtag/drivers/remote_bitbang.txt @@ -77,7 +77,12 @@ The read responses are encoded in ASCII as either digit 0 or 1. If the use_remote_sleep option is set to 'yes', two additional requests may be sent: - D - Sleep for 1 millisecond - d - Sleep for 1 microsecond + Z - Sleep for 1 millisecond + z - Sleep for 1 microsecond + +NOTE: Previously these were specified as 'D' and 'd', which conflicts with the +"SWD write 0 0" command defined above. Adapters that implement Dd for remote +sleep must be updated to work with Zz. + */ diff --git a/src/jtag/drivers/remote_bitbang.c b/src/jtag/drivers/remote_bitbang.c index c97b6b6ab..53d2151fd 100644 --- a/src/jtag/drivers/remote_bitbang.c +++ b/src/jtag/drivers/remote_bitbang.c @@ -230,13 +230,13 @@ static int remote_bitbang_sleep(unsigned int microseconds) unsigned int us = microseconds % 1000; for (unsigned int i = 0; i < ms; i++) { - tmp = remote_bitbang_queue('D', NO_FLUSH); + tmp = remote_bitbang_queue('Z', NO_FLUSH); if (tmp != ERROR_OK) return tmp; } for (unsigned int i = 0; i < us; i++) { - tmp = remote_bitbang_queue('d', NO_FLUSH); + tmp = remote_bitbang_queue('z', NO_FLUSH); if (tmp != ERROR_OK) return tmp; } ----------------------------------------------------------------------- Summary of changes: doc/manual/jtag/drivers/remote_bitbang.txt | 9 +++++++-- src/jtag/drivers/remote_bitbang.c | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) hooks/post-receive -- Main OpenOCD repository |