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

0 Members and 7 Guests are viewing this topic.

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15444
  • Country: fr
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #225 on: December 24, 2021, 05:31:32 pm »
The title is actually pretty soft given the things I've seen/experienced in the past :-DD

Yeah, if you want to do that in Professional Style, how about:

"ST CubeMX considered harmful".

Oh yes. But according to some people (remind me of another thread), claiming that something is considered harmful is, itself, harmful. :-DD
 

Online peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4162
  • Country: gb
  • Doing electronics since the 1960s...
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #226 on: December 24, 2021, 07:18:06 pm »
Currently, the issues which appear fixed are

- the occassional invisible text appearing in the console window (probably text in a white font, because you could see it by swiping it and pasting into Notepad) has not been seen by me since 1.7, but this remains to be verified by a colleague on whose laptop it was last seen... but may not be since he is changing his laptop for a new one

- unreliable debugger (STLINK V2 or V3) connection, regardless of which speed was configured (I know STLINK v3 ISOLATED needs a lower speed to be set due to the optoisolators, but it depends on which of the debug cable connectors is used - I recall posting on this topic extensively in detail)

- the SWV ITM debug would always crash the target (or the debugger) after a minute or so; this now seems much improved (I mostly use a USB VCP debug instead of SWV, although SWV has the potential of being much faster, at say 1mbps or 2mbps)

New issues:

- the config for whether a breakpoint is auto-inserted at main() seems to have been removed (it is always inserted)

- in the SWV ITM debug config, the Limit SWO clock is mandatory (the newly invented auto speed detect does not work, at least not with SWLINK V3 ISOL)

Remaining issues:

- in debug mode (build with F11) a random file gets opened, so as you do debugging your source window fills up with spurious open files which you have to keep closing (looks like 1.8 has improved that a little)

A debatable issue is whether Cube should detect that a file has been modified elsewhere but in the Cube editor. You get the most bizzare issues if you do that, so after any such thing one has to re-index, Clean project, and Build project.

Obviously the ST errata never mentioned any of the above ;)

The above is from my very superficial usage of maybe 1% of the Cube features. I am sure an expert user will find many more issues. I never used the Cube MX (the code generator) portion, and looking at the bloated code it generates I am hoping to totally avoid having to ever use it on this project.
« Last Edit: December 24, 2021, 08:22:08 pm by peter-h »
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15444
  • Country: fr
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #227 on: December 24, 2021, 09:01:59 pm »
A debatable issue is whether Cube should detect that a file has been modified elsewhere but in the Cube editor.

Well, it's not debatable IMO. All decent editors do that. I'm trying to remember the last time I used an editor that didn't have this feature, in a multi-tasking environment. I can't.

Thanks for listing all this though, it's sad but entertaining! ;D
 
The following users thanked this post: Siwastaja, newbrain

Online Kjelt

  • Super Contributor
  • ***
  • Posts: 6576
  • Country: nl
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #228 on: December 24, 2021, 10:13:44 pm »
"you seem to be in an insightful and generous mood today."

:) :) :)

I think that's known as a "backhand compliment" :)

I don't think one can rename threads. Only subsequent posts' title gets renamed.

Merry Xmas All :)
If you rename the topic title in your first post all generic replies will get the new topic title, not generic replies eg quotes will get the Re:topic title of the quoted user.
In other words in a few weeks all new posts will have the new title  :)
 

Online peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4162
  • Country: gb
  • Doing electronics since the 1960s...
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #229 on: December 24, 2021, 10:54:37 pm »
I don't think changing the title is deserved. Cube has a load of bugs which will be discovered within the first hour by anybody. If this was some typical open source project (the sort of thing I like to jokingly describe as "supported until the young and keen coder gets himself a girlfriend") that would be normal. A large % of source code posted online (in places like stackexchange, github, etc) doesn't even work at all. But a company with the resources of ST can and should do a lot better. More importantly they should also do a lot better with their libs, which are ridden with bugs, which everybody spends time fixing, but the fixes almost never get posted anywhere because they were done by salaried people who aren't supposed to be helping their employer's competitors.

Re the checking for external file modification - presumably the editor needs to keep track of last-modified date stamps, or maintain a CRC of each, and a decision was made (in Eclipse) to not do that. Quite how Cube fits into a multi user scenario I have no idea. Usually one implements file level locking (so multiple people can't edit the same file but can edit different ones). AIUI this is normally implemented with some sort of VCS, but I have avoided that also (a long thread here somewhere on which VCS to use) :)

Re the opening of random files - I have noticed that the file opened is not random anymore. It is now the same file every time (in v1.8 ). It just happens to be a file that doesn't contain any breakpoints ;)


« Last Edit: December 24, 2021, 10:58:38 pm by peter-h »
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 28113
  • Country: nl
    • NCT Developments
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #230 on: December 24, 2021, 11:54:36 pm »
The problem is not ST but Eclipse itself and further below deck: Java. It is a miracle that the creators of Eclipse got this far with a Java application.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 
The following users thanked this post: Siwastaja, newbrain

Online Kjelt

  • Super Contributor
  • ***
  • Posts: 6576
  • Country: nl
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #231 on: December 25, 2021, 07:34:02 am »
Name one microcontroller firm that offers a free professional developed compiler ide , configurator, support forum and has no bugs.
Name one microcontroller that has no errata sheet because it is perfect. Rest my case.

Merry Xmass by the way.
 

Online dietert1

  • Super Contributor
  • ***
  • Posts: 2419
  • Country: br
    • CADT Homepage
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #232 on: December 25, 2021, 07:47:39 am »
Lamenting about presents isn't what we should do on Christmas.

There are reasons why STM32 products are mainstream and some others aren't. I'd guess one of the reasons is the availability of Cube. Everybody can try and form his/her own opinion. Engineers who don't have any choice but use a free development environment are a sad case. I understand the sorrow.

Regards, Dieter
 

Online Siwastaja

  • Super Contributor
  • ***
  • Posts: 8908
  • Country: fi
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #233 on: December 25, 2021, 08:25:42 am »
There are reasons why STM32 products are mainstream and some others aren't. I'd guess one of the reasons is the availability of Cube.

:-DD

You know, you might not remember it for obvious reasons better left to the readers to see, but Cube is still fairly new. STM32 has been pretty much the mainstream ARM MCU long before. I was already commenting in these same kind of discussions here on the EEVblog when you absolutely had to use Coocox or you weren't a cool kid, because Coocox is and will always be the de facto standard of embedded development, and those who say they don't need it are boring and stupid.

It took quite some time before Cube fanclubs like yours started to form, because transitioning from one fanclub to other, closing the old down requires some mental acrobatics. Still just a few years ago, people like you were openly laughing at CubeMX. Now it's the best thing since sliced bread.

I'm glad I never wasted my time in these moving targets, and just get work done instead. I understand the appeal to beginners, though, and there's nothing wrong, it's the whole point. Beginners teaching capable professionals how to think correctly is just something that is so ridiculous it sets me off. Yes, I also used to receive a lot of criticism of not using Arduino in my professional projects back when Arduino was trendy. Now it sounds unbelievable, but it was reality a decade ago. This just goes away, and is replaced with something else.

Seriously speaking, two reasons stand out for the popularity of STM32; large availability of many different parts with varying combinations of peripherals, and affordable prices. You can (well could before the crisis) get the parts, they don't cost arm (pun intended) and leg, and get the work done. This is all so important that people accept mediocre documentation and fairly large silicon errata.

But Cube doesn't hurt because they don't force you to use it. Having options for different user groups is always a good idea, and because users of something like Cube are not very demanding, these tools can be left buggy and don't need much maintenance resources. Trainees can write them, and then a replacement comes 3-5 years later when managers come up with something new on Powerpoint. What's best, the users who "liked" Cube only nag for a a year or two but then happily start advocating the next piece of crap tool, denying the existence of anything before it, and the cycle goes on...
« Last Edit: December 25, 2021, 09:11:08 am by Siwastaja »
 

Online peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4162
  • Country: gb
  • Doing electronics since the 1960s...
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #234 on: December 25, 2021, 09:56:35 am »
" It is a miracle that the creators of Eclipse got this far with a Java application."

That's very funny :) But true; all java apps I have used were crap. Loads of weird bugs, and dependencies on java version, on the underlying environment, etc. One java expert I know says it is good for server side programming (where the environment can be stable for as long as you can manage, and you are ultimately just squirting out HTML to the client) but is crap for client side applications. Java is a job for life, along with the Cisco certified engineer qualification, COBOL66 and Ruby on Rails :) Cube actually works pretty well considering it was written in java.

"There are reasons why STM32 products are mainstream and some others aren't. I'd guess one of the reasons is the availability of Cube."

I've been in the uP/uC scene since late 1970s. IMHO the reasons why ST are big are

- adequate functionality (who needs 10 (?) DMA controllers and 15 (?) timers?)
- good pricing; ST are actually a hidden gem in this age of chip shortage, with some little-known simple chips for designing-out Maxim parts ;)
- a big stable company with long product runs; quite similar to say Hitachi whose H8/300 ran for ~25 years
- big in the automotive market where production stability is important
- European company, benefiting from the dislike of American companies (commonplace among European champagne socialists ;) ) and benefiting from European cultural and language barriers and prejudices

In the hobbyist market (in which I include hobbyists who get a job in some company and design-in some "great chip" from e.g. Atmel which gets dropped 3 years later) lots of other devices exist. I've designed-in a few of those too :)

For ST, this table
https://www.st.com/content/st_com/en/about/quality-and-reliability/product-longevity.html#10-year-longevity&section=FM141-10-year
is probably real and will probably be exceeded in most cases.

Now, how long do you think Espressif will be doing the ESP32-WROOM-32E for? They claim a 12 year production lifetime, but who will rely on that? They reportedly do have very well debugged libs for "IOT" stuff, with TLS actually working out of the box, unlike ST's libs.

The availability of the free Cube is probably good for individuals getting started, but the big users (mostly big companies) don't care about development tool cost. The great thing about Cube is that you can get started without reading the 2000 page RM. That's how the project I am working on got started (by someone else). But once you know the chip, or more precisely the bit of it that you need to know, bare metal programming is easy enough. I've just done a waveform generator on which most of the code was bare-metal.


« Last Edit: December 25, 2021, 10:10:29 am by peter-h »
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15444
  • Country: fr
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #235 on: December 25, 2021, 07:22:47 pm »
The problem is not ST but Eclipse itself and further below deck: Java. It is a miracle that the creators of Eclipse got this far with a Java application.

Ahah, this was fun indeed. I do not have much consideration for Java myself (and usually - but I try avoiding gross generalizations of course - for many Java developers either), so I'd be biased here.
One problem related to Java is its cross-platform nature, while being a general-purpose language. Certainly, detecting that files are modified outside of the current process is a task that is tricky by nature if you want to implement this in a cross-platform way. Just a general thought - I do not know Java in details enough to know if doing this is actually hard or not, or how reliable it is depending on the platform. But that consideration can be extended to many other features. Cross-platform is hard, and ridden with pitfalls.

Now I do not agree with the statement "the problem is not ST" (even though you said that to point to Eclipse). Any vendor is responsible for their products, whatever said products are made of. If ST made a poor choice for one component of one of their products, it's THEIR full responsibility. Just wanted to make this point. Oh, and, beyond Eclipse itself, I have no doubt that ST was able to introduce a few bugs of their own. ;)
« Last Edit: December 25, 2021, 07:24:31 pm by SiliconWizard »
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15444
  • Country: fr
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #236 on: December 25, 2021, 10:05:09 pm »
- adequate functionality (who needs 10 (?) DMA controllers and 15 (?) timers?)
- good pricing; ST are actually a hidden gem in this age of chip shortage, with some little-known simple chips for designing-out Maxim parts ;)
- a big stable company with long product runs; quite similar to say Hitachi whose H8/300 ran for ~25 years
- big in the automotive market where production stability is important
- European company, benefiting from the dislike of American companies (commonplace among European champagne socialists ;) ) and benefiting from European cultural and language barriers and prejudices

Another reason (to me anyway): one of the few vendors with several lines of ultra-low power MCUs, still quite powerful. In particular, the L4, L5 and now U5 lines are very hard to beat from a performance/power ratio point of view, with impressive figures both for active modes and low-power modes. Sure they are not the only ones there now, but with such figures and such a large offering at those prices? Not a whole lot of competition either.


 

Offline rcbuck

  • Frequent Contributor
  • **
  • Posts: 354
  • Country: us
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #237 on: December 25, 2021, 10:32:27 pm »
This is a question for the "professionals" that use bare metal programming on the ST32 family. I am not a professional developer. I only use microcontrollers for my hobbyist projects. I have been an electronics hobbyist since the 1960s. My career days were  in the communications and computer fields. Not product development, just service and maintenance.

I started using STM32 parts about 3 years ago after 22 years of using Microchip parts. I used all assembly coding until I started using C about 10 years ago. With the Mchp parts I used bare metal programming. In the early days there were no automatic code generation tools. So bare metal was the only way to go and it became second nature for my projects. I never used any of the Mchp code generation or pin assignment tools.

I originally used CubeMX and System Workbench for my STM32 projects. However, I quickly switched to STM32CubeIDE as my development platform. My projects are fairly simple. I use resources such as USART, I2C, LwIP. I have never had the need for USB in any of my projects. I have never found a bug (to my knowledge) in STM32CubeIDE as all my projects work as designed.

My last project was a 6 digit LED clock (HH:MM:SS) that uses a Ublox GPS module as the time source for the clock. I used a STM32F103 for the controller. The final code size was 2.12 KB RAM (out of 10 KB) and Flash 10.6 KB (out of 32 KB). Speed is not a problem and code size is obviously not an issue. I used CubeIDE to setup the STM32 clock, GPIOs, USART, Interrupts, and Watchdog timer. All of the generated code works fine. I simply had to add my own code to make the hardware work as designed. So what would bare metal programming gain me?

It might be fun to duplicate the clock project using bare metal programming. This would enable me to see if there is any real reduction in code size. Code size reduction would obviously not gain me anything. But I guess it would be a good learning experience for my next project.

Any suggestions for the "best" site to explain how to setup a bare metal project for STM32? What tools (IDE, complier, libraries) would you use? My guess is the compiler would have to be GCC. But how do you tie everything together?
 

Online dietert1

  • Super Contributor
  • ***
  • Posts: 2419
  • Country: br
    • CADT Homepage
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #238 on: December 25, 2021, 11:09:26 pm »
I have been using Cube for pin assignment and hardware init code generation. Then i worked with IAR IDE for coding and debugging. Nice tools once you got used to them. I refrained from using GCC with Arm Cortex after a comparison with IAR compiler output some years ago.

We also have reusable code for bare metal Cortex projects that were pure IAR projects for Kinetis parts. A lot of work went into those. You need somebody who works through the complete reference manual. Otherwise you risk building a system where one of thousands of registers with hundred thousands of setup bits doesn't get initialized properly. The same can happen when using a generator like Cube, but it will save some work anyway. It's good engineering practice to use tools that everybody else is using, too.

Regards, Dieter
 

Online Kjelt

  • Super Contributor
  • ***
  • Posts: 6576
  • Country: nl
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #239 on: December 25, 2021, 11:28:01 pm »
The reason for popularity of stm32 IMO is the combination of the lowest price per unit in very large quantities and the fact that ST has multiple ROM/RAM sizes for the same type uC in the same package thus enabling debugging on the final pcb with the largest version available and for the final product use a cheaper version (which fits and has room left for future updates).
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 28113
  • Country: nl
    • NCT Developments
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #240 on: December 26, 2021, 12:00:14 am »
The reason for popularity of stm32 IMO is the combination of the lowest price per unit in very large quantities and the fact that ST has multiple ROM/RAM sizes for the same type uC in the same package thus enabling debugging on the final pcb with the largest version available and for the final product use a cheaper version (which fits and has room left for future updates).
The price is probably the main reason; many people look at part price only and forget about NRE. From a technical perspective the ST parts never appealed to me (a long time ago I evaluated the STR700 series and I got the impression it was designed by a 3 year old; probably the worst MCU I ever came across) and the cross portability between device series is also quite poor. All MCU vendors offer different memory sizes in the same package so that is not unique to ST.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline NorthGuy

  • Super Contributor
  • ***
  • Posts: 3251
  • Country: ca
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #241 on: December 26, 2021, 01:24:11 am »
The reason for popularity of stm32 IMO is the combination of the lowest price per unit in very large quantities

I don't think they ever had lowest price, but they look rather expensive now. I've looked at DigiKey, filtered out all 100 MHz MCUs (to get rid of cheap 8-bitters and such), sorted by price for 10000 units. This should give a rough picture of the prices. I found STM32 only at the end of fifth page. Here's what I encountered on the way:

Microchip (proper) - 1.43
Microchip (former Atmel) - 1.78
Kinetis - 2.21
Maxim - 2.44
TI - 2.50
Renesas - 2.84
ST - 3.10

Some of that stuff was actually in stock, but not SMT32, of course.
 

Offline rcbuck

  • Frequent Contributor
  • **
  • Posts: 354
  • Country: us
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #242 on: December 26, 2021, 05:05:37 am »
Quote from: dietert1 Yesterday at 11:09:26 pm
Quote
have been using Cube for pin assignment and hardware init code generation. Then i worked with IAR IDE for coding and debugging.
I think any commercial IDE is too expensive for hobbyist use. If there is a better free IDE that includes debugging than STM32CubeIDE I would like to know what it is.

NorthGuy, I agree with you the STM32 parts have never been the lowest cost MCU. Maybe the lowest ARM part but I'm not sure about that. For small projects that don't need a lot of processing power I still use Microchip parts. They are the lowest cost vs performance that you can get. Some of their parts have peripherals that are not available in most other MCUs. Most of their 8 bit parts appear to be in stock at Mouser and DigiKey even with the great parts shortage.
 

Online Siwastaja

  • Super Contributor
  • ***
  • Posts: 8908
  • Country: fi
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #243 on: December 26, 2021, 08:39:05 am »
So what would bare metal programming gain me?

Not necessarily anything, but it depends.

You oversimplify the question a bit. There are actually more to this:
* Bare metal programming vs. using pre-made hardware abstraction libraries,
* Which hardware abstraction libraries to use, and do they help or hinder;

Then a completely separate question,
* Which tooling to use - only barebones GNU tools, or an added point&click layer on top?

Only now we can start to answer your question.

The main marketing argument for hardware abstraction layers is portability. Because of non-existence of standardized microcontroller peripheral API, and total difference of each HAL, and the fact that between different MCU families, code needs manual porting anyway, this argument is completely out of window.

The secondary argument, ease of development, has some merit to it. OTOH, as your projects are very simple, for example initialization of UART bare-metal in STM32 is three lines of code. I write it in 5 minutes from scratch, or copypaste it from previous project in 30 seconds. Either is fine. Looking up how the same is done in HAL from HAL manuals, or copypasting from previous project, or letting Cube to autogenerate is, is pretty much exactly the same amount of work. No difference here.

So all this isn't me being against Cube or HAL, all this is me being against the idea of Cube and HAL being somehow mandatory or extremely beneficial. Actually, just "Keep it simple" and "avoid excess layers" is argument enough not to use them.

Now to the "what you gain" question. Not necessarily anything, that depends. I feel I gained my whole "career" if you could say so, but this is impossible to prove without "alternative reality" to be compared against.

Again two sub points:
* Being tool agnostic (or limited to the minimum common denominator, the GNU tools), allows you to jump between different manufacturers quickly. No problem using NXP or Nordic Semiconductor in between STM32 work. All works the same! Everything's familiar! Same linker script syntax works, same initialization code works, even the way manuals are presented is familiar. No need to install anything to your computer!

* Being in total control of the peripherals becomes important right when you hit an edge case where the HAL simply is unable to do the job. For the very simplest jobs, this might not happen, but I would be surprised if you have not seen this yet. It's a very common occurrence if you read this forum, for example. And oh boy people really struggle trying to achieve something with the libraries which the library is not designed to do (even if the underlying peripheral supports it).

Examples of this is: making peripherals co-operate by existing on-chip routing; managing DMA buffers differently than the HAL designer thought; very fast ISRs (for example, just a week ago, I had to write ISR-based state machine which processes data at 555.5kHz interrupt rate. There is simply no room for any bloat, not even 10 instructions. I need to be in control! Now the common way to deal this today as evidenced on this forum for example, is just to shout "no can do" and give up. I don't have this problem because of choices I make. Addition of CPLD was considered. It was not needed, which simplified BOM and also the workload of not needing to write VHDL. See how everything's connected? By having as much choice and "power" as possible, you limit yourself the least.)

Quote
Any suggestions for the "best" site to explain how to setup a bare metal project for STM32? What tools (IDE, complier, libraries) would you use? My guess is the compiler would have to be GCC. But how do you tie everything together?

Sad part is lack of tutorials.

The quick answer is, install gcc-arm-none-eabi package. IDE is your free choice. I use text editor and makefiles. You don't even need to use makefiles if this seems difficult. Compilation really can be done with one-liner command. No libraries, except for standard C library and special needs (like filesystems etc).

Tie everything together? There is not much to "tie" so to speak. These are actually simple devices! All you need is startup code, linker script, actual code, and run gcc to provide .elf you can flash. Maybe objdump for conversion of the output file format. To write peripheral code, you look at the reference manual and register descriptions, exactly like you did on PIC or AVR.

But this is just the big picture. Small details always takes the most time. There, a proper tutorial would be helpful. As much I'd like to write it, I'm not too great doing that; also it takes a lot of time and effort to teach something, even if it feels completely trivial to oneself.
« Last Edit: December 26, 2021, 08:45:59 am by Siwastaja »
 
The following users thanked this post: rcbuck

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11780
  • Country: us
    • Personal site
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #244 on: December 26, 2021, 09:00:16 am »
Any suggestions for the "best" site to explain how to setup a bare metal project for STM32?

I have a collection of very basic bare-metal projects for pretty much every MCU I touch, including some STM32. Here is one as example - https://github.com/ataradov/mcu-starter-projects/tree/master/stm32g071 And once you have this, it is trivial to make a project like this for another MCU. In most cases all you need to adjust is the vector table and the demo code to use the peripherals of the target device. The vector table can be taken from the datasheet or a device pack.

There is no tutorial, but things are pretty simple if you just look at the code. You will need arm-none-eabi-gcc (basically any version will work, I use "official" ARM one). You will also need basic tools like make. Once you have all those things, all you need to do is run "make" in the "make" directory. You will get a binary file.

One thing that bare-metal gives you is full control over your project. I often see people not use full potential of the device just because they are "afraid" to touch low level files. Not necessarily because they afraid that they will break something, but because they are afraid that new code generation after some changes in the wizard would overwrite their changes. So this may turn into the maintenance nightmare.

Some people think that going bare-metal means you have to completely abandon all the libraries and write everything from scratch. This is generally not true. While it probably more work than it is wort to use vendor UART or SPI drivers, you can absolutely integrate more complex things like USB.
« Last Edit: December 26, 2021, 09:08:15 am by ataradov »
Alex
 
The following users thanked this post: boB, rcbuck, tellurium

Online Kjelt

  • Super Contributor
  • ***
  • Posts: 6576
  • Country: nl
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #245 on: December 26, 2021, 09:08:54 am »
All MCU vendors offer different memory sizes in the same package so that is not unique to ST.
Perhaps this changed the last few years but 5 years ago this was a main selling point.
When for instance NXP had two or three memsizes , ST had five or more.

The reason for popularity of stm32 IMO is the combination of the lowest price per unit in very large quantities
I don't think they ever had lowest price, but they look rather expensive now. I've looked at DigiKey, filtered out all 100 MHz MCUs (to get rid of cheap 8-bitters and such), sorted by price for 10000 units. This should give a rough picture of the prices.

No this tells you nothing. 10k units/yr no ST sales rep is going to call you back  ;)
Digikey is a distributor, I am talking about fixed yearly quantity orders directly at ST , and we are talking more then half a million chips per year fixed quantity contracts and even larger.
The numbers were so big and the chips so popular even in asia that a chinese manufacturer found a business case developing a clone, the notorious GD32. Should say enough.
 

Online peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4162
  • Country: gb
  • Doing electronics since the 1960s...
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #246 on: December 26, 2021, 09:17:04 am »
Even at 1k+ Digikey / Mouser pricing is about 2x what you pay from a proper distributor, once you get into "supported pricing" and the other gimmicks which the industry uses. These firms offer a fast service, good websites with easy product selection, often better availability than the distributor scene (but you pay for it). I use Mouser too, lots, but would not use them for production. So these firms are a bad indicator of prices actually paid, and large OEMs pay far less again. I buy 10k+ of a HP optoisolator which on the disti scene is about 60p, and a customer of mine who buys 1M+ pays 25p.

How time-consuming "bare metal" is depends on the extent to which you can re-use the same debugged platform for different projects. The thing I am working on was started entirely with MX, but to avoid "total uncontrolled bloat" the guy used a separate installation of MX, generated each function, copied it across to the real project, and disposed of the original MX setup. He was on this project part time (1 day a week). Then about a year ago I realised it would never get finished at that rate so somewhat reluctantly I got stuck into it, with quite a learning curve (no C for 10+ years, and a long career in asm coding).

And I was glad I did because it's been great to get back into coding. One of the things I found fairly quickly was that the ex-MX code was doing the same things all over again e.g. the clock divisors for APB1/APB2, the DPLL etc, were getting set up multiple times, in different auto-generated functions. One of these was even called from the .s startup code. Maybe there was some "grand scheme" behind it but I never found it. I think the MX functions are written mostly by ex-college kids. So I chopped huge duplicated chunks out of it. I had to get into the detail of it because I was implementing a boot loader which had to have all the basic config but be fairly small, etc. But once this product is working, if I want to build another product I will re-use this one completely. It would be absolutely dumb to start again. Once you have a 168MHz 32F417 board running, with the CPU power of 1 core of a Cray 1, and you have APIs for the ADCs, DAC, etc, you can do "anything" with that.

Of course this is possible only if you have lots of control over how you work; most hw and sw designers don't (which is why most sw guys in "normal employment" go crazy around 40+ and want to get out of sw, with a 2000 page RM for each new piece of silicon, but that's another story). But I own my business so can just decide to use the same platform for absolutely everything. Which is just as well since I am in my 60s :) Customers don't care what is inside so if you own the business you can choose for "least stress", and e.g. I am still strongly selling a product based on a H8/300 which I did in 1994, and which was obviously done bare-metal, mostly in asm, and while the CPU is no longer made I have a large stock of the chips. One day soon this box will be replaced with this 32F417 one, anyway.

And I've just done a little project like that: a waveform generator which uses DMA and some timers. The original project doesn't use DMA and uses only one timer (apart from hidden DMA usage like ethernet, for which one just uses the ST library otherwise it would take one 10 years to get anything finished). This little project was done bare-metal, because all the rest (including a USB-accessible file system with FatFS, FreeRTOS, etc) can be left alone, and reading up on how to config the basic regs for a timer is pretty easy. And the bonus is that you can understand what is happening, whereas if you use MX to generate a function for driving SPI you will get hundreds of lines of bloat, checking every possible option (e.g. is CRC in use?) at runtime. Or you get an interrupt handler which checks about 20 possible sources, on the way to the actual ISR; I could not believe what I saw. You also get a lot of code handling error conditions which are impossible unless the actual silicon is defective (e.g. a UART TX set up for 9600 baud and with no handshake will have space in the TX buffer every 1ms, so no need for special error handling). Only a monkey could have written such code, especially that ISR with 20+ checks.

And I can see generating a whole family of products this way. If I now wanted to do something "completely useless and just for fun" e.g. a clock displaying time on a big LCD, I would do it the same way. I have generic code for using SPI3 for an unlimited number of peripherals, for expansion, etc. I would just buy an SPI-interfaced LCD.

The benefit of this is that each new project tests all the old stuff. So my waveform generator ends up testing a great deal of the old code too.

But I can see MX gets a lot of people going, fast, if they just want to knock something up. I would be worried doing that on a key production item though, looking at how much bloat there is and what subtle interactions might be happening.
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline NorthGuy

  • Super Contributor
  • ***
  • Posts: 3251
  • Country: ca
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #247 on: December 26, 2021, 03:19:07 pm »
Digikey is a distributor, I am talking about fixed yearly quantity orders directly at ST , and we are talking more then half a million chips per year fixed quantity contracts and even larger.

Even at 1k+ Digikey / Mouser pricing is about 2x what you pay from a proper distributor, once you get into "supported pricing" and the other gimmicks which the industry uses.

What you say applies to every chip manufacturer, not only ST. Go ahead, negotiate proper prices with proper distributors for proper quantities of the chips from different manufacturers and post the results here. Until then the price comparison from DigiKey is the best we have.

Most of the manufacturers are public companies. The financial data are publicly available. Look at their revenue - this is generated mostly by sales to big customers in big volumes. This will give you a rough idea how popular are particular manufacturers among big buyers.
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 28113
  • Country: nl
    • NCT Developments
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #248 on: December 26, 2021, 03:33:43 pm »
Most of the manufacturers are public companies. The financial data are publicly available. Look at their revenue - this is generated mostly by sales to big customers in big volumes. This will give you a rough idea how popular are particular manufacturers among big buyers.
That is another worthless measure. There are so many different markets out there with different margins. How would you compare a company like Intel to Onsemi that way?
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline NorthGuy

  • Super Contributor
  • ***
  • Posts: 3251
  • Country: ca
Re: Is ST Cube IDE a piece of buggy crap?
« Reply #249 on: December 26, 2021, 06:21:18 pm »
Most of the manufacturers are public companies. The financial data are publicly available. Look at their revenue - this is generated mostly by sales to big customers in big volumes. This will give you a rough idea how popular are particular manufacturers among big buyers.
That is another worthless measure. There are so many different markets out there with different margins. How would you compare a company like Intel to Onsemi that way?

It is a measure nonetheless. It is infinitely better than statements lacking any factual support.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf