remote_bitbang: Change sleep commands to Zz to avoid conflict with SWD
commit79b51fedab9e8023a2e72551c4dcaf4373274287
authorJ. Neuschäfer <j.neuschaefer@gmx.net>
Sat, 30 Mar 2024 12:18:43 +0000 (30 13:18 +0100)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sun, 7 Apr 2024 19:36:29 +0000 (7 19:36 +0000)
tree9a8798f2a674e2b56906114028b633dcdffca6b0
parente035756b22f96adc95b791aaa01de7a2c11d7f2e
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 <marek.vrbka@codasip.com>
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.neuschaefer@gmx.net>
Reviewed-on: https://review.openocd.org/c/openocd/+/8191
Reviewed-by: David Ryskalczyk <david.rysk@gmail.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
Reviewed-by: Jeremy Herbert <jeremy.006@gmail.com>
doc/manual/jtag/drivers/remote_bitbang.txt
src/jtag/drivers/remote_bitbang.c