fix: compiling with DEBUG (#5377)

This commit is contained in:
Raphael Coeffic
2024-08-05 10:07:37 +10:00
committed by GitHub
parent de8dc70806
commit 5ad38828fa
5 changed files with 11 additions and 9 deletions
+1
View File
@@ -546,6 +546,7 @@ add_dependencies(firmware ${RADIO_DEPENDENCIES})
set_target_properties(firmware PROPERTIES EXCLUDE_FROM_ALL TRUE)
if(DEBUG)
target_compile_definitions(board PRIVATE -DDEBUG)
target_compile_definitions(firmware PRIVATE -DDEBUG)
target_compile_definitions(stm32_drivers_w_dbg_fw PRIVATE -DDEBUG)
endif()
@@ -14,6 +14,7 @@ set(MINIMAL_BOARD_LIB_SRC
boards/generic_stm32/inputs.cpp
boards/generic_stm32/i2c_bus.cpp
boards/generic_stm32/bl_keys.cpp
boards/generic_stm32/aux_ports.cpp
)
# Dependencies only used in firmware
@@ -25,7 +26,6 @@ set(BOARD_LIB_SRC
boards/generic_stm32/module_ports.cpp
boards/generic_stm32/trainer_ports.cpp
boards/generic_stm32/aux_ports.cpp
boards/generic_stm32/sport_update.cpp
boards/generic_stm32/intmodule_heartbeat.cpp
boards/generic_stm32/analog_inputs.cpp
@@ -99,16 +99,12 @@ if(NOT NATIVE_BUILD)
# HAL/LL drivers using TRACE
add_library(stm32_drivers_w_dbg_fw OBJECT EXCLUDE_FROM_ALL
${STM32_DRIVER_DIR}/sdcard_spi.cpp
${STM32_DRIVER_DIR}/diskio_sdio.cpp
)
add_library(stm32_drivers_w_dbg_bl OBJECT EXCLUDE_FROM_ALL
${STM32_DRIVER_DIR}/sdcard_spi.cpp
)
if(NOT PCB STREQUAL PL18)
target_sources(stm32_drivers PUBLIC
${STM32_DRIVER_DIR}/diskio_sdio.cpp
)
endif()
)
set(FIRMWARE_SRC ${FIRMWARE_SRC} $<TARGET_OBJECTS:stm32_drivers>)
set(FIRMWARE_SRC ${FIRMWARE_SRC} $<TARGET_OBJECTS:stm32_drivers_w_dbg_fw>)
@@ -35,6 +35,7 @@ if(NOT NO_LTO)
target_compile_options(stm32usb_device_bl PRIVATE -flto)
target_compile_options(stm32usb_device_fw PRIVATE -flto)
target_compile_options(stm32_drivers PRIVATE -flto)
target_compile_options(stm32_drivers_w_dbg_fw PRIVATE -flto)
target_compile_options(stm32_drivers_w_dbg_bl PRIVATE -flto)
endif()
@@ -66,7 +67,11 @@ if (DEFINED TARGET_SDRAM_SIZE)
endif()
if (ENABLE_BOOTLOADER_DEBUG)
target_compile_definitions(bootloader PUBLIC -DDEBUG)
target_compile_definitions(board_bl PRIVATE -DDEBUG)
target_compile_definitions(bootloader PRIVATE -DDEBUG)
target_sources(bootloader PRIVATE
${RADIO_SRC_DIR}/serial.cpp
)
# uncomment to enable TRACE in drivers
# target_compile_definitions(stm32_drivers_w_dbg_bl PRIVATE -DDEBUG)
endif()
@@ -32,7 +32,7 @@
#include "hal.h"
#if !defined(SD_SPI)
#if defined(STORAGE_USE_SDIO)
// #include "delays_driver.h"
#include "debug.h"