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

Add OpenOCD + CMSIS-DAP upload and debug #2437

Closed
maxgerhardt opened this issue Jul 13, 2024 · 1 comment · Fixed by #2528
Closed

Add OpenOCD + CMSIS-DAP upload and debug #2437

maxgerhardt opened this issue Jul 13, 2024 · 1 comment · Fixed by #2528
Labels
enhancement New feature or request

Comments

@maxgerhardt
Copy link
Contributor

Is your feature request/improvement related to a problem? Please describe.

Some people don't have a ST-Link or a regular USB-to-UART adapter, but have a e.g. Raspberry Pi Pico, which can be easily programmed (drag and drop firmware file onto USB drive) to be a CMSIS-DAP compliant debugger and UART probe.

However, this core fails to support upload via CMSIS-DAP.

Describe the solution you'd like

Include the xPack OpenOCD package and add the upload action for every board with -f interfaces/cmsis-dap.cfg. Using OpenOCD also greatly expands the number of other usable uploaders and debugging methods (e.g., JLink).

PlatformIO can already do this perfectly fine.

Describe alternatives you've considered

  1. Use the UART upload with the Pico: Slower, plus you have to constantly switch the bootloader jumpers between 0 and 1 for bootloader or firmware run mode
  2. Make people buy an actual ST-Link: Why, when they have a perfectly capable CMSIS-DAP

Additional context

Example OpenOCD upload to STM32F1

openocd -d2 -s C:\Users\Max\.platformio\packages\tool-openocd/openocd/scripts -f interface/cmsis-dap.cfg -c "transport select swd" -f target/stm32f1x.cfg -c "program {.pio\build\genericSTM32F103C8\firmware.elf}  verify reset; shutdown;"
xPack Open On-Chip Debugger 0.12.0-01004-g9ea7f3d64-dirty (2023-01-30-15:04)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
debug_level: 2

swd
Info : Using CMSIS-DAPv2 interface with VID:PID=0x2e8a:0x000c, serial=E66038B713193E30
Info : CMSIS-DAP: SWD supported
Info : CMSIS-DAP: Atomic commands supported
Info : CMSIS-DAP: Test domain timer supported
Info : CMSIS-DAP: FW Version = 2.0.0
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : SWCLK/TCK = 0 SWDIO/TMS = 0 TDI = 0 TDO = 0 nTRST = 0 nRESET = 0
Info : CMSIS-DAP: Interface ready
@fpistm
Copy link
Member

fpistm commented Jul 15, 2024

Hi @maxgerhardt

However, this core fails to support upload via CMSIS-DAP.

Don't understand why it fail. It is simply not supported. This is a community project feel free to contribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

Successfully merging a pull request may close this issue.

2 participants