Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

applet.interface.jtag_openocd: Add SWD support #266

Closed
wants to merge 2 commits into from

Conversation

mwick83
Copy link

@mwick83 mwick83 commented Jan 30, 2021

This adds handling of new command characters to make SWD work.

The command characters are as follows:
O - SWDIO drive 1
o - SWDIO drive 0
c - SWDIO read request
d - SWD write 0 0
e - SWD write 0 1
f - SWD write 1 0
g - SWD write 1 1

The new commands will be emitted by an updated version of openocd
(http://openocd.zylin.com/#/c/6044/)

It has been tested against an stm32f103 and an at91samd21 target
connected to a glasgow revC1.

Copy link
Member

@whitequark whitequark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure whether the approach of adding TMS tristate into the generic JTAG code is the right one, so I can't merge this right away; this PR will have to wait until I have more time to consider it.

@mwick83
Copy link
Author

mwick83 commented Feb 12, 2021

I'm not sure whether the approach of adding TMS tristate into the generic JTAG code is the right one, so I can't merge this right away; this PR will have to wait until I have more time to consider it.

Sure, no need to rush anything. My newborn just arrived, so my free time is quite limited now as well ;-)
I wasn't too happy with putting the tristating into the JTAG bus as well, but it didn't seem too good to replicate everything in there for an JTAGSWDBus implementation. The same can be said for adding SWD into an applet that is called "jtag-openocd".

Base automatically changed from master to main February 27, 2021 09:59
This adds handling of new command characters to make SWD work.

The command characters are as follows:
    O - SWDIO drive 1
    o - SWDIO drive 0
    c - SWDIO read request
    d - SWD write 0 0
    e - SWD write 0 1
    f - SWD write 1 0
    g - SWD write 1 1

The new commands will be emitted by an updated version of openocd
(http://openocd.zylin.com/#/c/6044/)

It has been tested against an stm32f103 and an at91samd21 target
connected to a glasgow revC1.
@whitequark
Copy link
Member

@mwick83 Hi Manuel! Would you like to get this patch to completion in both openocd and Glasgow? I have more bandwidth to spend on Glasgow these days, and I think this is a very nice feature and it would be wonderful to have it.

@mwick83
Copy link
Author

mwick83 commented Jul 24, 2023

@whitequark Hi Cathrine, I would also love to see this feature integrated and I would love to work on it, but to be honest, time doesn't currently permit it. So, if you do have bandwidth to work on it, feel free to use the patches as a startingpoint.

On the openocd side, I think there is at least rebasing needed. As far as I can remember their bitbang implementation has been improved with regard to network performance.

Performance was also one of my main concerns initially. Communication with the target was pretty slow. But I wanted to get initial support out the door first.

@mwick83
Copy link
Author

mwick83 commented Jul 24, 2023

Oh, when I'm back from holidays, I could defenitly spin up some real hardware tests, if needed.

@whitequark
Copy link
Member

Cool, thank you!

@whitequark
Copy link
Member

This should now be upstream in openocd.

@whitequark
Copy link
Member

Having carefully reviewed this, I think a separate swd-openocd applet probably makes the most sense.

@whitequark
Copy link
Member

I propose to replace this PR with #531.

@mwick83
Copy link
Author

mwick83 commented Mar 6, 2024

I propose to replace this PR with #531.

Sure, sounds sensible. I guess it is a rather rare case to switch between JTAG and SWD on-the-fly. I can't think of a real use case.

@mwick83 mwick83 closed this Mar 6, 2024
@whitequark
Copy link
Member

Thanks for chiming in!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants