Skip to main content
PHolt.1
Senior
October 3, 2025
Question

Cube IDE poor reliability when debugging

  • October 3, 2025
  • 6 replies
  • 800 views

Here are some threads which describe the problems

https://community.st.com/t5/stm32-mcus-boards-and-hardware/32f417-how-to-use-swv-itm-swo-debug-output-without-cube-ide-or/td-p/843611/page/2

https://www.eevblog.com/forum/microcontrollers/stlink-debugger-configures-some-32f4-target-registers-e-g-swo-trace-macrocell/msg6056111/#msg6056111

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...

6 replies

Ozone
Principal
October 3, 2025

> 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.

You might have a look at Segger Ozone, a freestanding debugger.
AFAIK it's free for non-commercial use.


PS: and not related to my moniker here ... ;)

AScha.3
Super User
October 3, 2025

>Cube IDE poor reliability when debugging

You forgot to tell: 

- IDE version

- PC system 

- st-link type/version

- target cpu

 

btw 

I use actual MxLinux, IDE 1.18.1 , debug openOCD and GDBmultiarch ,

st-link V2 ("stick", mod. for SWO ) , or V3 mods and miniE ;

targets: F103, F303 , F411, H563, H7A3, H743 , H7S3 .

About "poor reliability when debugging" i admit: (seldom) there is a problem, sometimes debug not starting, so i just click on debug again..then it starts usually, as it should. And "live expressions" i dont use/recommend to use, strange behaviour, sometimes working fine, most times not. But anyway no important feature for me, so no drama.

"If you feel a post has answered your question, please click ""Accept as Solution""."
PHolt.1
PHolt.1Author
Senior
October 3, 2025

Various versions over past 5 years.
Win7-64, win10, 24GB, i7
STLINK V3 ISOL, V3 MINIE
32F407/417

I don't use live expressions. Normally Cube works for the usual cycle of download, breakpoints etc.

The fun starts if you want to use SWV / SWO stuff.

Yes everybody says Seggers are good but a) they are 1k+ and b) I much prefer to Cube-integrated system. I played with the cheap Edu one and saw no difference at all versus STLINK V3.

Didn't know the STLINK V2 does SWO. I used the V2 ISOL for a long time; works ok.

 

AScha.3
Super User
October 3, 2025

-- still no info:

- IDE version

you use.

+

 

>Didn't know the STLINK V2 does SWO

see manual:

AScha3_0-1759486697162.png

on cheap V2 "clones" you have to solder it yourself, to get swv :

AScha3_2-1759486903092.png

 

AScha3_1-1759486834344.png

 

"If you feel a post has answered your question, please click ""Accept as Solution""."
PHolt.1
PHolt.1Author
Senior
October 6, 2025

AFAICT these tools are just problematic around the edges - regardless of whether they are free or cost $1000+.

And this is tacitly accepted by all, so ST have no reason to to fix anything.

I will try to borrow one of the expensive Segger debuggers to see if they work any better.

 

Andrew Neil
Super User
October 6, 2025

@PHolt.1 wrote:

I will try to borrow one of the expensive Segger debuggers to see if they work any better.


Segger have a tool to convert on-board ST-Links to J-Links:

https://www.segger.com/products/debug-probes/j-link/models/other-j-links/st-link-on-board/

That would allow you to try out Ozone before splashing out on a J-Link ...

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Ozone
Principal
October 7, 2025

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.

PHolt.1
PHolt.1Author
Senior
October 6, 2025

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.

PHolt.1
PHolt.1Author
Senior
October 8, 2025

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

Ozone
Principal
October 8, 2025

> ... 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.

 

PHolt.1
PHolt.1Author
Senior
October 8, 2025

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.

PHolt1_0-1759937348543.png

With the Segger one obviously uses the Segger J-Link mode.