简体   繁体   中英

How can I program an ARM MCU using SWD under Linux?

I'm working with an STM32 ARM Cortex MCU. It supports a protocol called SWD (serial-wire debugging). Looking around on the web, I've found arm-none-eabi-gcc which seems to be a decent compiler, but on the hardware side I haven't really found a proper way to work with it.

I haven't been able to find an SWD programmer / debugger that is officially supported on Linux. The closest I've found was stlink which looks like a poorly maintained project. Can you please tell me what's the right way to go if I would like to work with this MCU and want to use Linux on my computer?

OpenOCD is supported, reliable and works just as well on Linux and Windows. I use it every day to program and debug the F0, F1 and F4 devices using SWD (not JTAG).

If you're an Eclipse user then the latest version of the GNU ARM Eclipse plugin will even automate the OpenOCD command line for you. I wrote a number of articles hoping to help new users on my blog .

Hardware-wise, if you're using the discovery boards then you have the requisite ST-Link support on board and don't need anything else. Otherwise there's the official ST-Link/v2 dongle and also some dodgy clones on a well known auction site.

Well, texane/stlink is a properly maintained project and I use it on daily basis. Segger J-Link supports Linux as well. I have GCC ARM toolchain setup, with eclipse as my default IDE. I'm using both JLinks and STLinks for both JTAG and SWD interfaces. I wrote few articles on my blog some time back, and I can post the links if you want to.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM