Skip to content

Commit c46bfe0

Browse files
committed
STM32F0: CMakeLists update
1 parent eef17a5 commit c46bfe0

File tree

22 files changed

+203
-185
lines changed

22 files changed

+203
-185
lines changed

targets/TARGET_STM/TARGET_STM32F0/CMakeLists.txt

Lines changed: 14 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -3,83 +3,29 @@
33

44
if("STM32F091xC" IN_LIST MBED_TARGET_LABELS)
55
add_subdirectory(TARGET_STM32F091xC)
6-
elseif("NUCLEO_F070RB" IN_LIST MBED_TARGET_LABELS)
7-
add_subdirectory(TARGET_NUCLEO_F070RB)
8-
elseif("NUCLEO_F072RB" IN_LIST MBED_TARGET_LABELS)
9-
add_subdirectory(TARGET_NUCLEO_F072RB)
6+
elseif("STM32F072xB" IN_LIST MBED_TARGET_LABELS)
7+
add_subdirectory(TARGET_STM32F072xB)
8+
elseif("STM32F070xB" IN_LIST MBED_TARGET_LABELS)
9+
add_subdirectory(TARGET_STM32F070xB)
10+
elseif("STM32F030x8" IN_LIST MBED_TARGET_LABELS)
11+
add_subdirectory(TARGET_STM32F030x8)
1012
endif()
1113

14+
add_subdirectory(STM32Cube_FW)
15+
16+
target_include_directories(mbed-core
17+
INTERFACE
18+
.
19+
)
20+
1221
target_sources(mbed-core
1322
INTERFACE
1423
analogin_device.c
1524
analogout_device.c
25+
cmsis_nvic.c
1626
flash_api.c
1727
gpio_irq_device.c
1828
pwmout_device.c
1929
serial_device.c
2030
spi_api.c
21-
22-
device/stm32f0xx_hal.c
23-
device/stm32f0xx_hal_adc.c
24-
device/stm32f0xx_hal_adc_ex.c
25-
device/stm32f0xx_hal_can.c
26-
device/stm32f0xx_hal_cec.c
27-
device/stm32f0xx_hal_comp.c
28-
device/stm32f0xx_hal_cortex.c
29-
device/stm32f0xx_hal_crc.c
30-
device/stm32f0xx_hal_crc_ex.c
31-
device/stm32f0xx_hal_dac.c
32-
device/stm32f0xx_hal_dac_ex.c
33-
device/stm32f0xx_hal_dma.c
34-
device/stm32f0xx_hal_flash.c
35-
device/stm32f0xx_hal_flash_ex.c
36-
device/stm32f0xx_hal_gpio.c
37-
device/stm32f0xx_hal_i2c.c
38-
device/stm32f0xx_hal_i2c_ex.c
39-
device/stm32f0xx_hal_i2s.c
40-
device/stm32f0xx_hal_irda.c
41-
device/stm32f0xx_hal_iwdg.c
42-
device/stm32f0xx_hal_pcd.c
43-
device/stm32f0xx_hal_pcd_ex.c
44-
device/stm32f0xx_hal_pwr.c
45-
device/stm32f0xx_hal_pwr_ex.c
46-
device/stm32f0xx_hal_rcc.c
47-
device/stm32f0xx_hal_rcc_ex.c
48-
device/stm32f0xx_hal_rtc.c
49-
device/stm32f0xx_hal_rtc_ex.c
50-
device/stm32f0xx_hal_smartcard.c
51-
device/stm32f0xx_hal_smartcard_ex.c
52-
device/stm32f0xx_hal_smbus.c
53-
device/stm32f0xx_hal_spi.c
54-
device/stm32f0xx_hal_spi_ex.c
55-
device/stm32f0xx_hal_tim.c
56-
device/stm32f0xx_hal_tim_ex.c
57-
device/stm32f0xx_hal_tsc.c
58-
device/stm32f0xx_hal_uart.c
59-
device/stm32f0xx_hal_uart_ex.c
60-
device/stm32f0xx_hal_usart.c
61-
device/stm32f0xx_hal_wwdg.c
62-
device/stm32f0xx_ll_adc.c
63-
device/stm32f0xx_ll_comp.c
64-
device/stm32f0xx_ll_crc.c
65-
device/stm32f0xx_ll_crs.c
66-
device/stm32f0xx_ll_dac.c
67-
device/stm32f0xx_ll_dma.c
68-
device/stm32f0xx_ll_exti.c
69-
device/stm32f0xx_ll_gpio.c
70-
device/stm32f0xx_ll_i2c.c
71-
device/stm32f0xx_ll_pwr.c
72-
device/stm32f0xx_ll_rcc.c
73-
device/stm32f0xx_ll_rtc.c
74-
device/stm32f0xx_ll_spi.c
75-
device/stm32f0xx_ll_tim.c
76-
device/stm32f0xx_ll_usart.c
77-
device/stm32f0xx_ll_utils.c
78-
device/system_stm32f0xx.c
79-
)
80-
81-
target_include_directories(mbed-core
82-
INTERFACE
83-
.
84-
device
8531
)
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Copyright (c) 2020 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
target_sources(mbed-core
5+
INTERFACE
6+
STM32F0xx_HAL_Driver/Legacy/stm32f0xx_hal_can_legacy.c
7+
STM32F0xx_HAL_Driver/stm32f0xx_hal.c
8+
STM32F0xx_HAL_Driver/stm32f0xx_hal_adc.c
9+
STM32F0xx_HAL_Driver/stm32f0xx_hal_adc_ex.c
10+
STM32F0xx_HAL_Driver/stm32f0xx_hal_can.c
11+
STM32F0xx_HAL_Driver/stm32f0xx_hal_cec.c
12+
STM32F0xx_HAL_Driver/stm32f0xx_hal_comp.c
13+
STM32F0xx_HAL_Driver/stm32f0xx_hal_cortex.c
14+
STM32F0xx_HAL_Driver/stm32f0xx_hal_crc.c
15+
STM32F0xx_HAL_Driver/stm32f0xx_hal_crc_ex.c
16+
STM32F0xx_HAL_Driver/stm32f0xx_hal_dac.c
17+
STM32F0xx_HAL_Driver/stm32f0xx_hal_dac_ex.c
18+
STM32F0xx_HAL_Driver/stm32f0xx_hal_dma.c
19+
STM32F0xx_HAL_Driver/stm32f0xx_hal_exti.c
20+
STM32F0xx_HAL_Driver/stm32f0xx_hal_flash.c
21+
STM32F0xx_HAL_Driver/stm32f0xx_hal_flash_ex.c
22+
STM32F0xx_HAL_Driver/stm32f0xx_hal_gpio.c
23+
STM32F0xx_HAL_Driver/stm32f0xx_hal_i2c.c
24+
STM32F0xx_HAL_Driver/stm32f0xx_hal_i2c_ex.c
25+
STM32F0xx_HAL_Driver/stm32f0xx_hal_i2s.c
26+
STM32F0xx_HAL_Driver/stm32f0xx_hal_irda.c
27+
STM32F0xx_HAL_Driver/stm32f0xx_hal_iwdg.c
28+
STM32F0xx_HAL_Driver/stm32f0xx_hal_pcd.c
29+
STM32F0xx_HAL_Driver/stm32f0xx_hal_pcd_ex.c
30+
STM32F0xx_HAL_Driver/stm32f0xx_hal_pwr.c
31+
STM32F0xx_HAL_Driver/stm32f0xx_hal_pwr_ex.c
32+
STM32F0xx_HAL_Driver/stm32f0xx_hal_rcc.c
33+
STM32F0xx_HAL_Driver/stm32f0xx_hal_rcc_ex.c
34+
STM32F0xx_HAL_Driver/stm32f0xx_hal_rtc.c
35+
STM32F0xx_HAL_Driver/stm32f0xx_hal_rtc_ex.c
36+
STM32F0xx_HAL_Driver/stm32f0xx_hal_smartcard.c
37+
STM32F0xx_HAL_Driver/stm32f0xx_hal_smartcard_ex.c
38+
STM32F0xx_HAL_Driver/stm32f0xx_hal_smbus.c
39+
STM32F0xx_HAL_Driver/stm32f0xx_hal_spi.c
40+
STM32F0xx_HAL_Driver/stm32f0xx_hal_spi_ex.c
41+
STM32F0xx_HAL_Driver/stm32f0xx_hal_tim.c
42+
STM32F0xx_HAL_Driver/stm32f0xx_hal_tim_ex.c
43+
STM32F0xx_HAL_Driver/stm32f0xx_hal_tsc.c
44+
STM32F0xx_HAL_Driver/stm32f0xx_hal_uart.c
45+
STM32F0xx_HAL_Driver/stm32f0xx_hal_uart_ex.c
46+
STM32F0xx_HAL_Driver/stm32f0xx_hal_usart.c
47+
STM32F0xx_HAL_Driver/stm32f0xx_hal_usart_ex.c
48+
STM32F0xx_HAL_Driver/stm32f0xx_hal_wwdg.c
49+
STM32F0xx_HAL_Driver/stm32f0xx_ll_adc.c
50+
STM32F0xx_HAL_Driver/stm32f0xx_ll_comp.c
51+
STM32F0xx_HAL_Driver/stm32f0xx_ll_crc.c
52+
STM32F0xx_HAL_Driver/stm32f0xx_ll_crs.c
53+
STM32F0xx_HAL_Driver/stm32f0xx_ll_dac.c
54+
STM32F0xx_HAL_Driver/stm32f0xx_ll_dma.c
55+
STM32F0xx_HAL_Driver/stm32f0xx_ll_exti.c
56+
STM32F0xx_HAL_Driver/stm32f0xx_ll_gpio.c
57+
STM32F0xx_HAL_Driver/stm32f0xx_ll_i2c.c
58+
STM32F0xx_HAL_Driver/stm32f0xx_ll_pwr.c
59+
STM32F0xx_HAL_Driver/stm32f0xx_ll_rcc.c
60+
STM32F0xx_HAL_Driver/stm32f0xx_ll_rtc.c
61+
STM32F0xx_HAL_Driver/stm32f0xx_ll_spi.c
62+
STM32F0xx_HAL_Driver/stm32f0xx_ll_tim.c
63+
STM32F0xx_HAL_Driver/stm32f0xx_ll_usart.c
64+
STM32F0xx_HAL_Driver/stm32f0xx_ll_usb.c
65+
STM32F0xx_HAL_Driver/stm32f0xx_ll_utils.c
66+
system_stm32f0xx.c
67+
)
68+
69+
target_include_directories(mbed-core
70+
INTERFACE
71+
.
72+
CMSIS
73+
STM32F0xx_HAL_Driver
74+
STM32F0xx_HAL_Driver/Legacy
75+
)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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 TOOLCHAIN_GCC_ARM/startup_stm32f030x8.S)
6+
set(LINKER_FILE TOOLCHAIN_GCC_ARM/stm32f030x8.ld)
7+
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
8+
set(STARTUP_FILE TOOLCHAIN_ARM/startup_stm32f030x8.S)
9+
set(LINKER_FILE TOOLCHAIN_ARM/stm32f030x8.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+
${STARTUP_FILE}
17+
)
18+
19+
target_include_directories(mbed-core
20+
INTERFACE
21+
.
22+
)

targets/TARGET_STM/TARGET_STM32F0/TARGET_STM32F030x8/TOOLCHAIN_ARM/stm32f030x8.sct

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! armcc -E
1+
#! armclang -E --target=arm-arm-none-eabi -x c -mcpu=cortex-m0
22
; Scatter-Loading Description File
33
;
44
; SPDX-License-Identifier: BSD-3-Clause
@@ -15,6 +15,8 @@
1515
;*
1616
;******************************************************************************
1717

18+
#include "../cmsis_nvic.h"
19+
1820
#if !defined(MBED_APP_START)
1921
#define MBED_APP_START MBED_ROM_START
2022
#endif
@@ -33,7 +35,6 @@
3335
#endif
3436

3537
/* Round up VECTORS_SIZE to 8 bytes */
36-
#define NVIC_NUM_VECTORS 45
3738
#define VECTORS_SIZE (((NVIC_NUM_VECTORS * 4) + 7) AND ~7)
3839

3940
LR_IROM1 MBED_APP_START MBED_APP_SIZE {

targets/TARGET_STM/TARGET_STM32F0/TARGET_STM32F030x8/TOOLCHAIN_GCC_ARM/stm32f030x8.ld

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
******************************************************************************
1616
*/
1717

18+
#include "../cmsis_nvic.h"
19+
1820

1921
#if !defined(MBED_APP_START)
2022
#define MBED_APP_START MBED_ROM_START
@@ -31,7 +33,6 @@
3133
#endif
3234

3335
/* Round up VECTORS_SIZE to 8 bytes */
34-
#define NVIC_NUM_VECTORS 45
3536
#define VECTORS_SIZE (((NVIC_NUM_VECTORS * 4) + 7) & 0xFFFFFFF8)
3637

3738
MEMORY

targets/TARGET_STM/TARGET_STM32F0/TARGET_STM32F030x8/cmsis_nvic.h

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,6 @@
3434
#endif
3535

3636
#define NVIC_NUM_VECTORS 45
37-
#define NVIC_USER_IRQ_OFFSET 16
38-
39-
#include "cmsis.h"
40-
41-
#ifdef __cplusplus
42-
extern "C" {
43-
#endif
44-
45-
void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector);
46-
uint32_t NVIC_GetVector(IRQn_Type IRQn);
47-
48-
#ifdef __cplusplus
49-
}
50-
#endif
37+
#define NVIC_RAM_VECTOR_ADDRESS MBED_RAM_START
5138

5239
#endif
Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
11
# Copyright (c) 2020 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4+
if("NUCLEO_F070RB" IN_LIST MBED_TARGET_LABELS)
5+
add_subdirectory(TARGET_NUCLEO_F070RB)
6+
endif()
7+
48
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
5-
set(STARTUP_FILE device/TOOLCHAIN_GCC_ARM/startup_stm32f070xb.S)
6-
set(LINKER_FILE device/TOOLCHAIN_GCC_ARM/STM32F070XB.ld)
9+
set(STARTUP_FILE TOOLCHAIN_GCC_ARM/startup_stm32f070xb.S)
10+
set(LINKER_FILE TOOLCHAIN_GCC_ARM/stm32f070xb.ld)
711
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
8-
set(STARTUP_FILE device/TOOLCHAIN_ARM/startup_stm32f070xb.S)
9-
set(LINKER_FILE device/TOOLCHAIN_ARM/stm32f070xb.sct)
12+
set(STARTUP_FILE TOOLCHAIN_ARM/startup_stm32f070xb.S)
13+
set(LINKER_FILE TOOLCHAIN_ARM/stm32f070xb.sct)
1014
endif()
1115

1216
set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
1317

1418
target_sources(mbed-core
1519
INTERFACE
16-
PeripheralPins.c
17-
device/system_clock.c
18-
device/cmsis_nvic.c
20+
system_clock.c
1921
${STARTUP_FILE}
2022
)
2123

2224
target_include_directories(mbed-core
2325
INTERFACE
2426
.
25-
device
2627
)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Copyright (c) 2020 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
target_sources(mbed-core
5+
INTERFACE
6+
PeripheralPins.c
7+
)
8+
9+
target_include_directories(mbed-core
10+
INTERFACE
11+
.
12+
)

targets/TARGET_STM/TARGET_STM32F0/TARGET_STM32F070xB/TOOLCHAIN_ARM/stm32f070xb.sct

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#! armclang -E --target=arm-arm-none-eabi -x c -mcpu=cortex-m0
2-
32
; Scatter-Loading Description File
43
;
54
; SPDX-License-Identifier: BSD-3-Clause
@@ -16,6 +15,8 @@
1615
;*
1716
;******************************************************************************
1817

18+
#include "../cmsis_nvic.h"
19+
1920
#if !defined(MBED_APP_START)
2021
#define MBED_APP_START MBED_ROM_START
2122
#endif
@@ -34,7 +35,6 @@
3435
#endif
3536

3637
/* Round up VECTORS_SIZE to 8 bytes */
37-
#define NVIC_NUM_VECTORS 48
3838
#define VECTORS_SIZE (((NVIC_NUM_VECTORS * 4) + 7) AND ~7)
3939

4040
LR_IROM1 MBED_APP_START MBED_APP_SIZE {

targets/TARGET_STM/TARGET_STM32F0/TARGET_STM32F070xB/TOOLCHAIN_GCC_ARM/STM32F070XB.ld

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
******************************************************************************
1616
*/
1717

18+
#include "../cmsis_nvic.h"
19+
1820

1921
#if !defined(MBED_APP_START)
2022
#define MBED_APP_START MBED_ROM_START
@@ -31,7 +33,6 @@
3133
#endif
3234

3335
/* Round up VECTORS_SIZE to 8 bytes */
34-
#define NVIC_NUM_VECTORS 48
3536
#define VECTORS_SIZE (((NVIC_NUM_VECTORS * 4) + 7) & 0xFFFFFFF8)
3637

3738
MEMORY

0 commit comments

Comments
 (0)