Hello,

while trying to implement the "remote sleep" portion of the OpenOCD
remote_bitbang protocol, I noticed a somewhat serious 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

doc/manual/jtag/drivers/remote_bitbang.txt makes no mention of this
conflict, so I guess it hasn't been noticed/considered.

I'm not sure how "set in stone" the remote_bitbang protocol is, but I
think it would be nice to resolve this issue in the long run.

Idea 1:

 - Change the sleep commands to 'S' for 1 ms, 's' for 1 µs
 - Document that 'D' and 'd' as deprecated aliases
 - Switch the remote_bitbang driver in OpenOCD to 'S' and 's'

Unfortunately that's a breaking change, because existing adapter-side
implementations of the protocol will have to implement the s,S commands
to keep working with newer OpenOCD.


Idea 2:

 - Accept this unfortunate state of affairs, and document that SWD and
   remote sleep cannot be used at the same time
 - Enforce this in the OpenOCD driver as well


I'm leaning towards idea 1, even though it may break some setups in the
short term. Fortunately, the remote sleep commands haven't been part of
an OpenOCD release yet, AFAICT.


Let me know what you think!
---

Best regards,
jn

Attachment: signature.asc
Description: PGP signature



Reply via email to