1# Makefile - STM32Cube SDK 2# 3# Copyright (c) 2016 Linaro Limited 4# 5# SPDX-License-Identifier: Apache-2.0 6 7#add_library(STM32CUBE INTERFACE) 8 9zephyr_library() 10 11string(TOUPPER ${CONFIG_SOC} _STM32CUBE_CPU) 12string(REPLACE "X" "x" STM32CUBE_CPU ${_STM32CUBE_CPU}) 13 14# STM32Cub uses the CPU name to expose SOC-specific attributes of a specific 15# peripheral. 16# It also requires USE_HAL_DRIVER to be define in order to benefit from 17# STM32Cube HAL and LL APIs 18zephyr_compile_definitions( 19 -D${STM32CUBE_CPU} 20 -DUSE_HAL_DRIVER 21 -DUSE_FULL_LL_DRIVER 22 ) 23 24set(stm_socs 25 stm32f0x 26 stm32f1x 27 stm32f2x 28 stm32f3x 29 stm32f4x 30 stm32f7x 31 stm32g0x 32 stm32g4x 33 stm32h7x 34 stm32l0x 35 stm32l1x 36 stm32l4x 37 stm32l5x 38 stm32mp1x 39 stm32u5x 40 stm32wbx 41 stm32wlx 42 ) 43 44if(CONFIG_CPU_CORTEX_M4) 45 zephyr_compile_definitions( -DCORE_CM4 ) 46elseif(CONFIG_CPU_CORTEX_M7) 47 zephyr_compile_definitions( -DCORE_CM7 ) 48endif() 49 50if(CONFIG_CLOCK_STM32_HSE_CLOCK) 51 zephyr_compile_definitions( -DHSE_VALUE=${CONFIG_CLOCK_STM32_HSE_CLOCK} ) 52endif() 53 54foreach(stm_soc ${stm_socs}) 55 string(TOUPPER ${stm_soc} soc_to_upper) 56 if(CONFIG_SOC_SERIES_${soc_to_upper}) 57 zephyr_include_directories( 58 ${stm_soc}x/soc 59 ${stm_soc}x/drivers/include 60 ${stm_soc}x/drivers/include/Legacy 61 ) 62 63 add_subdirectory(${stm_soc}x) 64 endif() 65endforeach() 66 67if(CONFIG_USE_STM32_ASSERT) 68 zephyr_compile_definitions( -DUSE_FULL_ASSERT ) 69endif() 70 71zephyr_include_directories(common_ll/include) 72