Author Topic: Is ST Cube IDE a piece of buggy crap?  (Read 517673 times)

0 Members and 24 Guests are viewing this topic.

Offline peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 6039
  • Country: gb
  • Doing electronics since the 1960s...
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #1625 on: April 09, 2026, 06:10:22 am »
This is the problem with ST not supplying newlib (libc.a specifically) in source form. I spent a chunk of my life on this, because there are other problems e.g. it was not built as "weak" so the function stubs could not be replaced. Much discussion back in this thread. The stuff below is from my project notes:

The likely original printf source in libc.a was
https://sourceware.org/git?p=newlib-cygwin.git;a=blob;f=newlib/libc/stdio/vfprintf.c;h=6a198e2c657e8cf44b720c8bec76b1121921a42d;hb=HEAD#l866

Probable scanf sources:

The likely scanf source in libc.a (which is still used in the KDE) is
https://sourceware.org/git/?p=newlib-cygwin.git;a=blob;f=newlib/libc/stdio/sprintf.c;h=be66ec6f5d73589e5147afeb7634b9de0daba09d;hb=HEAD
or
https://sourceware.org/git/?p=newlib-cygwin.git;a=tree;f=newlib/libc/stdio;h=0f5e4dd0dc465029d0b6c0a5d03fc2cc70e8df87;hb=HEAD
and that does use malloc but it’s not clear if the one in the Cube lib uses it. A breakpoint on _sbrk is not hit.

Other Newlib sources can be found here
https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads

Probable heap sources:

If looking for heap source code, this may help:
https://www.eevblog.com/forum/programming/heap-analysis-tool-for-embedded-systems/
Note that our frozen libc.a contains the heap code also.

The current heap code seems to allocate 4 bytes for each block, and sometimes 4 more bytes are added for alignment. See here
https://www.eevblog.com/forum/programming/heap-analysis-tool-for-embedded-systems/msg4835657/#msg4835657

However the suggested candidate source code
https://github.com/devkitPro/newlib/blob/master/newlib/libc/stdlib/_mallocr.c
appears to not be the one (unless fixed since) because the problem described here
https://stackoverflow.com/questions/39088598/malloc-in-newlib-does-it-waste-memory-after-one-big-failure-allocation/76138157#76138157
(which does refer to the above source) is not present in ours. A malloc of a block larger than heap space fails correctly but subsequent reduced mallocs work fine.

A more likely candidate sourcecode is the “nano”
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=blob;f=newlib/libc/stdlib/nano-mallocr.c;h=13b72c99ffd7007b53c2e3270a56da237857742a;hb=HEAD

but it probably is not, or not quite
https://www.eevblog.com/forum/programming/help-needed-with-some-heap-test-code/msg4845821/#msg4845821

Both above sources have a comment:

The minimum allocatable size is 16 bytes. Even a request for zero bytes (i.e., malloc(0)) returns a pointer to something of the minimum allocatable size.

and this has been verified for ours.

This summarises the likely sources
https://www.eevblog.com/forum/programming/heap-analysis-tool-for-embedded-systems/msg4844564/#msg4844564

Our heap (whose-ever it is)  has a bug:
https://www.eevblog.com/forum/programming/help-needed-with-some-heap-test-code/msg4838741/#msg4838741


Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline dkonigs

  • Regular Contributor
  • *
  • Posts: 171
  • Country: us
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #1626 on: April 09, 2026, 01:54:03 pm »
This is the problem with ST not supplying newlib (libc.a specifically) in source form. I spent a chunk of my life on this, because there are other problems e.g. it was not built as "weak" so the function stubs could not be replaced. Much discussion back in this thread. The stuff below is from my project notes:

They actually do now supply it in source form.  Its just that the build process is kinda big and scripted, so it may take some work to do a custom build of just a relevant part:
https://github.com/STMicroelectronics/gnu-tools-for-stm32/
 

Offline peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 6039
  • Country: gb
  • Doing electronics since the 1960s...
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #1627 on: April 09, 2026, 03:07:17 pm »
Good luck working out what is where



:)
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline dkonigs

  • Regular Contributor
  • *
  • Posts: 171
  • Country: us
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #1628 on: April 09, 2026, 03:14:42 pm »
Good luck working out what is where



:)

Um, I know you love to complain, but there is literally a top-level directory under src called "newlib":
https://github.com/STMicroelectronics/gnu-tools-for-stm32/tree/14.3.rel1/src/newlib

And there are shell scripts in the root directory showing you what commands it uses to build everything.

Just because it contains a clone of the gcc source tree within it, isn't reason enough to pretend this isn't exactly what you were looking for.
 

Offline peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 6039
  • Country: gb
  • Doing electronics since the 1960s...
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #1629 on: April 09, 2026, 03:40:40 pm »
I had a look in there. Good luck working out which code actually comes with Cube IDE. For example the newlib src is re-entrant AFAICS, while the libc.a was not re-entrant and had stubs for mutexes.

Anyway, you are clearly very familiar with github and linux so I am sure you can work it out :)
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Online Alien Brother

  • Regular Contributor
  • *
  • Posts: 68
  • Country: fr
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #1630 on: April 10, 2026, 07:37:01 pm »
GCC is pretty mature now and it is hard to imagine a scenario where a later compiler would be needed.
For C++, having the latest standard is quite helpful. For C, C23 will add #embed.
 

Offline dkonigs

  • Regular Contributor
  • *
  • Posts: 171
  • Country: us
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #1631 on: April 11, 2026, 03:48:54 am »
Anyway, you are clearly very familiar with github and linux so I am sure you can work it out :)
My issue is long since resolved.  You're the one with the lengthy rant about all of this.
I was mistakenly linking regular newlib instead of newlib-nano, and they changed the build settings for regular newlib.  Once I fixed my build process, and was actually linking newlib-nano, the size difference between the compilers basically vanished.

Was also interesting to see that for my code base, and what I was using, the size difference between newlib and newlib-nano when both are built with -Os was actually negligible.

GCC is pretty mature now and it is hard to imagine a scenario where a later compiler would be needed.
For C++, having the latest standard is quite helpful. For C, C23 will add #embed.

Unfortunately I don't think #embed is coming until GCC 15.  GCC 14 is still a partial implementation of C23, even if it has the majority of it.

The full list of when each feature is added can be found here:
https://gcc.gnu.org/projects/c-status.html#c23
 
The following users thanked this post: voltsandjolts

Offline peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 6039
  • Country: gb
  • Doing electronics since the 1960s...
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #1632 on: April 11, 2026, 07:53:19 am »
Quote
My issue is long since resolved.  You're the one with the lengthy rant about all of this.

I am impressed with your subtly expressed intellectual brilliance. You will be an asset to any online community!
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Online Kjelt

  • Super Contributor
  • ***
  • Posts: 6736
  • Country: nl
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #1633 on: June 20, 2026, 09:40:57 am »
No affiliations with the author just might be of interest to some of you

 

Offline lichurbagan

  • Regular Contributor
  • *
  • Posts: 225
  • Country: bd
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #1634 on: June 23, 2026, 07:19:10 am »
I stopped using STMcube for when I found multiple options grayed out and my laptop hanging while using that. It was more than 6 years ago. Donno if that improved later.
 

Offline paulca

  • Super Contributor
  • ***
  • Posts: 6445
  • Country: gb
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #1635 on: June 23, 2026, 09:12:49 am »
I stopped using STMcube for when I found multiple options grayed out and my laptop hanging while using that. It was more than 6 years ago. Donno if that improved later.

Depends on if you want to run it on a potato or not.

A modern PC will not even blink, but thats expecting multi-core 4Ghz+ and at least 16Gb of RAM, ideally 32Gb.

On RAM.  On any busy build system with a LOT of files and artefacts your in memory disk cache is EXTREMELY important.

If working properly, you might see:
OS: 4Gb
CubeIDE: 2-4Gb
CubeIDE build/test/helper background tasks: 2Gb maybe.
Actual project maximum transient size (including all firmware and intermediates): 2Gb.

You should ideall have that 12Gb plus a bunch of Gb for file cache.

In memory File cache versus actual disk reads/writes is orders of magnitude slower.  What would have taken a second, takes 100 seconds and becomes a greyed out, blocked UI mess.  Worse, unblocked parts of the UI will temp you into making it worse, clicking and starting up something else.

Some Windows filesystems default to "synchronous writes".  User process does not return until the data is actually written.  This has the same effect as (more or less) having no file cache for writes at all.  All writes are "write through sync".  Unless specified otherwise, leaving it up to the tools.
"What could possibly go wrong?"
Current Open Projects:  68000 Self Build computer + OS.
 

Offline ace1903

  • Regular Contributor
  • *
  • Posts: 248
  • Country: mk
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #1636 on: June 25, 2026, 10:32:51 pm »
Tried to download STM32CubeProgrammer on new pc and I have got message that my password is expired.
I reset it using provided button but I received empty mail from ST.
I am not sure if it is ST problem or some stupid AI tool that tries to summarize mail and in that process delete it's content.
Does anyone experienced similar problem when resetting password on ST account?

I used online parser tool to convert raw message format to html, and then in browser I was able to reset my password with link provided.
« Last Edit: June 26, 2026, 01:27:50 pm by ace1903 »
 

Offline peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 6039
  • Country: gb
  • Doing electronics since the 1960s...
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #1637 on: June 26, 2026, 03:43:39 pm »
It is really stupid for ST to require an email address and this verification, before a download of publicly available software. This is why I archive any downloads...

This looks like a later version of the old STM ST-LINK Utility which actually worked perfectly... I have v4.6.0 so if you need that drop me a PM.

They also do / used to do a thing called Visual Programmer which IIRC I installed and had some problems with. I have a year 2023 version.

These things interface to an STLINK V2 or V3. They are basically for production programming of the chip in the target - same as Cube IDE will do but with way more buttons somebody can mess up. And they probably check it is not a fake STLINK ;) but the STLINK is so cheap...

« Last Edit: June 26, 2026, 03:45:17 pm by peter-h »
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Online Kjelt

  • Super Contributor
  • ***
  • Posts: 6736
  • Country: nl
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #1638 on: June 27, 2026, 07:09:57 am »
It is really stupid for ST to require an email address and this verification, before a download of publicly available software.
I think that this is standard procedure for many companies and it is their way to have different levels of acces control for the my.st.com community and content.

Eighteen years ago I had a developers account and it was the exact same portal, just had more access to preliminary tools and microcontrollers in development.
So yeah there are different acces levels and newer versions of tools for future micros. You still think it is weird you have to just acknowledge your identity before downloading free tools that from other commercial manufacturers costs thousands of euros?
 

Offline peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 6039
  • Country: gb
  • Doing electronics since the 1960s...
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #1639 on: June 28, 2026, 09:56:41 am »
It is surely ineffective, because anybody can download it and re-host it somewhere. There is no NDA...

If I was working on any long term / serious Cube IDE etc project, I would definitely archive the tools and issue them to anybody who wants them.
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Online Kjelt

  • Super Contributor
  • ***
  • Posts: 6736
  • Country: nl
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #1640 on: June 28, 2026, 10:31:30 am »
It is surely ineffective, because anybody can download it and re-host it somewhere. There is no NDA...
Sure about that? It does not state anywhere you are not allowed to share it with others without the consent of the owner? Nowadays there are 100+ pages in the agreements, noone reads them anymore.
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: fi
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #1641 on: June 28, 2026, 02:32:38 pm »
It is surely ineffective, because anybody can download it and re-host it somewhere. There is no NDA...
Sure about that? It does not state anywhere you are not allowed to share it with others without the consent of the owner? Nowadays there are 100+ pages in the agreements, noone reads them anymore.

All of that is irrelevant, because that kind of "rehosting" is the most classic textbook example of copyright infringement; this is the international copyright law ratified in ~99% of countries. As such any kind of agreement or NDA is irrelevant and not needed. NDA signing would be needed to prevent sharing the information (in one's own words); sharing the document entirely is already forbidden by default, even without any copyright notices, let alone agreements.

That said, of course a company like ST will not pursue copyright lawsuits against random individuals in random countries just because they redistributed the documents.

The reason they ask for information for download is just "hunger for data", entirely normal for large companies (and even smaller). It's "nice to know" how many, when, and who downloads their documents. They at least internally think this data offers value for them. How much value it truly offers, and how much is the cost of customers going away due to the nuisance is unknown. Although I don't think the nuisance cost is high. Everyone else does the same shit; everyone's used to that. No one is going to favor some other part supplier because of easier document download.

Now, if some company doesn't offer documents at all or require complex NDAs, then that will turn off some customers; that's a known (and companies who do this nevertheless know it and don't care; their business model). But entering some email to download is easy enough, people who want the documents live with that.
« Last Edit: June 28, 2026, 02:34:39 pm by Siwastaja »
 

Online Alien Brother

  • Regular Contributor
  • *
  • Posts: 68
  • Country: fr
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #1642 on: June 28, 2026, 02:52:51 pm »
acknowledge your identity
For an individual, an email address doesn't acknowledge identity though.

That said, I think CubeMX now does not need a login to download MCU software packages, which I think is an improvement.
 

Online Kjelt

  • Super Contributor
  • ***
  • Posts: 6736
  • Country: nl
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #1643 on: June 28, 2026, 09:50:26 pm »
acknowledge your identity
For an individual, an email address doesn't acknowledge identity though.
For an employee of a company that is customer with ST, the work email address is a valid check for identity and extra access rights to restricted documents. After I left the company I had to reregister with my own personal email address where I could have used an anonymous mail address indeed. But the access rights were gone.
 

Offline paulca

  • Super Contributor
  • ***
  • Posts: 6445
  • Country: gb
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #1644 on: June 29, 2026, 08:20:59 am »
Most professional emails contain [email protected]

Which is PII.
"What could possibly go wrong?"
Current Open Projects:  68000 Self Build computer + OS.
 
The following users thanked this post: Kjelt

Offline peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 6039
  • Country: gb
  • Doing electronics since the 1960s...
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #1645 on: August 03, 2026, 08:40:55 am »
Does anyone know what the productname.xml file in a Cube IDE directory does?

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<targetDefinitions xmlns="http://openstm32.org/stm32TargetDefinitions" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://openstm32.org/stm32TargetDefinitions stm32TargetDefinitions.xsd">
  <board id="xxx">
    <name>XXX</name>
    <mcuId>stm32f417vgtx</mcuId>
    <dbgIF>JTAG</dbgIF>
    <dbgDEV>ST-Link</dbgDEV>
  </board>
</targetDefinitions>

Mine is dated 2019 so may not be used.
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 6039
  • Country: gb
  • Doing electronics since the 1960s...
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #1646 on: August 26, 2026, 08:33:20 am »
That xml file appears to be a fossil from 2019. Deleting it seems to not have done anything bad.
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline paulca

  • Super Contributor
  • ***
  • Posts: 6445
  • Country: gb
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #1647 on: August 26, 2026, 08:56:13 am »
Ouch.  A brand new build env is just Tuesday.  Your has been there since 2019.  I cannot imagine what an eclipse that old is like.... or even an eclipse running with a workspace that old.  Probably daily hell.

Have you tried to respin a brand new env on a new PC?  Can you automate any of it?
« Last Edit: August 26, 2026, 08:59:35 am by paulca »
"What could possibly go wrong?"
Current Open Projects:  68000 Self Build computer + OS.
 

Offline peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 6039
  • Country: gb
  • Doing electronics since the 1960s...
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #1648 on: August 26, 2026, 01:25:59 pm »
I am running Cube IDE v1.14.1. There have been no evident improvements in later versions. The x.x.0 versions usually break something big, too.
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->