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 8 months, 2 weeks ago by bjornharink.
This topic was modified 8 months, 2 weeks ago by bjornharink.
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
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.
This reply was modified 2 weeks, 4 days ago by bjornharink.
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:
C++
1
2
3
4
5
6
7
8
9
10
11
12
13
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.