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
@@ -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"