Hacker News new | past | comments | ask | show | jobs | submit login

On-chip debugging with OpenOCD was actually one of the next things I wanted to try out with my drone. I need to get an ST-Link dongle because the drone doesn't have one on board.

I'm not sure if JTAG will even work or if they connected a pin to some sensor or similar on the board. SWD will work for sure, I saw the two SWCLK and SWDIO connectors on the board.




Cool, good luck! If you end up wanting a more 'official' STLink probe which is still pretty cheap, the ones on their 'discovery kit' and larger 'nucleo' boards can be disconnected from the main board and used with other targets.

They're a little bulky, but if you're interested in bare-metal programming, the embedded Rust ebook[1] currently uses an STM32F3 discovery kit[2] as a target, and that board's user manual has instructions for using its ST-Link to program/debug an external application[3] like your drone.

[1]: https://rust-embedded.github.io/book/

[2]: https://octopart.com/stm32f3discovery-stmicroelectronics-241...

[3]: https://www.st.com/resource/en/user_manual/dm00063382.pdf (PDF, see section 6.2 for STLink info)


If SWCLK and SWDIO signals are present, there are great chances that SWD will work. In any case, you can control with registers if you want to enable full JTAG, SWD, or nothing, and reuse those pins as you wish.

You can use JTAG probes that implement the CMSIS-DAP (also called DAPLink) protocol, so you get a probe that doesn't need any driver as is seen as an HID USB device. I ran through some problems when trying to use the ST-LINK/V2 with Linux, but that was some years ago and I don't know if things have changed since then.

CMSIS-DAP: https://os.mbed.com/handbook/CMSIS-DAP

Some probes: https://www.adafruit.com/product/2764

https://www.artekit.eu/products/debug/ak-cmsis-dap/




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: