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

0 Members and 1 Guest are viewing this topic.

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 9687
  • Country: fi
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #1225 on: September 12, 2024, 05:44:46 pm »
Real namespacing (as in, e.g. struct members instead of bit mask #defines) also works flawlessly in basically all IDEs. With #defines, IDEs have a habit of just making suggestions based on dumb "text search" on all possible #defines, and can suggest totally wrong things. Lazy programmers who have developed habit of trusting IDE suggestions to be "valid" easily pick those wrong choices.
 

Offline paulca

  • Super Contributor
  • ***
  • Posts: 4438
  • Country: gb
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #1226 on: September 13, 2024, 07:50:28 am »
Real namespacing (as in, e.g. struct members instead of bit mask #defines) also works flawlessly in basically all IDEs. With #defines, IDEs have a habit of just making suggestions based on dumb "text search" on all possible #defines, and can suggest totally wrong things. Lazy programmers who have developed habit of trusting IDE suggestions to be "valid" easily pick those wrong choices.

We have testing.
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4396
  • Country: us
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #1227 on: September 13, 2024, 07:56:19 am »
Quote
do what SiliconWizard says, create proper structs using bitfields.

Except for the part where defining io regsiter structures down to the level of individual bits can get pretty ugly:

Code: [Select]
  sercom->USART.INTFLAG.bit.TXC = 1;

(and that doesn't work right either, and it's hard to see why!)
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 9687
  • Country: fi
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #1228 on: September 13, 2024, 08:02:29 am »
Code: [Select]
  sercom->USART.INTFLAG.bit.TXC = 1;

First fix: remove unnecessary boilerplate, compilers have supported anonymous unions/structs since forever:
sercom->USART.INTFLAG.TXC = 1

Then, to avoid RMW on volatile qualified register, do:
sercom->USART.INTFLAG = (sercom_usart_intflag_t){.txc = 1, .lsd=2, .cia=3};

This is still not effortless as you have to look up / remember / write compound literal type name (e.g. here sercom_usart_intflag_t), but at least compiler checks that target type matches with your compound literal type preventing a mistake on that stupid manual operation. Plus, you only repeat it once: then you can just type txc, lsd and cia and they are automagically from the correct namespace. In #defines you repeat SERCOM_UART_INTFLAG_TXC_SHIFT, SERCOM_UART_INTFLAG_LSD_SHIFT and so on.

So still not perfect, but less work and more systematic error prevention.
« Last Edit: September 13, 2024, 08:04:18 am by Siwastaja »
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 9687
  • Country: fi
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #1229 on: September 13, 2024, 08:07:04 am »
Real namespacing (as in, e.g. struct members instead of bit mask #defines) also works flawlessly in basically all IDEs. With #defines, IDEs have a habit of just making suggestions based on dumb "text search" on all possible #defines, and can suggest totally wrong things. Lazy programmers who have developed habit of trusting IDE suggestions to be "valid" easily pick those wrong choices.

We have testing.

You have got to be kidding me. This has been seen so many times. "No need to be careful and think about what I'm doing, testing catches it". Except that, how are the tests written? With the same attitude?

You realize it is impossible to fully test any non-trivial piece of software due to sheer number of combinations when you add state and interactions (not even talking about timing)? Your actual test coverage is like 0.00000000001% even when you think it's 99%.

You can't base your quality only on testing. Quality has to be on all levels. Prevent mistakes at every level.
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 16292
  • Country: fr
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #1230 on: September 13, 2024, 08:16:59 am »
In the agile world, it's all about "continuous delivery" and automated testing, so as long as you get the green lights or the sunshine icons on the build dashboard, quality is guaranteed, and you can ship.
 
The following users thanked this post: Siwastaja

Offline paulca

  • Super Contributor
  • ***
  • Posts: 4438
  • Country: gb
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #1231 on: September 13, 2024, 09:46:05 am »
You have got to be kidding me. This has been seen so many times. "No need to be careful and think about what I'm doing, testing catches it". Except that, how are the tests written? With the same attitude?

You realize it is impossible to fully test any non-trivial piece of software due to sheer number of combinations when you add state and interactions (not even talking about timing)? Your actual test coverage is like 0.00000000001% even when you think it's 99%.

You can't base your quality only on testing. Quality has to be on all levels. Prevent mistakes at every level.

In the average project plan, if dev says 20 days.  The total effort will come out to be around 100 days.  There is TWICE as much effort for testing than development 40% total effort.

I was going to elaborate, but I just spent over an hour in a "SDLC Quality Assurance Gates" meeting.  I'm going to do anything but think about testing for at least an hour :)
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Online zapta

  • Super Contributor
  • ***
  • Posts: 6374
  • Country: 00
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #1232 on: September 13, 2024, 12:37:54 pm »

You realize it is impossible to fully test any non-trivial piece of software due to sheer number of combinations when you add state and interactions (not even talking about timing)? Your actual test coverage is like 0.00000000001% even when you think it's 99%.


Some combinations are much more likely to occur when the system is used such that the effective coverage is much higher.
 

Offline peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4602
  • Country: gb
  • Doing electronics since the 1960s...
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #1233 on: September 13, 2024, 01:50:22 pm »
This is so far off topic :)

Test coverage is interesting because you can sell a product to 10 people and each of them does something different with it, or sell it to 100k people of whom all use just 5% of the functionality :)

In general, it is the original programmer who should know where the skeletons are most likely to be buried, and test those areas, but market exposure over years is still the best proof of the pudding.
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline paulca

  • Super Contributor
  • ***
  • Posts: 4438
  • Country: gb
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #1234 on: September 14, 2024, 09:08:15 am »
If all you need is a single programmer and you are only working on a single project,  you can do what you like.  It's just not software engineering.

The caution is that you are human Peter.  Your memory is volatile.
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Offline paulca

  • Super Contributor
  • ***
  • Posts: 4438
  • Country: gb
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #1235 on: September 14, 2024, 10:16:18 am »
You realize it is impossible to fully test any non-trivial piece of software due to sheer number of combinations when you add state and interactions (not even talking about timing)? Your actual test coverage is like 0.00000000001% even when you think it's 99%.

Actually those number are totally quantifiable.

"Coverage" is a term only used for testing unit sized chunks of code.  (Sub circuits).
We would run a full suite of unit tests which generate a report on "coverage".  It's not based on "Lines of code" alone.  It's also based on cyclomatic complexity coverage.  It will raise warnings on untested paths through conditions and exception paths.

When you are testing a unit of code which is 10 lines long and has 3 branching statements you can test this pretty close to 100% with only a dozen tests.  Your negative tests ensure that it meets it's contract when given invalid state or data.

You have 100 units?  You need 1200 tests?  Sounds about right, yes.  Maybe a bit high, hopefully not all have that high a CC.  It is hard though.  In "hard core" stuff, a method that takes 3 arguments, immediately has a CC of 6 as you MUST pre-condition your inputs.  You have 3 states which can be valid or invalid.  So the "un-optimized" CC is 6.  Then you have to validate your output (return value), this will make it at least 8.  When you are working in a code base that will fails the build if you hit a CC over 20 in a method, it can get a bit tight.  There are ways to refactor compound expressions to lower the CC by cancelling paths out.

Then we have integration tests, which more or less do the same thing, but specifically on the "intergation points" or "external contracts".  They differ in that these tests typically have to construct their harness, run it, populate it with a "known state", run a dozen tests and then destroy it again, for the next test along to rebuild it to a known consistent start state again.  These can often end up taking hours and are usually not run for every build.  They would be run when you wish to raise a pull request upstream, say.

The thing is.  We are still in the "Development Estimate" here.  "Testing" hasn't started.  Still in the 20% of effort.  One of the opening requirements for development to hand over to the test teams is that the Unit test and Integration test suite is reviewed and appropriate.

Then the real testing begins.  Not bottom up  testing, but top down testing.  There are many, many test strategies, tools, automation available to them.

There is an enterprise software thing which gets bashed a lot in one-man-bad, <10klc projects a lot and is usually referred to as "bloat".

Dependency chains.  If I need to sort a list or set of data, I could just write the most basic and appropriate sort routine right there in the code file.  It would probably end up a much shorter and more efficient implementation than the "canned generic, ones size fits all", framework sort routines available publicly open source.  (When it comes to things like maths and sorting, it is likely the off-the-shelf is a lot faster).  However, the moment you do write that, you now own the testing of it.

New code = bugs.
Pre-Tested code = less bugs.

The open source library containing the "accepted, defacto set of data manipulation function" you want, is probably downloaded by a million people every single day.  A subset of those will be pulling the source version and building it locally.  It contains a MASSIVE suite of tests.  However, it's not the tests necessarily that give the package "gravity", they only reassure us that the release qualities will be consistent, no, it is the millions and millions of software projects out there running this library, pumping trillions dollars around the world and if ONE of them should blow up because of this library, it WILL be raised in a matter of hours to the entire world.

So, when a junior asks me if they should just write the functionality instead of importing the library, it isn't really a "Functional" question.  It's a "non-functional" matter.  Non-functional requirements are a whole different ball game.  We need to consider ALL configuration items in the repo and justify each.  The pre-canned library was likely worked on by someone with far greater low level knowledge in the area than the junior before me.  It will come pre-tested, pre-validated and has millions of world wide use cases saying that it already works perfectly well and will not need tested by us.

In MCU world, your non-functional requirements are such to make most enterprises engineers comes out in sweats and want to go home.  When we calm down, we would just push the LEAST possible functionality into that non-functional regime.  Making it small, simple easy to develop, easy to test and thus cheap.  Then we would do the main bulk of the functionality somewhere else having the "micro" upload to the "macro" for processing.

No one size fits all though.  As suggested it often comes down to the non-functional requirements.

When someone tells you that your SLA, wire to wire, is sub 100uS.  When your SLA says you need to support 30k messages per second, per session and 40 R/W sessions.  That has a MASSIVE impact on how you go about things.

If the pre-canned C++ lib takes 23uS to sort the list and the bespoke, low-level C/inline ASM version takes 16uS.  It is easy to justify the extra testing effort to assure it.


"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Offline elektryk

  • Regular Contributor
  • *
  • Posts: 181
  • Country: pl
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #1236 on: November 12, 2024, 07:43:25 am »
Has anybody managed to run Cube IDE 16.1 on Win7?
Compilation goes ok but it can't write to MCU.
Cube Programmer doesn't even start but complains about Java, ST Link utility works but it doesn't support H5 series...
 

Offline peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4602
  • Country: gb
  • Doing electronics since the 1960s...
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #1237 on: November 14, 2024, 04:42:24 pm »
I recall testing 1.16.0 on win7-64 and it worked but the SWD debugger interface was broken, like it was on 1.15.0. The 1.15.1 reportedly fixed the debugger. This was much discussed on the ST forum (where ST basically deny everything, or don't respond).

However I can't help you much because 1.15.x installed GCC tools v12 which "breaks" various things - a few annoying things one needs to fix and then extensively re-test everything, and I could not be bothered so I am staying with 1.14.1. If you need the .exe installer, PM me. ST keep only the .0 releases on their website ;)

AFAICT everything runs on win7-64 just fine, despite the release notes saying all kinds of stuff.

Don't waste your life chasing the latest version of this moving-target tool.

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

Offline DavidAlfa

  • Super Contributor
  • ***
  • Posts: 6542
  • Country: es
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #1238 on: November 14, 2024, 08:34:09 pm »
You can just copy the compiler from any version you want, then set the toolchain in the project settings.
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4602
  • Country: gb
  • Doing electronics since the 1960s...
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #1239 on: November 14, 2024, 09:20:09 pm »
Yes I discovered that, but

- it is a hassle, especially as you then have to document the convoluted procedure for any future person working on the project
- GCC v12 has no advantage over v11
- any new warnings need to be chased down, perhaps a day's work, plus regression resting of all the product(s) ;)
- Cube v1.16 or v1.15 have no advantage over 1.14.1. Perhaps support for new chips... more relevant to Cube MX.

Quote
Cube Programmer doesn't even start but complains about Java, ST Link utility works but it doesn't support H5 series...

There are some posts here about those tools. They have mostly been obsoleted by ST and indeed the latest versions have some Java issues. I think, see here
https://www.eevblog.com/forum/microcontrollers/production-loading-of-code-into-a-st-32f417/
« Last Edit: November 14, 2024, 09:24:51 pm by peter-h »
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline NorthGuy

  • Super Contributor
  • ***
  • Posts: 3325
  • Country: ca
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #1240 on: November 15, 2024, 04:14:54 am »
I have a very pragmatic view of updates and upgrades - if it's not broken, don't fix it.
 

Offline dietert1

  • Super Contributor
  • ***
  • Posts: 2537
  • Country: br
    • CADT Homepage
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #1241 on: November 15, 2024, 07:29:23 am »
We have a mixture of W7, W10 and W11 and i remember problems this year after installing and using CubeMX on one of the W10 computers in 2023. When trying to bring back a project to a W7 machine the older CubeMX won't open the project and after installing the newer CubeMX it would open the project but the "yyy Configuration" panel under "xxx Mode and Configuration" always remained empty. Followed some confusion: Reinstall the older CubeMX version on W7, reproduce that project by hand, more tests. Right now the W7 machine runs CubeMX 6.6.1. Current version is 6.12.1.
I'd say some friction is part of the job. As far as i understand STM developers publish versions with errors but they do work on known problems and post revisions.

Regards, Dieter
 

Offline peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4602
  • Country: gb
  • Doing electronics since the 1960s...
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #1242 on: November 15, 2024, 08:35:56 am »
Yes I must admit Cube MX will have issues - because it needs to be updated to whatever latest chip you want to use. No way around that.

But AFAIK Cube IDE doesn't have that problem. There are .h files containing #defines for loads of CPUs but AFAIK there #defines are used only by

- some "HAL" code (this gets generated if somebody used Cube MX to start off your project, as happened with mine in 2016)
- the debugger interface possibly needs to know the CPU type

There is probably a way to specify the CPU type as a command line parameter in the debugger invocation. I've never been that deep in there though. However, I am using Cube IDE, #defined for a 32F417, to build and STLINK-debugger-load a 32F437 (which is known to be an exact superset of the 417) and it all works with no errors or warnings. So it isn't an absolute requirement.

Quote
I have a very pragmatic view of updates and upgrades - if it's not broken, don't fix it.

Yes, exactly, especially as you have absolutely zero hope in hell of following the continuous ST "development" process. You would spend the rest of your life trying to follow it. And that's before one gets onto them changing the various add-ons like replacing FreeRTOS with Azure.

« Last Edit: November 15, 2024, 08:57:14 am by peter-h »
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline elektryk

  • Regular Contributor
  • *
  • Posts: 181
  • Country: pl
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #1243 on: November 15, 2024, 10:21:28 am »
You can just copy the compiler from any version you want, then set the toolchain in the project settings.

In my case I'd rather switch to other GDB server version or just use (external) OpenOCD, because compilation itself works.

I have a very pragmatic view of updates and upgrades - if it's not broken, don't fix it.

Yes I must admit Cube MX will have issues - because it needs to be updated to whatever latest chip you want to use. No way around that.

That's the point, it can be said that they simply force it (when introducing new MCUs).

« Last Edit: November 15, 2024, 10:32:27 am by elektryk »
 

Offline peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4602
  • Country: gb
  • Doing electronics since the 1960s...
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #1244 on: November 15, 2024, 11:47:47 am »
Only if you need to use MX :)

My project was thus started, by someone else, and AFAIK it did save the guy a fair bit of time. He was using one of ST's "Discovery" boards, which - like most people - was then used as the basis for the actual product. On the one hand, this saved a lot of time - perhaps a man-month - but when I took the project software over later on, a lot of the ex-MX stuff had to be re-hashed, negating some of the time saved.

I would also caution against using any brand new chip. Lessons need to be learnt from the covid mess... the winners were those who used "old stuff". And out of ST's vast range of MCUs, do you really need the latest one?
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline elektryk

  • Regular Contributor
  • *
  • Posts: 181
  • Country: pl
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #1245 on: November 15, 2024, 12:37:29 pm »
I personally like such "old stuff", unfortunatelly old MCUs are becoming more and more pricey, less available and risk of clones is a lot larger than with modern ones.
 

Offline peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4602
  • Country: gb
  • Doing electronics since the 1960s...
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #1246 on: November 15, 2024, 12:53:57 pm »
Clones are a good thing, surely? I am using a 32F417 and if I use software crypto then there is a chinese 32F407 which "should" be the same.

If you need 400MHz+ then yeah you need the later chips. Some people also need very low power, but in many cases you can do that by shutting down VCC most of the time.

What I have seen is that full time employees like picking the latest chips (because the company is picking up the huge bill for the learning curve, and extra parts stock) while contractors and business owners stick with chips with which they have lots of experience :)

I also have not seen the 32F417 get more pricey. It is roughly back to pre-covid levels now. Which chips have you seen go up significantly?
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline Kjelt

  • Super Contributor
  • ***
  • Posts: 6618
  • Country: nl
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #1247 on: November 15, 2024, 02:20:33 pm »
If Cubexxxxx can run without internet connection it could be interesting to investigate using VM images.
You can just store each released version with the matching image in your preferred repository with your preferred version control system. Perhaps RT debugging might give issues but compiling should work.
 

Offline peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4602
  • Country: gb
  • Doing electronics since the 1960s...
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #1248 on: November 15, 2024, 02:39:52 pm »
Quote
If Cubexxxxx can run without internet connection

It can and I have my whole project set up in a win7-64 VMWARE VM, running on win7-64 and win10 hosts. Some have networking disabled.

It doesn't run as fast as it does on the host, although this improves after some minutes. This is on a 24GB RAM 6xi7 machine. Cube is very resource hungry. The one VM I struggled with was a win10 guest (on a win7-64 host) which runs so slowly it is barely usable, but this could be the VMWARE player version needed for a win7-64 host (not the latest).

You can anyway disable Cube's update etc checking and other telemetry. As such it is a great long term project tool. Just archive the VM. Make sure that when you move that VM, you choose Moved and not Copied ;) otherwise the copy of windoze inside the VM will need a new reg key ;)

It's a while since I tried running the STLINK debugger out of a VM. It "should work" :) but you have to deal with the usual USB issues where both the host and the guest will try to access the same USB port.

An interesting Q is whether I would embark on a project like mine without using MX to get started. I probably would not if starting from scratch (say, coming from a Z80). But from where I am now, if say I had to change to the H7, I would not use MX. I would just hack around my existing project. MX helps with loads of trivia like pin to function allocation, but you anyway must read the whole 300 page DS, word by word, before doing the PCB design...



« Last Edit: November 15, 2024, 02:47:42 pm by peter-h »
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline paulca

  • Super Contributor
  • ***
  • Posts: 4438
  • Country: gb
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #1249 on: November 16, 2024, 11:32:33 am »
Remember regarding updates...

CubeMX is just a set of plugins for eclipse.  The stack consists of Eclipse base IDE + 3rd party extensions like the CDT and others.  Then STM32 add their plugins.

So, it's likely that STM32 could release a new version where there are no real updates to their plugins, but the CDT and base IDE for a dozen bug fixes and nice to haves.
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf