cancel
Showing results for 
Search instead for 
Did you mean: 

STMStudio error: “Wrong version in compilation unit header (is 5 should be 2, 3, or 4)” with CMake

OmidES
Associate II

I am building an STM32H7 project (STM32H753) using CMake + STM32CubeMX and GCC.
The firmware builds and runs correctly, but STMStudio fails to load debug symbols with the following error:

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

 

Even when -g is used, the error persists. I set the following flags on CMakeLists:

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -gdwarf-4")
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -gdwarf-4")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -gdwarf-4")

 

So, I appreciate any advice.

 

0 REPLIES 0