cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeIDE doesn't generate errors when build configuration is set to Release

Liandri
Associate II

Hello,

I have a C++ project on STM32CubeIDE. I noticed that IDE doesn't show any errors in Release mode when I intentionally make error. I see this behavior on files with .hpp and .cpp extensions. On the other hand, I see that IDE can generate errors on console when I make errors in files with .c extensions like main.c. There is no problem when build configuration is set to Debug. I have one ext file, one .hpp file and one .cpp file. 

These are the differences between Debug and Release configurations in Project->Properties->C/C++ Build->Settings section:

MCU GCC Assembler
Debug-> Command: gcc
               All options: -mcpu=cortex-m4 -g3 -DDEBUG -c -x assembler-with-cpp --specs=nano.specs                                                            -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb
Release-> Command: gcc
                  All options: -mcpu=cortex-m4 -c -x  assembler-with-cpp --specs=nano.specs                                                                                  -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb

MCU GCC Assembler->Debugging
Debug-> Debug level: Maximum (-g3)
Release-> Debug level: None

MCU GCC Assembler->Preprocessor
Debug-> Define symbols (-D): DEBUG
Release-> Define symbols (-D): none

MCU GCC Compiler->Debugging
Debug-> Debug level: Maximum (-g3)
Release-> Debug level: None

MCU GCC Compiler->Preprocessor (This is same but I wanted to show defined symbols in both mode)
Debug-> Define symbols (-D): DEBUG
                                                 USE_FULL_ASSERT
                                                 USE_HAL_DRIVER
                                                 STM32G474xx
                                                 LITTLEENDIAN
Release-> Define symbols (-D): DEBUG
                                                   USE_FULL_ASSERT
                                                   USE_HAL_DRIVER
                                                   STM32G474xx
                                                   LITTLEENDIAN

MCU GCC Compiler->Optimisation
Debug-> Optimisation level: None(-O0)
Release-> Optimise for size: (-Os)

MCU G++ Compiler->Debugging
Debug-> Debug level: Maximum (-g3)
Release-> Debug level: None

MCU G++ Compiler->Preprocessor (This is same but I wanted to show defined symbols in both mode)
Debug-> Define symbols (-D): DEBUG
                                                 USE_FULL_ASSERT
                                                 USE_HAL_DRIVER
                                                 STM32G474xx
                                                 LITTLEENDIAN
Release-> Define symbols (-D): DEBUG
                                                   USE_FULL_ASSERT
                                                   USE_HAL_DRIVER
                                                   STM32G474xx
                                                   LITTLEENDIAN

MCU G++ Compiler->Optimisation
Debug-> Optimisation level: None(-O0)
Release-> Optimise for size: (-Os)

I have added the console outputs as.txt files for both Debug and Release build configurations. From these files, I can see that the line starts with "arm-none-eabi-g++" doesn't appear on Release build console output. Maybe IDE doesn't know I have .hpp and .cpp file in Release mode.

I will be very appriciated if you could help me. Thank you in advance. 

Best Regards

1 REPLY 1
Liandri
Associate II

Any help ?