Skip to main content
Graduate II
August 7, 2023
Question

STM Studio Upload Error: Wrong version in compilation unit header (is 5 should be 2, 3, or 4)

  • August 7, 2023
  • 4 replies
  • 14777 views

Hi,

Since a recent upgrade to STM32CubeIDE I am getting the following error when importing variables into STM Studio:

Wrong version in compilation unit header (is 5 should be 2, 3, or 4)

This is preventing me from debugging my system.  I tried using STM32CubeMonitor, but the charting is so rudimentary it is useless.

I am assuming that the upgrade to the IDE incorporated a later version of GCC and it is this that is producing elf files in that have a CU header of 5.

Is there any simple work-around that anyone knows of?

I could go back to a later version of the IDE, but once you get on that merry-go-round you end up with a big mess, because inevitably something else will break.

I know you can also enter the variables and their addresses into Studio manually and that's OK for small numbers of variables, but when you use structures to store different types calculating the offsets to the fields is tedious and error prone.  As I recall if the addresses of the variables changed after program edits Studio would warn you and corrects them to their new addresses

I wish ST would resurrect STM Studio. It is an excellent tool. Anyone with even a modicum of embedded experience can set it up and get results in ten minutes.  To use the Monitor you have to spend a couple of hours reading manuals and watching tutorials only to find out at the end that the charting/plotting is useless. That's what I did. Silly me.

I am sure that the Monitor would be OK for testing logic as it can simulate  a UI but for real-time processing of real-time variables it is useless.

The charting function in the IDE is sometimes useful, but it is clunky and inflexible.

Bring back STM Studio I say.

Regards

Rob

 

 

 

    This topic has been closed for replies.

    4 replies

    Graduate II
    October 3, 2023

    Unfortunately I have the same problem that started with the last CubeIDE update (version 1.13.2). Too bad it happened because STMStudio was a very useful tool. I hope someone will come up with a good idea to fix this problem.

    Graduate II
    October 3, 2023

    To force all compilation units to have the same DWARF version, you must specify the desired DWARF version in your compiler's compiler options. DWARF is a debugging format mainly used in compiling and debugging programs. Here's how to do it: see the 3 screenshots.
    I tried it and it works fine now.3.JPG4.JPG5.JPG

    Explorer II
    November 25, 2023

    Thank you @costi for your valuable solution! Personally, I also find CubeMonitor less suitable for my purposes and prefer to use STM-studio. With your help, this is now possible again.

    Graduate II
    October 17, 2024

    Hi,

    I built application with -gdwarf-4 and Studio accepted the .elf, but now it shows an error message window. Pressing Esc key shows another, and another and another an so on. There is probably one error window for every symbol in my .elf. Hundreds ? Interesting. Any idea what next ?

     

    ferro_0-1729174354842.png

     

    The Studio is not even among running tasks to kill it. Or is it ?

     

    ferro_1-1729174573642.png

    Thanks.

     

     

    Explorer
    February 5, 2025

    Thank you