Update CMake based on new STM32L4 directory structure

pull/13566/head
Rajkumar Kanagaraj 2020-10-20 19:13:07 +01:00 committed by Hugues Kamba
parent d283e69c99
commit a42ad9dea4
9 changed files with 173 additions and 147 deletions

View File

@ -5,7 +5,7 @@ if("STM32L475xG" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_STM32L475xG)
endif()
add_subdirectory(device)
add_subdirectory(STM32Cube_FW)
target_sources(mbed-os
PRIVATE

View File

@ -0,0 +1,15 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
add_subdirectory(STM32L4xx_HAL_Driver)
target_sources(mbed-os
PRIVATE
system_stm32l4xx.c
)
target_include_directories(mbed-os
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
CMSIS
)

View File

@ -0,0 +1,115 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
add_subdirectory(Legacy)
target_sources(mbed-os
PRIVATE
stm32l4xx_hal_adc.c
stm32l4xx_hal_adc_ex.c
stm32l4xx_hal.c
stm32l4xx_hal_can.c
stm32l4xx_hal_comp.c
stm32l4xx_hal_cortex.c
stm32l4xx_hal_crc.c
stm32l4xx_hal_crc_ex.c
stm32l4xx_hal_cryp.c
stm32l4xx_hal_cryp_ex.c
stm32l4xx_hal_dac.c
stm32l4xx_hal_dac_ex.c
stm32l4xx_hal_dcmi.c
stm32l4xx_hal_dfsdm.c
stm32l4xx_hal_dfsdm_ex.c
stm32l4xx_hal_dma2d.c
stm32l4xx_hal_dma.c
stm32l4xx_hal_dma_ex.c
stm32l4xx_hal_dsi.c
stm32l4xx_hal_exti.c
stm32l4xx_hal_firewall.c
stm32l4xx_hal_flash.c
stm32l4xx_hal_flash_ex.c
stm32l4xx_hal_flash_ramfunc.c
stm32l4xx_hal_gfxmmu.c
stm32l4xx_hal_gpio.c
stm32l4xx_hal_hash.c
stm32l4xx_hal_hash_ex.c
stm32l4xx_hal_hcd.c
stm32l4xx_hal_i2c.c
stm32l4xx_hal_i2c_ex.c
stm32l4xx_hal_irda.c
stm32l4xx_hal_iwdg.c
stm32l4xx_hal_lcd.c
stm32l4xx_hal_lptim.c
stm32l4xx_hal_ltdc.c
stm32l4xx_hal_ltdc_ex.c
stm32l4xx_hal_mmc.c
stm32l4xx_hal_mmc_ex.c
stm32l4xx_hal_nand.c
stm32l4xx_hal_nor.c
stm32l4xx_hal_opamp.c
stm32l4xx_hal_opamp_ex.c
stm32l4xx_hal_ospi.c
stm32l4xx_hal_pcd.c
stm32l4xx_hal_pcd_ex.c
stm32l4xx_hal_pka.c
stm32l4xx_hal_pssi.c
stm32l4xx_hal_pwr.c
stm32l4xx_hal_pwr_ex.c
stm32l4xx_hal_qspi.c
stm32l4xx_hal_rcc.c
stm32l4xx_hal_rcc_ex.c
stm32l4xx_hal_rng.c
stm32l4xx_hal_rng_ex.c
stm32l4xx_hal_rtc.c
stm32l4xx_hal_rtc_ex.c
stm32l4xx_hal_sai.c
stm32l4xx_hal_sai_ex.c
stm32l4xx_hal_sd.c
stm32l4xx_hal_sd_ex.c
stm32l4xx_hal_smartcard.c
stm32l4xx_hal_smartcard_ex.c
stm32l4xx_hal_smbus.c
stm32l4xx_hal_spi.c
stm32l4xx_hal_spi_ex.c
stm32l4xx_hal_sram.c
stm32l4xx_hal_swpmi.c
stm32l4xx_hal_tim.c
stm32l4xx_hal_tim_ex.c
stm32l4xx_hal_tsc.c
stm32l4xx_hal_uart.c
stm32l4xx_hal_uart_ex.c
stm32l4xx_hal_usart.c
stm32l4xx_hal_usart_ex.c
stm32l4xx_hal_wwdg.c
stm32l4xx_ll_adc.c
stm32l4xx_ll_comp.c
stm32l4xx_ll_crc.c
stm32l4xx_ll_crs.c
stm32l4xx_ll_dac.c
stm32l4xx_ll_dma2d.c
stm32l4xx_ll_dma.c
stm32l4xx_ll_exti.c
stm32l4xx_ll_fmc.c
stm32l4xx_ll_gpio.c
stm32l4xx_ll_i2c.c
stm32l4xx_ll_lptim.c
stm32l4xx_ll_lpuart.c
stm32l4xx_ll_opamp.c
stm32l4xx_ll_pka.c
stm32l4xx_ll_pwr.c
stm32l4xx_ll_rcc.c
stm32l4xx_ll_rng.c
stm32l4xx_ll_rtc.c
stm32l4xx_ll_sdmmc.c
stm32l4xx_ll_spi.c
stm32l4xx_ll_swpmi.c
stm32l4xx_ll_tim.c
stm32l4xx_ll_usart.c
stm32l4xx_ll_usb.c
stm32l4xx_ll_utils.c
)
target_include_directories(mbed-os
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
)

View File

@ -0,0 +1,12 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
target_sources(mbed-os
PRIVATE
stm32l4xx_hal_can_legacy.c
)
target_include_directories(mbed-os
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
)

View File

@ -5,7 +5,35 @@ if("DISCO_L475VG_IOT01A" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_DISCO_L475VG_IOT01A)
endif()
add_subdirectory(device)
function(_mbed_get_assembly_disco_l475vg_iot01a)
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
set(STARTUP_FILE TOOLCHAIN_GCC_ARM/startup_stm32l475xx.S)
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
set(STARTUP_FILE TOOLCHAIN_ARM/startup_stm32l475xx.S)
elseif(${MBED_TOOLCHAIN} STREQUAL "IAR")
set(STARTUP_FILE TOOLCHAIN_IAR/startup_stm32l475xx.S)
endif()
target_sources(mbed-os PRIVATE ${STARTUP_FILE})
endfunction()
function(_mbed_set_linker_file)
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
set(LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/TOOLCHAIN_GCC_ARM/stm32l475xg.ld)
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
set(LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/TOOLCHAIN_ARM/stm32l475xg.sct)
elseif(${MBED_TOOLCHAIN} STREQUAL "IAR")
set(LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/TOOLCHAIN_IAR/stm32l475xg.icf)
endif()
set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${LINKER_FILE})
endfunction()
_mbed_get_assembly_disco_l475vg_iot01a()
_mbed_set_linker_file()
target_sources(mbed-os
PRIVATE
system_clock.c
)
target_include_directories(mbed-os
PUBLIC

View File

@ -4,7 +4,6 @@
target_sources(mbed-os
PRIVATE
PeripheralPins.c
system_clock.c
)
target_include_directories(mbed-os

View File

@ -1,4 +1,4 @@
#! armcc -E
#! armclang -E --target=arm-arm-none-eabi -x c -mcpu=cortex-m4
; Scatter-Loading Description File
;
; SPDX-License-Identifier: BSD-3-Clause

View File

@ -1,32 +0,0 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
function(_mbed_get_assembly_disco_l475vg_iot01a)
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
set(STARTUP_FILE TOOLCHAIN_GCC_ARM/startup_stm32l475xx.S)
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
set(STARTUP_FILE TOOLCHAIN_ARM/startup_stm32l475xx.S)
elseif(${MBED_TOOLCHAIN} STREQUAL "IAR")
set(STARTUP_FILE TOOLCHAIN_IAR/startup_stm32l475xx.S)
endif()
target_sources(mbed-os PRIVATE ${STARTUP_FILE})
endfunction()
function(_mbed_set_linker_file)
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
set(LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/TOOLCHAIN_GCC_ARM/STM32L475XX.ld)
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
set(LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/TOOLCHAIN_ARM/stm32l475xx.sct)
elseif(${MBED_TOOLCHAIN} STREQUAL "IAR")
set(LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/TOOLCHAIN_IAR/stm32l475xx.icf)
endif()
set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${LINKER_FILE})
endfunction()
_mbed_get_assembly_disco_l475vg_iot01a()
_mbed_set_linker_file()
target_include_directories(mbed-os
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
)

View File

@ -1,111 +0,0 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
target_sources(mbed-os
PRIVATE
stm32l4xx_hal.c
stm32l4xx_hal_adc.c
stm32l4xx_hal_adc_ex.c
stm32l4xx_hal_can.c
stm32l4xx_hal_can_legacy.c
stm32l4xx_hal_comp.c
stm32l4xx_hal_cortex.c
stm32l4xx_hal_crc.c
stm32l4xx_hal_crc_ex.c
stm32l4xx_hal_cryp.c
stm32l4xx_hal_cryp_ex.c
stm32l4xx_hal_dac.c
stm32l4xx_hal_dac_ex.c
stm32l4xx_hal_dcmi.c
stm32l4xx_hal_dfsdm.c
stm32l4xx_hal_dfsdm_ex.c
stm32l4xx_hal_dma.c
stm32l4xx_hal_dma2d.c
stm32l4xx_hal_dma_ex.c
stm32l4xx_hal_dsi.c
stm32l4xx_hal_exti.c
stm32l4xx_hal_firewall.c
stm32l4xx_hal_flash.c
stm32l4xx_hal_flash_ex.c
stm32l4xx_hal_flash_ramfunc.c
stm32l4xx_hal_gfxmmu.c
stm32l4xx_hal_gpio.c
stm32l4xx_hal_hash.c
stm32l4xx_hal_hash_ex.c
stm32l4xx_hal_hcd.c
stm32l4xx_hal_i2c.c
stm32l4xx_hal_i2c_ex.c
stm32l4xx_hal_irda.c
stm32l4xx_hal_iwdg.c
stm32l4xx_hal_lcd.c
stm32l4xx_hal_lptim.c
stm32l4xx_hal_ltdc.c
stm32l4xx_hal_ltdc_ex.c
stm32l4xx_hal_mmc.c
stm32l4xx_hal_mmc_ex.c
stm32l4xx_hal_nand.c
stm32l4xx_hal_nor.c
stm32l4xx_hal_opamp.c
stm32l4xx_hal_opamp_ex.c
stm32l4xx_hal_ospi.c
stm32l4xx_hal_pcd.c
stm32l4xx_hal_pcd_ex.c
stm32l4xx_hal_pwr.c
stm32l4xx_hal_pwr_ex.c
stm32l4xx_hal_qspi.c
stm32l4xx_hal_rcc.c
stm32l4xx_hal_rcc_ex.c
stm32l4xx_hal_rng.c
stm32l4xx_hal_rtc.c
stm32l4xx_hal_rtc_ex.c
stm32l4xx_hal_sai.c
stm32l4xx_hal_sai_ex.c
stm32l4xx_hal_sd.c
stm32l4xx_hal_sd_ex.c
stm32l4xx_hal_smartcard.c
stm32l4xx_hal_smartcard_ex.c
stm32l4xx_hal_smbus.c
stm32l4xx_hal_spi.c
stm32l4xx_hal_spi_ex.c
stm32l4xx_hal_sram.c
stm32l4xx_hal_swpmi.c
stm32l4xx_hal_tim.c
stm32l4xx_hal_tim_ex.c
stm32l4xx_hal_tsc.c
stm32l4xx_hal_uart.c
stm32l4xx_hal_uart_ex.c
stm32l4xx_hal_usart.c
stm32l4xx_hal_usart_ex.c
stm32l4xx_hal_wwdg.c
stm32l4xx_ll_adc.c
stm32l4xx_ll_comp.c
stm32l4xx_ll_crc.c
stm32l4xx_ll_crs.c
stm32l4xx_ll_dac.c
stm32l4xx_ll_dma.c
stm32l4xx_ll_dma2d.c
stm32l4xx_ll_exti.c
stm32l4xx_ll_fmc.c
stm32l4xx_ll_gpio.c
stm32l4xx_ll_i2c.c
stm32l4xx_ll_lptim.c
stm32l4xx_ll_lpuart.c
stm32l4xx_ll_opamp.c
stm32l4xx_ll_pwr.c
stm32l4xx_ll_rcc.c
stm32l4xx_ll_rng.c
stm32l4xx_ll_rtc.c
stm32l4xx_ll_sdmmc.c
stm32l4xx_ll_spi.c
stm32l4xx_ll_swpmi.c
stm32l4xx_ll_tim.c
stm32l4xx_ll_usart.c
stm32l4xx_ll_usb.c
stm32l4xx_ll_utils.c
system_stm32l4xx.c
)
target_include_directories(mbed-os
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
)