2025-10-03 1:41 AM
Here are some threads which describe the problems
Basically, if you want to do Statistical Profiling, you have to enable PC Sampling and then Cube leaks memory at around 100kbytes/sec. Eventually it crashes, obviously. The SWV ITM debug mode does not need PC Sampling and is thus a lot more reliable, but only in the OpenOCD debugger mode.
Instead of adding more stuff which nobody uses, ST should fix this program properly, starting with the famous "random file opening" issue which about 100 people have complained about.
Another way to crash Cube is to use a STLINK debugger with some unspecified fault on the USB side. Cube just leaks lots of memory and bombs. Poor error detection...
2025-10-06 8:19 AM - edited 2025-10-06 8:21 AM
That's funny :)
Unfortunately I moved from ST dev board to a PCB several years ago.
But maybe buying a STM32F4DISCOVERY (STM32F407G-DISC1) board might be cheap enough. This board (I have a very old version) is only about £20.
I did try Ozone with the Segger Edu box a while ago. It looked like something from DOS 6.22 :) I much prefer to integration in Cube IDE which, presumably, a Segger box would give you.
2025-10-06 11:02 PM
On a related note ...
I use (genuine) Segger JLink in my company. Most of them came bundled with evaluation boards, several years ago. At least at that time, the cost for the basic variant was still in the two-digit range.
While Segger has some multiple JLink variants, most have identical hardware. The functionality is in the licence - just like with many automobiles nowadays.
The free "licence" for a converted onboard ST-Link is the same as for the basic variant, although Segger restricts it to use with the onboard target.
2025-10-07 5:26 AM
I'd be very interested in knowing what a Segger box does over an STINK V3, when used with Cube IDE.
Cube works fine for upload (flashing), and for breakpoints (with the usual caveats that a lot of breakpoints don't actually work because there is no code where you set it e.g. above it is a conditional instruction, and optimisation easily produces code which is no good for tracing through).
The STLINK V3 is workable for all the extra features which are supposed to work (notably SWV ITM debug console, and Statistical Profiling) but it took several days of experimentation to find out the Cube IDE settings that work anywhere near reliably, and stat profiling only works for a short time (but probably long enough). If I could get a "Segger" box, in any form, I would happily give it a run.
2025-10-07 6:41 AM
> I'd be very interested in knowing what a Segger box does over an STINK V3, when used with Cube IDE.
> Cube works fine for upload (flashing), ...
The point (or my point) is, I don't use Cube / CubeIDE.
And I very much dislike the idea of having just another 2+Gb - hogging toolchain for each vendor I like to experiment or work with. (Atmel Studio, MCUXpresso, TI CCS, and Dave come to my mind here ...)
And while no other vendor-specific toolchain supports the ST-Link, most of them support JLink as debug pod.
And of course all of the non-specific ones' like Keil uVision, IAR-WB, ADS, or others do. Including Segger's own Embedded Studio, which is free for non-commercial use.
I'm using the latter (Segger ES) for my private projects, and IAR-WB for commercial projects in my dayjob.
2025-10-07 7:54 AM - edited 2025-10-07 8:02 AM
"Embedded Studio is available under SEGGER's Commercial Use License (CUL) (single user). This license is portable, meaning it is not limited to a single PC, and it can be stored on a J-Link, acting like a USB dongle. This allows full use of Embedded Studio on any computer. "
Just great (not) ;)
2025-10-07 10:52 PM
2025-10-08 6:13 AM
I posted a report on Segger versus STLINK here
https://www.eevblog.com/forum/microcontrollers/segger-j-link/msg6061995/#msg6061995
The Segger does work better (I believe it does the CPU reset better than the STLINK) but does not address the huge memory leak issue which always crashes Cube IDE eventually, after an hour or two if doing the PC Sampling mode (for stat profiling).
Can't comment on how good Segger is when running with Segger software (not Cube IDE). It would be another long learning curve for me :) Also as you point out the Segger licensing terms mean that this software/debugger cannot be used in a multi person environment
2025-10-08 7:07 AM
> ... but does not address the huge memory leak issue which always crashes Cube IDE eventually, after an hour or two if doing the PC Sampling mode (for stat profiling).
Because this is a bug in CubeIDE's debugger, unrelated to the debug pod it uses.
Anything else would have been a surprise. And the onus to fix it lies with ST.
2025-10-08 8:29 AM
Yes it makes sense, but not totally, since Cube IDE's debugger subsystem is well broken in the STLINK GDB Server mode (only flashing works; SWV ITM debug works sometimes, forget stat profiling) but works a lot better in the OpenOCD mode. Both with STLINK V3.
With the Segger one obviously uses the Segger J-Link mode.