RELEASE and DEBUG macros not defined CubeMX Advacned Wizard

Sysprogs forums Forums VisualGDB RELEASE and DEBUG macros not defined CubeMX Advacned Wizard

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #33994
    bjornharink
    Participant

    Using the Advanced CubeMX wizard I made a new project, but for some reason the DEBUG and RELEASE macros are not defined when using the “Release” and “Debug” configurations. I think this might be a bug.

    Using STM32CubeMX 6.8, VisualGDB 5.6R9

     

     

    • This topic was modified 1 year, 8 months ago by bjornharink.
    • This topic was modified 1 year, 8 months ago by bjornharink.
    Attachments:
    You must be logged in to view attached files.
    #33998
    support
    Keymaster

    Hi,

    It looks like your technical support period has expired. We would be happy to help you, however we would kindly ask you to renew your technical support on the following page first: https://sysprogs.com/splm/mykey

    #34958
    bjornharink
    Participant

    Our VisualGDB license is registered under a different name. We did renew our license.
    It is registered under Leiden Measurement Technology if I am not mistaken.

    #34966
    support
    Keymaster

    Thanks, we have linked your license to your forum account.

    We have rechecked the DEBUG/RELEASE flags for CMake projects and indeed they got broken when we added an option to select between size and speed optimization.

    We have fixed it on our side and will include it in the next Beta. As a workaround until then, you can simply patch the C:\Program Files (x86)\Sysprogs\VisualGDB\CMake\embedded\root.cmake file as shown below:

     if("${VISUALGDB_TOOLCHAIN_SUBTYPE}" STREQUAL "GCC")
    - set(CMAKE_C_FLAGS_DEBUG "-g3 -O0")
    + set(CMAKE_C_FLAGS_DEBUG "-g3 -O0 -DDEBUG")
    set(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
    
    #Add "OPTIMIZE_FOR_SIZE=1" to Extra CMake Configuration Variables in VisualGDB Project Properties in order to optimize the release build for size, rather than speed.
    if(OPTIMIZE_FOR_SIZE)
    - set(CMAKE_C_FLAGS_RELEASE "-g3 -Os")
    + set(CMAKE_C_FLAGS_RELEASE "-g3 -Os -DRELEASE")
    else()
    - set(CMAKE_C_FLAGS_RELEASE "-g3 -O3")
    + set(CMAKE_C_FLAGS_RELEASE "-g3 -O3 -DRELEASE")
    endif()
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.