diff --git a/radio/src/targets/common/arm/stm32/f2/CMakeLists.txt b/radio/src/targets/common/arm/stm32/f2/CMakeLists.txt index ece9df49a..ddf628bc3 100644 --- a/radio/src/targets/common/arm/stm32/f2/CMakeLists.txt +++ b/radio/src/targets/common/arm/stm32/f2/CMakeLists.txt @@ -2,29 +2,32 @@ set(CPU_FAMILY STM32) set(MCU cortex-m3) set(FPU_FLAGS "") -# STM32 HAL/LL library -set(STM32CUBE_DIR ${THIRDPARTY_DIR}/STM32F2xx_HAL_Driver) -include_directories(${STM32CUBE_DIR}/Inc) +if(NOT NATIVE_BUILD) + # STM32 HAL/LL library + set(STM32CUBE_DIR ${THIRDPARTY_DIR}/STM32F2xx_HAL_Driver) + include_directories(${STM32CUBE_DIR}/Inc) -add_library(stm32cube_ll OBJECT EXCLUDE_FROM_ALL - # LL drivers - ${STM32CUBE_DIR}/Src/stm32f2xx_ll_gpio.c - ${STM32CUBE_DIR}/Src/stm32f2xx_ll_tim.c - ${STM32CUBE_DIR}/Src/stm32f2xx_ll_dma.c - ${STM32CUBE_DIR}/Src/stm32f2xx_ll_usart.c - ${STM32CUBE_DIR}/Src/stm32f2xx_ll_rcc.c - ${STM32CUBE_DIR}/Src/stm32f2xx_ll_exti.c - # HAL drivers - ${STM32CUBE_DIR}/Src/stm32f2xx_hal_rcc.c - ${STM32CUBE_DIR}/Src/stm32f2xx_hal_i2c.c - ) + add_library(stm32cube_ll OBJECT EXCLUDE_FROM_ALL + # LL drivers + ${STM32CUBE_DIR}/Src/stm32f2xx_ll_gpio.c + ${STM32CUBE_DIR}/Src/stm32f2xx_ll_tim.c + ${STM32CUBE_DIR}/Src/stm32f2xx_ll_dma.c + ${STM32CUBE_DIR}/Src/stm32f2xx_ll_usart.c + ${STM32CUBE_DIR}/Src/stm32f2xx_ll_rcc.c + ${STM32CUBE_DIR}/Src/stm32f2xx_ll_exti.c + # HAL drivers + ${STM32CUBE_DIR}/Src/stm32f2xx_hal_rcc.c + ${STM32CUBE_DIR}/Src/stm32f2xx_hal_i2c.c + ) -target_compile_options(stm32cube_ll PRIVATE -DUSE_FULL_LL_DRIVER) -target_include_directories(stm32cube_ll PRIVATE - ${THIRDPARTY_DIR}/CMSIS/Device/ST/STM32F2xx/Include - ${THIRDPARTY_DIR}/CMSIS/Include) + target_compile_options(stm32cube_ll PRIVATE -DUSE_FULL_LL_DRIVER) + target_include_directories(stm32cube_ll PRIVATE + ${THIRDPARTY_DIR}/CMSIS/Device/ST/STM32F2xx/Include + ${THIRDPARTY_DIR}/CMSIS/Include) -set(FIRMWARE_SRC ${FIRMWARE_SRC} $) + set(FIRMWARE_SRC ${FIRMWARE_SRC} $) + set(BOOTLOADER_SRC ${BOOTLOADER_SRC} $) +endif() # StdPeriph library set(STM32LIB_DIR ${THIRDPARTY_DIR}/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries)