Skip to content

Commit 93e35a0

Browse files
committed
CMake: add STM32L1 targets
1 parent 959c194 commit 93e35a0

File tree

4 files changed

+165
-0
lines changed

4 files changed

+165
-0
lines changed
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Copyright (c) 2020 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if("MOTE_L152RC" IN_LIST MBED_TARGET_LABELS)
5+
add_subdirectory(TARGET_MOTE_L152RC)
6+
elseif("NUCLEO_L152RE" IN_LIST MBED_TARGET_LABELS)
7+
add_subdirectory(TARGET_NUCLEO_L152RE)
8+
elseif("XDOT_L151CC" IN_LIST MBED_TARGET_LABELS)
9+
add_subdirectory(TARGET_XDOT_L151CC)
10+
endif()
11+
12+
target_sources(mbed-core
13+
INTERFACE
14+
analogin_device.c
15+
analogout_device.c
16+
flash_api.c
17+
gpio_irq_device.c
18+
pwmout_device.c
19+
serial_device.c
20+
spi_api.c
21+
22+
device/stm32l1xx_hal.c
23+
device/stm32l1xx_hal_adc.c
24+
device/stm32l1xx_hal_adc_ex.c
25+
device/stm32l1xx_hal_comp.c
26+
device/stm32l1xx_hal_cortex.c
27+
device/stm32l1xx_hal_crc.c
28+
device/stm32l1xx_hal_cryp.c
29+
device/stm32l1xx_hal_cryp_ex.c
30+
device/stm32l1xx_hal_dac.c
31+
device/stm32l1xx_hal_dac_ex.c
32+
device/stm32l1xx_hal_dma.c
33+
device/stm32l1xx_hal_flash.c
34+
device/stm32l1xx_hal_flash_ex.c
35+
device/stm32l1xx_hal_flash_ramfunc.c
36+
device/stm32l1xx_hal_gpio.c
37+
device/stm32l1xx_hal_i2c.c
38+
device/stm32l1xx_hal_i2s.c
39+
device/stm32l1xx_hal_irda.c
40+
device/stm32l1xx_hal_iwdg.c
41+
device/stm32l1xx_hal_lcd.c
42+
device/stm32l1xx_hal_nor.c
43+
device/stm32l1xx_hal_opamp.c
44+
device/stm32l1xx_hal_opamp_ex.c
45+
device/stm32l1xx_hal_pcd.c
46+
device/stm32l1xx_hal_pcd_ex.c
47+
device/stm32l1xx_hal_pwr.c
48+
device/stm32l1xx_hal_pwr_ex.c
49+
device/stm32l1xx_hal_rcc.c
50+
device/stm32l1xx_hal_rcc_ex.c
51+
device/stm32l1xx_hal_rtc.c
52+
device/stm32l1xx_hal_rtc_ex.c
53+
device/stm32l1xx_hal_sd.c
54+
device/stm32l1xx_hal_smartcard.c
55+
device/stm32l1xx_hal_spi.c
56+
device/stm32l1xx_hal_spi_ex.c
57+
device/stm32l1xx_hal_sram.c
58+
device/stm32l1xx_hal_tim.c
59+
device/stm32l1xx_hal_tim_ex.c
60+
device/stm32l1xx_hal_uart.c
61+
device/stm32l1xx_hal_usart.c
62+
device/stm32l1xx_hal_wwdg.c
63+
device/stm32l1xx_ll_adc.c
64+
device/stm32l1xx_ll_comp.c
65+
device/stm32l1xx_ll_crc.c
66+
device/stm32l1xx_ll_dac.c
67+
device/stm32l1xx_ll_dma.c
68+
device/stm32l1xx_ll_exti.c
69+
device/stm32l1xx_ll_fsmc.c
70+
device/stm32l1xx_ll_gpio.c
71+
device/stm32l1xx_ll_i2c.c
72+
device/stm32l1xx_ll_opamp.c
73+
device/stm32l1xx_ll_pwr.c
74+
device/stm32l1xx_ll_rcc.c
75+
device/stm32l1xx_ll_rtc.c
76+
device/stm32l1xx_ll_sdmmc.c
77+
device/stm32l1xx_ll_spi.c
78+
device/stm32l1xx_ll_tim.c
79+
device/stm32l1xx_ll_usart.c
80+
device/stm32l1xx_ll_utils.c
81+
device/system_stm32l1xx.c
82+
)
83+
84+
target_include_directories(mbed-core
85+
INTERFACE
86+
.
87+
device
88+
)
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Copyright (c) 2020 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
5+
set(STARTUP_FILE device/TOOLCHAIN_GCC_ARM/startup_stm32l152xe.S)
6+
set(LINKER_FILE device/TOOLCHAIN_GCC_ARM/stm32l152re.ld)
7+
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
8+
set(STARTUP_FILE device/TOOLCHAIN_ARM/startup_stm32l152xe.S)
9+
set(LINKER_FILE device/TOOLCHAIN_ARM/stm32l152re.sct)
10+
endif()
11+
12+
set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
13+
14+
target_sources(mbed-core
15+
INTERFACE
16+
PeripheralPins.c
17+
device/system_clock.c
18+
${STARTUP_FILE}
19+
)
20+
21+
target_include_directories(mbed-core
22+
INTERFACE
23+
.
24+
device
25+
)
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Copyright (c) 2020 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
5+
set(STARTUP_FILE device/TOOLCHAIN_GCC_ARM/startup_stm32l152xe.S)
6+
set(LINKER_FILE device/TOOLCHAIN_GCC_ARM/stm32l152re.ld)
7+
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
8+
set(STARTUP_FILE device/TOOLCHAIN_ARM/startup_stm32l152xe.S)
9+
set(LINKER_FILE device/TOOLCHAIN_ARM/stm32l152re.sct)
10+
endif()
11+
12+
set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
13+
14+
target_sources(mbed-core
15+
INTERFACE
16+
PeripheralPins.c
17+
device/system_clock.c
18+
${STARTUP_FILE}
19+
)
20+
21+
target_include_directories(mbed-core
22+
INTERFACE
23+
.
24+
device
25+
)
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Copyright (c) 2020 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
5+
set(STARTUP_FILE device/TOOLCHAIN_GCC_ARM/startup_stm32l151xc.S)
6+
set(LINKER_FILE device/TOOLCHAIN_GCC_ARM/STM32L151XC.ld)
7+
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
8+
set(STARTUP_FILE device/TOOLCHAIN_ARM/startup_stm32l151xc.S)
9+
set(LINKER_FILE device/TOOLCHAIN_ARM/stm32l151rc.sct)
10+
endif()
11+
12+
set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
13+
14+
target_sources(mbed-core
15+
INTERFACE
16+
PeripheralPins.c
17+
device/system_clock.c
18+
xdot_eeprom.c
19+
xdot_low_power.c
20+
${STARTUP_FILE}
21+
)
22+
23+
target_include_directories(mbed-core
24+
INTERFACE
25+
.
26+
device
27+
)

0 commit comments

Comments
 (0)