STLINK V3-PWR - Page 1
Forum section: electronics / general

author: LogicalDave
author_rank: Regular Contributor
timestamp: April 08, 2023, 04:53:36 pm
content: I want to kick off a discussion thread for the STLink V3-PWR(https://www.st.com/en/development-tools/stlink-v3pwr.html)Most folks who develop for ST microcontrollers are very familiar with the STLink V2 debug tool and the newer V3 tools. The V3-PWR variant of the new tools is an interesting product that integrates several tools that developers often need to buy separately and one tool in particular that many developers don't have and is very useful. The product is USB powered and integrates an STLink V3, USB-to-TTL serial adapter, a variable power supply (1v6 to 3v3 in 100mV steps), and a dynamic current monitor (100nA to 500mA).That last item is the big deal. Many eevbloggers (including me) have used tools like the uCurrent gold to accurately measure very low currents, for uC sleep modes, but doing IoT development right requires understanding power consumption that varies rapidly over a huge dynamic range as the DUT runs. There are special-purpose tools for doing this (my favorite is the Joulescope which is outstanding), but they tend to be pricey. The STLink V3-PWR isn't as powerful as the Joulescope, but at $95 list, it's within most budgets and provides a huge step up in functionality over static measurement tools.I've posted an initial review of it on my blog:https://www.dalbert.net/?p=1100I'd welcome other folks thoughts on it. Hopefully someone has already done or will find the time soon for serious testing of the device to confirm advertised bandwidth, sampling, and measurement accuracy.

author: josip
author_rank: Regular Contributor
timestamp: April 09, 2023, 09:59:43 am
content: MCU-Link Pro is similar device from NXP. It is open design and in half price...https://www.nxp.com/design/software/development-software/mcuxpresso-software-and-tools-/mcu-link-pro-debug-probe:MCU-LINK-PROEDIT: It is CMSIS-DAP probe that can be converted to J-Link.

author: voltsandjolts
author_rank: Unknown
timestamp: April 09, 2023, 12:35:22 pm
content: Also theNordic PPK2works well and has been very popular.It perhaps started this trend for the programming tools to integrate such a tool.

author: gamalot
author_rank: Super Contributor
timestamp: April 09, 2023, 02:15:18 pm
content: I'd rather see one that works with all common debuggers, even if the current is lower. The picture is a project I fell by the wayside about years ago.

author: LogicalDave
author_rank: Regular Contributor
timestamp: April 09, 2023, 04:33:26 pm
content: Thanks for the pointers to the other devices; I wasn't aware of them! I've summarized the differences between those devices and the STLinkV3-PWR below with product links and more detailed comparisons following.The Nordic PPK2 appears to be a generally superior power profiling tool to the STLinkV3-PWR, offering wider voltage and current ranges; measurement speed is the same. They cost about the same, however the PPK2 is not multi-function (no debug/serial functionality) and it has no enclosure. It is more like a poor-man's JoulescopeThe MCU-Link doesn't seem to offer any advantages over the STlink V3-PWR other than cost (and IMO not enough to justify the limitations); the critical issue is that it only offers two jumper-selected current measurement ranges, neither of which is quite right for many IoT devices. It is multi-function (JTAG+serial), but has no enclosure. Personally, I'd pay $50 more to get the much better power measurement capability and an enclosure.MCU-Link vs. STLINK V3-PWRhttps://www.nxp.com/design/software/development-software/mcuxpresso-software-and-tools-/mcu-link-pro-debug-probe:MCU-LINK-PROCritical: MCU-Link requires you to select one of two current measurement ranges: 200nA-50mA or 10uA-350mA (jumper selectable) whereas the STLINK V3-PWR auto-selects among 4 ranges from 100nA to 500mASimilar: JTAG and Serial Comms functionalitySimilar: power measurement speed: 100ks/s (MCU-Link docs note limitations at higher speeds)Pro: $46 vs. $95Pro: auxiliary analog inputPro: able to measure current/voltage from other sources (e.g. battery)Con: power supply functionality more limited (1v8 or 3v3 only, 350mA max)Con: bare board - no enclosure for MCU-LinkNordic PPK2 vs. STLINK V3-PWRhttps://www.nordicsemi.com/Products/Development-hardware/Power-Profiler-Kit-2Pro: 5 auto-selected current ranges, max 1A (vs. 4-ranges, 500mA max for V3-PWR)Pro: wider voltage range (0v8 to 5v0)Pro: able to measure current from other power sourcesCon: not multi-function (no JTAG/SWD or serial comms functionalityCon: Some specs fuzzy (stated differently in each document, sometimes even in the same document). Lower current measurement range is stated as 100nA, 200nA, 500nA. Accuracy varies from 1% to +/-20%Similar: $86-$92 vs. $95 for STLINK V3-PWRCon: bare board - no enclosure for PPK2

author: SiliconWizard
author_rank: Super Contributor
timestamp: April 09, 2023, 08:58:13 pm
content: Yep this is getting relatively common these days.But a good comparison, testing the current monitor feature of each against a reference tool would be interesting.You also have standalone current monitors such as the JouleScope.

author: peter-h
author_rank: Super Contributor
timestamp: April 10, 2023, 08:56:06 am
content: What is the main use of dynamic current monitoring?The CPU draw will be just a part of the total.Unless one is doing a low power design... but it is trivial to measure the power draw, with a resistor, no?I would much more like a debugger which isreliable. They all seem to fail after some hours or less, permanently disconnecting from the target. I am running Cube IDE.

author: voltsandjolts
author_rank: Unknown
timestamp: April 10, 2023, 12:11:34 pm
content: Given the above current monitoring options, I'd choose the Nordic PPK2 because...(1) It's a standalone unit, use it with any programmer. I use MCU's from different manufacturers.(2) It has a built-in low speed logic analyser, so you can correlate power draw changes with logic changes right there on the graph. The others don't have any correlation, so your left to work out what happened when and why.

author: thm_w
author_rank: Super Contributor
timestamp: April 11, 2023, 12:03:10 am
content: Quote from: peter-h on April 10, 2023, 08:56:06 amEasier to correlate with what code is executing at that time, then power optimize, as they state on the website.QuoteThis sounds like some sort of software issue and not a problem with the debugger hardware.If you have a st-link clone you can try flashing it with the jlink firmware, see if there is any difference.

author: LogicalDave
author_rank: Regular Contributor
timestamp: April 11, 2023, 12:01:08 pm
content: @peter-h Tools like this measure the total current drawn by the system (not just the CPU). System power passes through one of several precision shunt resistors and an instrumentation amp measures the voltage drop and logs the result. Ideally, both voltage and current are sampled together so you can measure power usage.The challenge with analyzing power consumption in IoT systems is that the dynamic range of currents is usually very large (e.g. nA or uA to hundreds of mA). Consider a typical device that sleeps most of the time drawing a few uA, wakes periodically to read some sensors (maybe 5-30mA depending on what is being done), and then periodically transmits sensor readings (potentially hundreds of mA depending on the transmitter and PA). The current drawn in such a system changes fast; taking accurate measurements requires a device that can keep up with those changes so it needs to be taking current measurements fast (hence the importance of the fast sampling rate and wide bandwidth).Even measuring currents statically over a wide range can be tricky without a tool like these. Consider a system that switches between drawing 2.5uA in sleep mode, 25mA in active mode, and 250mA in transmit mode. You can't use one resistor because a resistor with a high enough value to allow measuring 2.5uA will cause unacceptable voltage drop at 250mA. This means you can't easily measure current while the system is running normally. That's why we need hardware that switches the appropriate shunt resistor in for the appropriate current measurement range; and does that fast enough to prevent browning out the processor. These two things (fast automatic ranging and fast measurements) are what these sorts of devices do.So no, it's not trivial to measure the power draw with a resistor :-)

author: LogicalDave
author_rank: Regular Contributor
timestamp: April 11, 2023, 01:09:53 pm
content: @voltsandjolts I agree that of the three, the PPK2 is the best dedicated low-cost power analyzer.None of them are really adequate for serious dynamic power analysis as they lack adequate sampling rate/bandwidth. I use a Joulescope for that, but it is considerably more expensive. I also agree that the ability to correlate digital signals to current changes is important and useful. The V3-PWR has an extensive set of digital I/O pins including GPIO, SPI, I2C, etc; hopefully, ST will add more functionality to the software (which is very basic at present) to take advantage of those hardware interfaces. Displaying/correlating them to power events as you suggest would be a great enhancement (along with cursors and several other things missing in the software).What all of these allow (that had previously been difficult) is the very fast shunt-switching that makes it practical to measure the huge dymamic current range of most IoT applications. The other thing I like about the STLinkV3 is the high level of integration (DBG/JTAG, Serial comms, power supply, current monitoring) that gets a lot of clutter off my desk.

author: LogicalDave
author_rank: Regular Contributor
timestamp: April 11, 2023, 01:25:59 pm
content: @SiliconWizard I agree; I plan to do a head-to-head comparison of the V3-PWR with my Joulescope when time permits; I'll post the results here. I'll also set up a controlled load test with a signal generator switching a FET+load in/out to observe the bandwidth limitations of each device. Maybe someone with the other devices can do similar testing and post the results?

author: 2N3055
author_rank: Super Contributor
timestamp: April 11, 2023, 02:36:42 pm
content: Quote from: LogicalDave on April 11, 2023, 01:09:53 pmIt depends what "dynamic analysis" means to you...If you are trying to correlate power transients to CPU cycles, then not many will be fast enough.If you are doing dynamic power analysis for sake of power consumption analysis, even a small capacitor (on DUT board or outside) will start integrating current and slow down current transients..For analysis of low power device that are in standby most of the time, and then wake up for a second, and which run from high impedance sources (small batteries) you will need some sort of power conditioning to overcome high impedance of power source, at least some capacitor that will "power trough" current transients.That kind of circuitry will make power transients slow enough to measure energy spent in a burst of activity accurately enough for estimates during development even with 10kS/s. PPK2 can go to 100kS/s...

author: robca
author_rank: Frequent Contributor
timestamp: April 15, 2023, 12:28:45 am
content: Quote from: LogicalDave on April 09, 2023, 04:33:26 pmI have been using the PPK2 for some time. As someone else pointed out, it has a basic logic analyzer, which is very convenient especially for complex code (like BLE), where different output pins on the CPU under test can be toggled, and used to correlate power consumption to specific events (with a 100kHz resolution)Also, at least my PPK2 is enclosed in a transparent enclosure. It's not a bare board at all, even if it might look like one in the pictures.

author: Smokey
author_rank: Super Contributor
timestamp: April 27, 2023, 08:19:48 am
content: Cool. I just got an email from ST about the STLINK-V3PWR. I was going to start a thread, but I'm way late to the party!

author: bateau020
author_rank: Frequent Contributor
timestamp: May 19, 2023, 06:24:59 pm
content: Just got the STLINK-V3PWR. Not mature yet. They should have tested the software and firmware better before putting it on the market. But they are not alone there....Cons:* fatal: on even very short current spikes that go above 500mA, both the device and STM32CubeMonitor-Power PC software crash. So forget for example about CPU controlled peripheral circuit power. Even connecting a 100uF cap will trigger the OCP. And when it does, the only way to get it back to work is to unplug everything, and restart the software (if that did not crash before). Logged that ontheir forum, will see if they react. The device just spurts out "error: VOUT turned OFF due to OverCurrentProtection" and then disconnects the COM port. Leaving the PC software to crash and the device to have to be re-connected physically.* not good: in all of the 4 current ranges, the noise level in the current measurements is significantly higher at the bottom of the range than at the top of the range. They should have used less noisy circuitry here.* not good: random crashes of the PC software* limiting: no possibility to power it from an external source or a battery (already mentioned in a post above)* nuisance: requires USB-C with "charge" capability advertised by the port. Just plugging it on a high current capable port will not work. It does some protocol check and refuses to work if the port does not advertise the right feature set, which none of my powered USB isolators apparently do (intona and alldaq). Will try with a USB hub soon.EDIT: just got a "digitus office hub". The STLINK-V3PWR now works with my Intona 7055-D USB isolator, as long as I use the external power, either on the hub or on the intona.Word of advice:* you MUST connect T_VCC for the Debug interface and the Bridge (I2C, CAN, SPI, UART, and GPIO) interface to work. The documentation indicates that it is needed for the "VDDIO domain", which can easily be interpreted as "GPIO".* debugging and access to UART at the same time is not possible. It is the one or the other, but they at least indicate that in different locations. Power control/measurement is possible at the same time.Pro:* it uses a relatively well (self-)documented interface to do the power control and measurement(UM2269 or via serial port 2 "help"). Should be possible to integrate that in sigrok and others.* sampling start trigger source is rather versatile: SW, HW, startup delay, current threshold. Just like the "grown-ups".Edit: added link to the PWR protocol, as pointed out to me by ST.

author: LogicalDave
author_rank: Regular Contributor
timestamp: June 02, 2023, 03:20:20 am
content: Adding two more "gotchas" to those listed by @bateau020:If you set it to log data continuously, it generates massive amounts of data - It actually completely filled my drive! (and the files were buried in a hard to find place)That dang STC14 connector. This is a problem with the entire STLINK-V3 line, not just the STLINK-V3PWR: ST standardized on a 2x7 0.050" pin header for the core connectivity (SWD, UART) and it is a PITA. Unless you have an STC14 connector on your target, you have a problem because now you can't easily connect things using the ubiquitous 0.100" dupont jumper wires. So every STLINK-V3 needs a breakout board to split the STC14 connector out to 0.100" pin headers. Someone kindly contributed a nice design and you can buy 9 breakout PCBs for $11.10 shipped:https://oshpark.com/projects/HWRz6QUn/view_design.You will need to populate the board with a suitable 2x7 SMT 0.050" header and standard 0.100" break-away pin headers. I found two connectors that fit: the recommended Samtec (https://www.digikey.com/en/products/detail/samtec-inc/FTSH-107-01-F-DV-K/2650001) is nice but very expensive (see pic on left); a much cheaper CNC Tech connector (https://www.digikey.com/en/products/detail/cnc-tech/3220-14-0300-00/3883270) also works and uses a standard box shroud (see pic on right)

author: robca
author_rank: Frequent Contributor
timestamp: June 02, 2023, 06:33:58 pm
content: Quote from: LogicalDave on June 02, 2023, 03:20:20 amFirst of all, thanks for this!Just FYI, your Oshpark link is broken. Even removing the period of the end, it gives an error. This link works for mehttps://oshpark.com/shared_projects/EH6wHxTZbut it's different from yours

author: tszaboo
author_rank: Super Contributor
timestamp: June 02, 2023, 11:22:20 pm
content: Quote from: robca on April 15, 2023, 12:28:45 amThe PPK2 is great, very useful tool. I got one for every FW developer in the office, thats what they have been using to power most boards. I was searching for a power profiler for a while before, and all the Agilent or R&S equipment that could do similar measurements were around 10K.

author: LogicalDave
author_rank: Regular Contributor
timestamp: July 17, 2023, 09:28:46 pm
content: @robca Thank you for pointing out the broken link. I think OSHPark makes a custom link based on your login (so the original link still works for me). This link is from the author and should work for anyone even when not logged in; scroll down to the project labeled STDC14 Breakout:https://oshpark.com/profiles/aakatz3I'll also update the original post if possible.

author: LogicalDave
author_rank: Regular Contributor
timestamp: July 17, 2023, 09:36:17 pm
content: After spending more time with the STLink V3-PWR, I agree with @bateau020: the software is simply too immature and ST should not have released the STLink V3-PWR yet. I cannot recommend it to anyone at this point. If ST fixes the software, it will be a very useful tool, but at present, even the main power monitoring app has serious flaws and the SWD hardware is not yet supported by OpenOCD (which works fine with other STLinkV3 products like the MINIE). Even some ST applications don't recognize it.

author: bateau020
author_rank: Frequent Contributor
timestamp: July 27, 2023, 04:28:41 pm
content: After I raised an issue at ST about the low level of maturity of their software/firmware, I got the following reply (slightly abbreviated):QuoteThe "..." was a remark about OpenOCD, that seems to be going in the right direction, as can be seen in the latest github commits, removed above for brevity.So in all: please wait for new software. No commitment on dates or features.(Updated my post above to include a pointer to UM2269, in order to keep things together)

author: bateau020
author_rank: Frequent Contributor
timestamp: September 08, 2023, 02:11:33 pm
content: Update:With the latest firmware V4.J3.B1.P4 (get that from a fresh install from stsw-link007, the versions included in the other STM32 tools are likely to be obsolete), the sensitivity to power caps is much less.Whenever you have a hard overcurrent, the device still disconnects (requiring a physical reconnect) and STM32CubeMonitor-Power still crashes. But we're getting closer to a usable device now.

author: asmi
author_rank: Super Contributor
timestamp: September 08, 2023, 05:22:18 pm
content: Quote from: LogicalDave on June 02, 2023, 03:20:20 amSTC14 is much better than these ancient 0.1" headers because it wastes less space on a board. It's simply unacceptable when programming connector take up more space than the MCU itself! I've been using 10 pins Tag-Connect lately so I won't need a connector as well, but I plan to move to 6 pin TC because it's even smaller while still containing everything neccessary to program and debug an MCU. The only thing I wish that they would come up with a more reliable way of attaching their legless cable to a PCB, as footprint for the legged cable takes up more space than the no-legs version, and it requires additional clearance for fingers so you can actually connect/disconnect the cable.Quote from: LogicalDave on June 02, 2023, 03:20:20 amAbsolutely not! If you are stuck in the past with ancient connectors and fly wires, it doesn't mean that so is everyone else. Unless you are designing a devboard, programming header is a pure waste of PCB estate, and so it needs to be as small and as cheap as possible (ideally $0 which is the case with Tag-Connect).

author: LogicalDave
author_rank: Regular Contributor
timestamp: September 16, 2023, 11:17:59 pm
content: > STC14 is much better than these ancient 0.1" headers because it wastes less space on a board@asmi obviously, 0.050 headers are smaller than 0.100 headers; less obvious is that smaller is always better. For example, in many applications where the PCBA may be roughly handled, designers prefer 0.100 headers because they are dramatically less fragile (and often less costly) - more on this below. However, I wasn't complaining about the connector on the target, I was complaining about it being the only connector on the STLink itself. This makes it harder to use with most existing targets which were designed for prior generations of STLink and so generally used 0.100 headers. If the STLinkV3 had 0.100 pin headers, it would have been easier to use with existing targets and fixtures as well as being more rugged; for connection to STC14, it is much easier to make a 0.100 to 0.050 adapter than to adapt upward in size.>Absolutely not! If you are stuck in the past with ancient connectors and fly wires, it doesn't mean that so is everyone else.I am not "stuck in the past" (and I may have misunderstood, but the comment seems needlessly discourteous), but like most engineers, I have to deal with a wide range of *existing* products and their fixtures as well as new product development. In most companies, more engineering time is spent on existing products than new ones. Those existing products and/or their factory fixtures will tend to have 0.100 headers because that's what the STLinkV2 used. The STC14 on the STLink v3 makes it harder to use with existing products and their fixtures. For a separate discussion, I would bet that ancient or not, 0.100 is still the most common pin header size.>Unless you are designing a devboard, programming header is a pure waste of PCB estate,Here we largely agree: populated STLink headers are rare on production boards. For new designs, if a board has the real-estate (many do), I put 4 pads down for STLink pin-headers that I populate during development, SWDIO, SWCLK, GND, and Vcc are usually all that's needed. However those headers are almost never populated for production. Production connections to the DUT are via pogo-pins on a custom factory fixture or a COTS solution like the TAG-Connect (which I also like and use for low volume). In either case, the STLink connects to thefactory fixturevia pin header. Perhaps your factory fixtures are tight on space, mine generally are not and so I prefer the ruggedness and reliability of a shrouded, keyed 0.100 pin header to the real-estate savings offered by STC14...which is why I am grousing about the STC14 on the STLink.

author: uer166
author_rank: Super Contributor
timestamp: September 17, 2023, 12:50:55 am
content: Quote from: LogicalDave on September 16, 2023, 11:17:59 pmI am happy that ST's opinion differs from yours. The 5x2 (not 7x2!) non-shrouded 0.05" headers that the vanilla STLINK-V3 is compatible with is an absolute godsend for cost and size; I wouldn't even use Tag-Connect anymore since it's larger in the latching version and the 0.05" header works on PCBs other than 1.6mm.

author: LogicalDave
author_rank: Regular Contributor
timestamp: September 19, 2023, 12:32:35 am
content: @uer166 I'm happy you like the STC14. Again, since it appears I was not clear, I was complaining about:The connectoron the STLink,not the target. As you point out, you can use any size connector on the target (e.g. 5x2 instead of 7x2); it doesn't have to match the STLink connector.The STLink is a tool for development and factory use. Particularly during development, when boards are frequently connected/disconnected, 0.050 connectors and ribbon cables are fragileIt's easier to adapt down in pitch than up.The change in header pitch makes it harder to use the STLink V3 with existing boards - and there are almost certainly vastly more existing than new designs. That will change over time, but for now, it's harder to put the STLinkV3 into service with existing systems. Even 4x 0.100" pins (SWDIO, SWCLK, VCC, GND) in addition to the STC14 would have solved the problem for most users. Smart companies care about backward compatibility and easy migration paths.Clearly you're right that the STLink design team's opinion differed from mine. That doesn't mean they always get it right the first time or that they don't value user feedback...yours or mine.With respect to placing connectors on the target, I agree that 5x2 0.50" connectors will be much cheaper than the 7x2 Samtec STC14 connectors used on the STLink V3 (although those have an amazingly small footprint). I'd like to find some good, inexpensive, keyed 5x2 0.050" non-shrouded connectors; would you mind sharing which ones you are using? For targets, I've been concerned about using 0.050" connectors, particularly non-shrouded, because the pins tend to be easily bent/damaged; have you found any good tricks for protecting them?Finally, I agree that the TAG Connect is a niche solution, and perhaps increasingly so. Someone else brought them up, but I've used them for low volume or pilot runs before a test fixture is made, the obvious advantage over STC14 is that it adds zero cost to the production boards, but you're right that if a low cost STC14 or 5x2 0.50" connector is available, the TAG Connect has less to offer and those dang latches (on the latched versions) are pretty annoying.

author: AVI-crak
author_rank: Regular Contributor
timestamp: September 19, 2023, 01:18:08 am
content: I can buy STC14 for $30 for 1 set - but I don't want to.STC14 is made by only one company and the licence conditions are atrocious. You are not allowed to manufacture STC14 connectors for less than $30.The situation is exactly the same with edge connectors - the connector itself costs almost nothing, but the licence is beyond humanity.On the other hand TAG Connect is made literally in 10 minutes from junk, needles are freely available almost for free. You don't have to replicate the original design, I like the clip-on design better.

author: voltsandjolts
author_rank: Unknown
timestamp: October 23, 2023, 09:04:56 am
content: Cross-ref to someone who was having trouble with SWO on the STLINK V3-PWRQuote from: n4te on October 21, 2023, 05:57:02 pm