EEVblog Electronics Community Forum

Electronics => Beginners => Topic started by: sairfan1 on January 02, 2025, 04:49:49 pm

Title: Lookking for ARM programmer
Post by: sairfan1 on January 02, 2025, 04:49:49 pm
I'm learning ARM based uC, starting with STM32 family, later I may explore Microchip (ARM) based uC.

I was looking at programmers to use, among original ones (JTAG, JLINK) are mostly above $500
I saw some original STM based programmers (ST-LINK V3PWR) in quite reasonable price like from $50 to $150. 

Other than that I already have PicKit5 its manual says it supports JTAG & SW but I'm not sure if that means it can be used to program any ARM based MCU?
Title: Re: Lookking for ARM programmer
Post by: langwadt on January 02, 2025, 04:54:15 pm
something like an STLINK-V3 is more like $15, and there are plenty of stlink clones for few $ that work just fine

or if you just want the easy way to play around, get a nucleos board it includes that programmer
Title: Re: Lookking for ARM programmer
Post by: rteodor on January 02, 2025, 05:13:58 pm
If you are at learning ARM MCU's then get a Pi Pico, flash it with picoprobe uf2 and there you have a SWD debugger for a few bucks. It should work with STM and Atmel/Microchip ARM's too.
Title: Re: Lookking for ARM programmer
Post by: jmelson on January 02, 2025, 05:52:15 pm
I did a project on the AT Tiny, in that case I was able to use the 8-pin SOIC version, but many projects might need more I/O pins.  There are many variants of the micro available with different combinations of I/O.  I used the Sparkfun "tiny programmer" which is maybe $16 at Digi-Key and mouser.  I used the avr-gcc compiler on Linux and the avrdude programming program to download the program to the chip.  I was quite impressed with the avr-gcc compier, I doubt I could have written more compact or efficient machine code by hand.
Jon
Title: Re: Lookking for ARM programmer
Post by: wasedadoc on January 02, 2025, 06:04:52 pm
I did a project on the AT Tiny, in that case I was able to use the 8-pin SOIC version, but many projects might need more I/O pins.  There are many variants of the micro available with different combinations of I/O.  I used the Sparkfun "tiny programmer" which is maybe $16 at Digi-Key and mouser.  I used the avr-gcc compiler on Linux and the avrdude programming program to download the program to the chip.  I was quite impressed with the avr-gcc compier, I doubt I could have written more compact or efficient machine code by hand.
Jon
All that is not relevant to OP.  AT Tiny is not ARM.
Title: Re: Lookking for ARM programmer
Post by: mwb1100 on January 02, 2025, 06:21:53 pm
Another option to consider is getting a Nucleo dev kit that has a onboard ST-Link.  Most (all?) of these on-board st-links are detachable (the board is perforated so you can snap it off) so you can use the st-link portion on other devices using STMicro MCUs.
Title: Re: Lookking for ARM programmer
Post by: ataradov on January 02, 2025, 08:43:43 pm
While there are plenty of cheap ways to get a CMSIS-DAP debugger (PiPico is likely the cheapest), if you want to use ST tools, I would just get legitimate STLINK-V3. It is cheap enough and you won't have to deal with compatibility issues.

Getting a Nucleo board is also an option, but it just turns into a mess with wiring while STLink comes with proper set of cables. In a long run it is worth the money.

If you don't plan on using vendor tools for programming and debugging, then it does not really matter and $5 PiPico is as good as anything else.
Title: Re: Lookking for ARM programmer
Post by: mwb1100 on January 02, 2025, 09:05:59 pm
Personally I'd go for an ST-LINK V2 - ST Micro sells them for $22.  There are plenty of cheaper knock offs that work as well.

The ST-LINK V3 "SET" is clunkier to use in my experience, and I fail to see much advantage (someone correct me if I'm wrong).  It's $35 from ST Micro (I'm not sure if there are much in the way of cheap knock offs).  I believe the situations where an ST-LINK V3 would work but an ST-LINK V2 wouldn't  are rare or maybe non-existent.

There's the really cheap ST-LINK V3 "MINIE" ($12), but it only comes with the STDC14 (1.27mm pitch) "compact" cable and most learning boards have 2.54mm (0.1") pin spacing on the connector.  So the OP would likely have to go through the trouble of getting an adapter.

It's been a year or so since I've looked at the ST-LINK 'market' - maybe things have changed some?
Title: Re: Lookking for ARM programmer
Post by: radiolistener on January 02, 2025, 09:39:05 pm
Just buy ST-LINKv2 on aliexpress, it cost for about 1 or 2 USD and works just fine.

I'm using it for different STM32 (F0,F1,F4,F7 series) and for STM8, it works ok.
Title: Re: Lookking for ARM programmer
Post by: langwadt on January 02, 2025, 10:12:58 pm
Personally I'd go for an ST-LINK V2 - ST Micro sells them for $22.  There are plenty of cheaper knock offs that work as well.

The ST-LINK V3 "SET" is clunkier to use in my experience, and I fail to see much advantage (someone correct me if I'm wrong).  It's $35 from ST Micro (I'm not sure if there are much in the way of cheap knock offs).  I believe the situations where an ST-LINK V3 would work but an ST-LINK V2 wouldn't  are rare or maybe non-existent.

There's the really cheap ST-LINK V3 "MINIE" ($12), but it only comes with the STDC14 (1.27mm pitch) "compact" cable and most learning boards have 2.54mm (0.1") pin spacing on the connector.  So the OP would likely have to go through the trouble of getting an adapter.

It's been a year or so since I've looked at the ST-LINK 'market' - maybe things have changed some?

nine times out of nine you are going to need to make an adapter anyway 

Title: Re: Lookking for ARM programmer
Post by: mwb1100 on January 02, 2025, 10:47:07 pm
nine times out of nine you are going to need to make an adapter anyway 

That hasn't been my experience, but even so it's easier to make an adapter with the 2.54mm interface.  Generally a few breadboard jumper wires are the "adapter".

I'd agree with @radiolistener's suggestion, but wouldn't fault anyone for buying a genuine ST-LINK for $20-$25.  Or just do your first STM32 project with a cheap Nucleo for $10 or so to get familiar with the tools and whatnot then when you move onto a second project you can decide if you want a "real" ST-LINK.
Title: Re: Lookking for ARM programmer
Post by: rhodges on January 03, 2025, 01:42:00 am
Just buy ST-LINKv2 on aliexpress, it cost for about 1 or 2 USD and works just fine.

I'm using it for different STM32 (F0,F1,F4,F7 series) and for STM8, it works ok.
I agree. I have bought many of these, and they worked fine for STM8 and STM32.
Title: Re: Lookking for ARM programmer
Post by: Siwastaja on January 03, 2025, 10:10:47 am
Yeah, seconding the suggestion of STLINK, and v2 is fine too. Even genuine one is cheap enough and that way you avoid quality control problems, although if you are lucky even a $2 counterfeit could work perfectly for years.

STLINK is not limited to ST devices in any way, it's a generic SWD programmer so works with any ARM microcontroller (SWD being the most common flashing/debugging interface).
Title: Re: Lookking for ARM programmer
Post by: sairfan1 on January 03, 2025, 03:24:35 pm

Quote
STLINK is not limited to ST devices in any way, it's a generic SWD programmer so works with any ARM microcontroller (SWD being the most common flashing/debugging interface).
Just for learning pupose i wanted to know about JTag, my PicKit5 also supports JTag, does that mean PicKit5 can also be used for that pupose?

How can I setup Pi Pico to use as programmer/debugger as suggested by @rteodor I tried to search uf2 but did not find anything related to it, I believe it must be some open source framework/library such solutions are normally more functional 
Title: Re: Lookking for ARM programmer
Post by: ataradov on January 03, 2025, 03:28:57 pm
PicKit5 can do SWD, but it does not follow any standard protocols on the USB side, so supports depends on whether your software can work with it. And as far as JTAG goes, don't use for ARM. It uses more pins and less efficient than SWD. There are no upsides to it unless you need boundary scan.

You need to be looking for "PicoProbe" images.

There is also my implementation (with images provided) https://github.com/ataradov/free-dap This also supports CMSIS-DAP v1, so may be more compatible with other tools.

In any case hardware tool selection starts with software tools you want to use and what they support.
Title: Re: Lookking for ARM programmer
Post by: newbrain on January 03, 2025, 07:53:58 pm
Another cheap but good quality option is an NXP MCU-LINK (https://www.nxp.com/design/design-center/software/development-software/mcuxpresso-software-and-tools-/mcu-link-debug-probe:MCU-LINK).
About 16 $, comes with a short SWD standard 10 pin cable - bare PCB, micro USB.

Being CMSIS-DAP based, works with most SW and IDEs, I use it with VS code and OpenOCD or pyocd .
It adapts to MCU with different supply voltages (1.8-5V, IIRC), as I/O is LVC buffered and the buffers supply uses a tracking R2R op-amp, defaulting to 3.3 V.
It includes a USB serial port.

Schematics and FW source are available.

Some times ago J-Link EDU minis were reasonably cheap - I paid mine 18 $ + VAT, from Mouser - now their price is outrageous (> 60 $).
Title: Re: Lookking for ARM programmer
Post by: ataradov on January 03, 2025, 08:19:59 pm
I have a previous generation of the MCU-Link - LPC-Link2, and it is a really good debugger. It can be flashed as either CMSIS-DAP or J-Link and it has USB HS interface. Although with CMSIS-DAP v2 USB FS is plenty fast. But I don't think NXP firmware supports CMSIS-DAP v2, at least no the firmware for LPC-Link2.
Title: Re: Lookking for ARM programmer
Post by: newbrain on January 03, 2025, 10:59:40 pm
I have a previous generation of the MCU-Link - LPC-Link2, and it is a really good debugger. It can be flashed as either CMSIS-DAP or J-Link and it has USB HS interface. Although with CMSIS-DAP v2 USB FS is plenty fast. But I don't think NXP firmware supports CMSIS-DAP v2, at least no the firmware for LPC-Link2.
MCU-LINK supports CMSIS-DAP v2 (https://github.com/ARM-software/CMSIS-DAP/blob/main/Firmware/Examples/MCU-LINK/README.md), the FW is freely available under Apache license, in fact, it's used as example for the LPC55S69 MCU!

Note that the base MCU-LINK cannot be flashed to J-LINK, only the onboard or PRO versions are supported (https://www.segger.com/products/debug-probes/j-link/models/other-j-links/mcu-link/).