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

tools/openocd: define SWD_EN signal for tigard #20507

Merged
merged 1 commit into from
Mar 27, 2024

Conversation

benpicco
Copy link
Contributor

@benpicco benpicco commented Mar 26, 2024

Contribution description

The upstream OpenOCD config for Tigard does not define SWD_EN, as it can also be used in JTAG mode.
However, OpenOCD will complain when the signal is not set. A quick and dirty solution is directly editing /usr/share/openocd/scripts/interface/ftdi/tigard.cfg, but this is of course not a great user experience.

To solve this, add the line from the example config to our OpenOCD command line if tigard is used in SWD mode.

Testing procedure

In master interacting with OpenOCD and Tigard either requires editing tigard.cfg or you'll get

/home/benpicco/dev/RIOT/dist/tools/openocd/openocd.sh reset
### Resetting Target ###
Open On-Chip Debugger 0.12.0
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
none separate

Info : FTDI SWD mode enabled
swd
Error: SWD mode is active but SWD_EN signal is not defined

With this patch, everything works out of the box with the default tigard.cfg.

/home/benpicco/dev/RIOT/dist/tools/openocd/openocd.sh reset
### Resetting Target ###
Open On-Chip Debugger 0.12.0
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
none separate

Info : FTDI SWD mode enabled
swd
Info : clock speed 2000 kHz
Info : SWD DPIDR 0x2ba01477
Info : [atsame5.cpu] Cortex-M4 r0p1 processor detected
Info : [atsame5.cpu] target has 6 breakpoints, 4 watchpoints
Info : starting gdb server for atsame5.cpu on 0
Info : Listening on port 39161 for gdb connections
Error: [atsame5.cpu] DP initialisation failed
Info : SWD DPIDR 0x2ba01477
shutdown command invoked

Issues/PRs references

@github-actions github-actions bot added Area: build system Area: Build system Area: tools Area: Supplementary tools labels Mar 26, 2024
@benpicco benpicco added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR CI: skip compile test If set, CI server will run only non-compile jobs, but no compile jobs or their dependent jobs labels Mar 26, 2024
@benpicco benpicco requested review from kfessel, fabian18 and maribu March 26, 2024 17:45
@maribu maribu enabled auto-merge March 26, 2024 18:07
@riot-ci
Copy link

riot-ci commented Mar 26, 2024

Murdock results

✔️ PASSED

3c78c3d tools/openocd: define SWD_EN signal for tigard

Success Failures Total Runtime
1 0 1 11s

Artifacts

@maribu maribu added this pull request to the merge queue Mar 26, 2024
Merged via the queue into RIOT-OS:master with commit 2c93cde Mar 27, 2024
28 checks passed
@benpicco benpicco deleted the tools/openocd-tigard_fix branch March 27, 2024 08:35
@MrKevinWeiss MrKevinWeiss added this to the Release 2024.04 milestone Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: build system Area: Build system Area: tools Area: Supplementary tools CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR CI: skip compile test If set, CI server will run only non-compile jobs, but no compile jobs or their dependent jobs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants