what's a good cheap jtag that works for all cortex M ? - Page 1
Forum section: electronics / general

author: bigendian
author_rank: Regular Contributor
timestamp: February 18, 2025, 11:28:42 am
content: Hi,i guess this has been discussed already, but maybe there are interesting updates.I know cheap few dollar stm32 jtag pods stuff, and as well blackmagic pod.Is there anything else interesting ? Even also to jtag program, not necessary to deubg too.

author: ataradov
author_rank: Super Contributor
timestamp: February 18, 2025, 02:47:30 pm
content: It all depends on the software you want to use. If you need Segger tools, you need Segger debuggers. If you want to use ST tools, you need ST debuggers.For third-party tools, all of them work more or less the same. Any CMSIS-DAP-based debugger would be the cheapest option. You can make one for $5 from Pi Pico.

author: bigendian
author_rank: Regular Contributor
timestamp: February 18, 2025, 04:25:48 pm
content: Thanks a lot, want to use open linux tools, as openocd.

author: ataradov
author_rank: Super Contributor
timestamp: February 18, 2025, 04:59:10 pm
content: Then use any CMSIS-DAP debugger. For Pi Pico there is PicoProbe or my Free-DAP (https://github.com/ataradov/free-dap) or a ton of other implementations. It is hard to go any cheaper.

author: bigendian
author_rank: Regular Contributor
timestamp: February 18, 2025, 06:30:16 pm
content: thanks a lot !

author: SiliconWizard
author_rank: Super Contributor
timestamp: February 18, 2025, 11:52:11 pm
content: Alternatively, you can use anything based on FT232H or FT2232H chips, which are also well supported by openocd.

author: Smokey
author_rank: Super Contributor
timestamp: February 19, 2025, 02:13:11 am
content: Jlink edu mini.They used to be like $30, but now look like they are $60. Still a good deal. Only downside is a once-a-day reminder click through that you are only supposed to use for educational purposes. :⁠-⁠)

author: ataradov
author_rank: Super Contributor
timestamp: February 19, 2025, 02:22:22 am
content: Or for $5 you can not have to click anything once a day.EDU mini is only good if you really need Segger tools. Otherwise there is nothing special about it.

author: Smokey
author_rank: Super Contributor
timestamp: February 19, 2025, 02:42:32 am
content: Quote from: ataradov on February 19, 2025, 02:22:22 amWell it's natively recognized by all the IDEs without needing to play any games with random open source hardware toys. That is pretty nice.

author: ataradov
author_rank: Super Contributor
timestamp: February 19, 2025, 03:12:42 am
content: OP specifically wanted OpenOCD. And CMSIS-DAP is recognized by pretty much all major IDEs that are not from chip vendors that have their own debuggers. And in case of chip vendors Segger support of often meh compared to their own tools.

author: DiTBho
author_rank: Super Contributor
timestamp: February 20, 2025, 09:42:18 pm
content: Is there anything for MIPS?

author: ataradov
author_rank: Super Contributor
timestamp: February 20, 2025, 10:00:33 pm
content: CMSIS-DAP has generic JTAG interface, as long as implementation exposes a full set of JTAG pins, it can be used for any device.But there is no standard programming interface for MIPS, so the reset depends on the software support. OpenOCD supports a bunch of MIPS-based devices.I don't know if debug part is standardized in any way other there.

author: bigendian
author_rank: Regular Contributor
timestamp: February 21, 2025, 08:59:17 am
content: Hi @ataradov, thanks,question: as i understand CMSIS-DAP is kind of standard that should work with all cortex M.But, for example, some PODs as an st-link v2 (SWD) or other stuff marked by chip producer seems cannot work with other cortex-M brands. Am i correct ? Are they doing some hw check on the target device ?

author: ataradov
author_rank: Super Contributor
timestamp: February 21, 2025, 03:07:52 pm
content: CMSIS-DAP is the standard defining USB interface between the PC and the debugger. On the other side of the debugger you have SWD. Both CMSIS-DAP, ST-Link and J-Link end up in SWD on the other side. The difference is just the USB protocol.Third-party tools can use any of them with any device. ST tools will only support ST devices because why would ST bother doing anything else? OpenOCD will work the same with CMSIS-DAP and ST-Link.And some device-locked versions of J-Link actually do internal device verification and stop working if they have not been licensed for that device or that use case.

author: bigendian
author_rank: Regular Contributor
timestamp: February 21, 2025, 03:48:34 pm
content: thanks,very interestingso if i understandusb side protocol can follow CMSIS-DAP or not, this is related to the sw or ide you would use.other side if SWD/JTAGfirmware can or cannot support certain brands/targetsam i correct ?

author: ataradov
author_rank: Super Contributor
timestamp: February 21, 2025, 03:55:34 pm
content: It is not the firmware, it is the PC tools may support certain devices. CMSIS-DAP and other protocols are just generic translators from USB to SWD.SWD is universal for all Cortex-M devices, but it just gives you access to the system bus. Once you are in, you need to know what device you are working with. Debugging can be made universal, since it only depends on the core itself. But for programming you need to know the way flash controller works in a specific device and how to work with it.J-Link has additional checks in the firmware, but they are not to add functionality, but to remove it if something is not licensed.

author: bigendian
author_rank: Regular Contributor
timestamp: February 21, 2025, 04:06:39 pm
content: Thanks a lot for the details. So since you are really expert, i still askfeel free to stop me.Is CMSIS_DAP a standard only to target arm chips with SWD/JTAG ? Or can target i.e. BDM ?So, let's see if i have understood, or still notopenocd should be able, even using a stlink2, to program a non st target, if the target is available in target dir ?I generally don't need to debug, i can get out of issues quite always just by print traces. Only need to program chips.yes, i have a cheap jlink clone here, i know i don't have to update the firmwareBut it was bought for error a lot of years ago, it wasn't clear it was a clone, not using it actually, also for respect of jlink guys.

author: ataradov
author_rank: Super Contributor
timestamp: February 21, 2025, 04:18:11 pm
content: Quote from: bigendian on February 21, 2025, 04:06:39 pmCMSIS-DAP is a standard developed by ARM, so the primary goal was to support SWD, secondary was JTAG. There are commands for direct pin manipulation, so it can support any interface that has the same number of signals as JTAG. But this is likely to be much slower, since you will have to issue a separate command for each pin toggle.Quote from: bigendian on February 21, 2025, 04:06:39 pmCorrect.

author: bigendian
author_rank: Regular Contributor
timestamp: February 21, 2025, 05:02:11 pm
content: Ok thanks a lot ! Will dig into this.

author: coromonadalix
author_rank: Super Contributor
timestamp: March 04, 2025, 03:43:55 pm
content: https://www.artekit.eu/products/debug/ak-cmsis-dap/

author: bigendian
author_rank: Regular Contributor
timestamp: March 12, 2025, 02:04:00 pm
content: oh, good, many thanks