Skip to content

Commit 660b964

Browse files
authored
Merge pull request #13970 from hugueskamba/hk_cmake_add_maxim_support
CMake: Add support for all Maxim Mbed targets
2 parents 50e0981 + 19abde6 commit 660b964

File tree

10 files changed

+296
-6
lines changed

10 files changed

+296
-6
lines changed

targets/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ elseif("Cypress" IN_LIST MBED_TARGET_LABELS)
77
add_subdirectory(TARGET_Cypress)
88
elseif("Freescale" IN_LIST MBED_TARGET_LABELS)
99
add_subdirectory(TARGET_Freescale)
10+
elseif("Maxim" IN_LIST MBED_TARGET_LABELS)
11+
add_subdirectory(TARGET_Maxim)
1012
elseif("NORDIC" IN_LIST MBED_TARGET_LABELS)
1113
add_subdirectory(TARGET_NORDIC)
14+
elseif("NUVOTON" IN_LIST MBED_TARGET_LABELS)
15+
add_subdirectory(TARGET_NUVOTON)
1216
elseif("STM" IN_LIST MBED_TARGET_LABELS)
1317
add_subdirectory(TARGET_STM)
14-
elseif("NUVOTON" IN_LIST MBED_TARGET_LABELS)
15-
add_subdirectory(TARGET_NUVOTON)
1618
endif()

targets/TARGET_Maxim/CMakeLists.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Copyright (c) 2020 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if("MAX32620C" IN_LIST MBED_TARGET_LABELS)
5+
add_subdirectory(TARGET_MAX32620C)
6+
elseif("MAX32625" IN_LIST MBED_TARGET_LABELS)
7+
add_subdirectory(TARGET_MAX32625)
8+
elseif("MAX32630" IN_LIST MBED_TARGET_LABELS)
9+
add_subdirectory(TARGET_MAX32630)
10+
endif()
11+
12+
target_include_directories(mbed-core
13+
INTERFACE
14+
.
15+
)
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Copyright (c) 2020 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if("MAX32620FTHR" IN_LIST MBED_TARGET_LABELS)
5+
target_include_directories(mbed-core
6+
INTERFACE
7+
TARGET_MAX32620FTHR
8+
)
9+
elseif("SDT32620B" IN_LIST MBED_TARGET_LABELS)
10+
target_include_directories(mbed-core
11+
INTERFACE
12+
TARGET_SDT32620B
13+
)
14+
endif()
15+
16+
if(${MBED_TOOLCHAIN} STREQUAL "ARM")
17+
set(LINKER_FILE device/TOOLCHAIN_ARM_STD/MAX32620.sct)
18+
set(STARTUP_FILE device/TOOLCHAIN_ARM_STD/startup_max32620.S)
19+
elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
20+
set(LINKER_FILE device/TOOLCHAIN_GCC_ARM/max32620.ld)
21+
set(STARTUP_FILE device/TOOLCHAIN_GCC_ARM/startup_max32620.S)
22+
endif()
23+
24+
set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
25+
26+
target_include_directories(mbed-core
27+
INTERFACE
28+
.
29+
device
30+
mxc
31+
)
32+
33+
target_sources(mbed-core
34+
INTERFACE
35+
PeripheralPins.c
36+
analogin_api.c
37+
flash_api.c
38+
gpio_api.c
39+
gpio_irq_api.c
40+
i2c_api.c
41+
pinmap.c
42+
port_api.c
43+
pwmout_api.c
44+
rtc_api.c
45+
serial_api.c
46+
sleep.c
47+
spi_api.c
48+
us_ticker.c
49+
50+
device/device_nvic.c
51+
device/system_max32620.c
52+
53+
mxc/adc.c
54+
mxc/clkman.c
55+
mxc/crc.c
56+
mxc/flc.c
57+
mxc/gpio.c
58+
mxc/i2cm.c
59+
mxc/i2cs.c
60+
mxc/icc.c
61+
mxc/ioman.c
62+
mxc/lp.c
63+
mxc/maa.c
64+
mxc/mxc_aes.c
65+
mxc/mxc_assert.c
66+
mxc/mxc_lock.c
67+
mxc/mxc_sys.c
68+
mxc/owm.c
69+
mxc/pmu.c
70+
mxc/prng.c
71+
mxc/pt.c
72+
mxc/rtc.c
73+
mxc/spim.c
74+
mxc/spis.c
75+
mxc/spix.c
76+
mxc/tmr.c
77+
mxc/tmr_utils.c
78+
mxc/uart.c
79+
mxc/wdt.c
80+
mxc/wdt2.c
81+
82+
${STARTUP_FILE}
83+
)

targets/TARGET_Maxim/TARGET_MAX32620C/device/TOOLCHAIN_ARM_STD/MAX32620.sct

Lines changed: 1 addition & 1 deletion
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-m4
22
; MAX32620
33
; 2MB FLASH (0x200000) @ 0x000000000
44
; 256KB RAM (0x40000) @ 0x20000000
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# Copyright (c) 2020 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if("MAX32625MBED" IN_LIST MBED_TARGET_LABELS)
5+
target_include_directories(mbed-core
6+
INTERFACE
7+
TARGET_MAX32625MBED
8+
)
9+
elseif("MAX32625PICO" IN_LIST MBED_TARGET_LABELS)
10+
target_include_directories(mbed-core
11+
INTERFACE
12+
TARGET_MAX32625PICO
13+
)
14+
15+
target_sources(mbed-core
16+
INTERFACE
17+
TARGET_MAX32625PICO/low_level_init.c
18+
)
19+
elseif("SDT32625B" IN_LIST MBED_TARGET_LABELS)
20+
target_include_directories(mbed-core
21+
INTERFACE
22+
TARGET_SDT32625B
23+
)
24+
endif()
25+
26+
if(${MBED_TOOLCHAIN} STREQUAL "ARM")
27+
if("MAX32625_BOOT" IN_LIST MBED_TARGET_LABELS)
28+
set(LINKER_FILE device/TOOLCHAIN_ARM_STD/TARGET_MAX32625_BOOT/MAX32625.sct)
29+
elseif("MAX32625_NO_BOOT" IN_LIST MBED_TARGET_LABELS)
30+
set(LINKER_FILE device/TOOLCHAIN_ARM_STD/TARGET_MAX32625_NO_BOOT/MAX32625.sct)
31+
endif()
32+
33+
set(STARTUP_FILE device/TOOLCHAIN_ARM_STD/startup_MAX32625.S)
34+
elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
35+
if("MAX32625_BOOT" IN_LIST MBED_TARGET_LABELS)
36+
set(LINKER_FILE device/TOOLCHAIN_GCC_ARM/TARGET_MAX32625_BOOT/max32625.ld)
37+
elseif("MAX32625_NO_BOOT" IN_LIST MBED_TARGET_LABELS)
38+
set(LINKER_FILE device/TOOLCHAIN_GCC_ARM/TARGET_MAX32625_NO_BOOT/max32625.ld)
39+
endif()
40+
41+
set(STARTUP_FILE device/TOOLCHAIN_GCC_ARM/startup_max32625.S)
42+
endif()
43+
44+
set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
45+
46+
target_include_directories(mbed-core
47+
INTERFACE
48+
.
49+
device
50+
mxc
51+
)
52+
53+
target_sources(mbed-core
54+
INTERFACE
55+
PeripheralPins.c
56+
analogin_api.c
57+
gpio_api.c
58+
gpio_irq_api.c
59+
i2c_api.c
60+
pinmap.c
61+
port_api.c
62+
pwmout_api.c
63+
rtc_api.c
64+
serial_api.c
65+
sleep.c
66+
spi_api.c
67+
us_ticker.c
68+
69+
device/device_nvic.c
70+
device/system_max32625.c
71+
72+
mxc/adc.c
73+
mxc/clkman.c
74+
mxc/crc.c
75+
mxc/flc.c
76+
mxc/gpio.c
77+
mxc/i2cm.c
78+
mxc/i2cs.c
79+
mxc/icc.c
80+
mxc/ioman.c
81+
mxc/lp.c
82+
mxc/maa.c
83+
mxc/mxc_aes.c
84+
mxc/mxc_assert.c
85+
mxc/mxc_sys.c
86+
mxc/owm.c
87+
mxc/pmu.c
88+
mxc/prng.c
89+
mxc/pt.c
90+
mxc/rtc.c
91+
mxc/spim.c
92+
mxc/spis.c
93+
mxc/spix.c
94+
mxc/tmr.c
95+
mxc/tmr_utils.c
96+
mxc/uart.c
97+
mxc/wdt.c
98+
mxc/wdt2.c
99+
100+
${STARTUP_FILE}
101+
)

targets/TARGET_Maxim/TARGET_MAX32625/device/TOOLCHAIN_ARM_STD/TARGET_MAX32625_BOOT/MAX32625.sct

Lines changed: 1 addition & 1 deletion
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-m4
22
; MAX32625
33
; 512KB FLASH (0x80000) @ 0x000000000
44
; 160KB RAM (0x28000) @ 0x20000000

targets/TARGET_Maxim/TARGET_MAX32625/device/TOOLCHAIN_ARM_STD/TARGET_MAX32625_NO_BOOT/MAX32625.sct

Lines changed: 1 addition & 1 deletion
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-m4
22
; MAX32625
33
; 512KB FLASH (0x80000) @ 0x000000000
44
; 160KB RAM (0x28000) @ 0x20000000
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("MAX32630FTHR" IN_LIST MBED_TARGET_LABELS)
5+
target_include_directories(mbed-core
6+
INTERFACE
7+
TARGET_MAX32630FTHR
8+
)
9+
10+
target_sources(mbed-core
11+
INTERFACE
12+
TARGET_MAX32630FTHR/low_level_init.c
13+
)
14+
endif()
15+
16+
if(${MBED_TOOLCHAIN} STREQUAL "ARM")
17+
set(LINKER_FILE device/TOOLCHAIN_ARM_STD/MAX3263x.sct)
18+
19+
set(STARTUP_FILE device/TOOLCHAIN_ARM_STD/startup_MAX3263x.S)
20+
21+
set(LIB_EXACT_LE TOOLCHAIN_ARM_STD/libexactLE.ar)
22+
elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
23+
set(LINKER_FILE device/TOOLCHAIN_GCC_ARM/max3263x.ld)
24+
25+
set(STARTUP_FILE device/TOOLCHAIN_GCC_ARM/startup_max3263x.S)
26+
27+
set(LIB_EXACT_LE TOOLCHAIN_GCC_ARM/libexactLE.a)
28+
endif()
29+
30+
set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
31+
32+
target_link_libraries(mbed-core INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/${LIB_EXACT_LE})
33+
34+
target_include_directories(mbed-core
35+
INTERFACE
36+
.
37+
device
38+
mxc
39+
)
40+
41+
target_sources(mbed-core
42+
INTERFACE
43+
PeripheralPins.c
44+
analogin_api.c
45+
gpio_api.c
46+
gpio_irq_api.c
47+
i2c_api.c
48+
pinmap.c
49+
port_api.c
50+
pwmout_api.c
51+
rtc_api.c
52+
serial_api.c
53+
sleep.c
54+
spi_api.c
55+
us_ticker.c
56+
57+
device/device_nvic.c
58+
device/system_max3263x.c
59+
60+
mxc/adc.c
61+
mxc/clkman.c
62+
mxc/crc.c
63+
mxc/flc.c
64+
mxc/gpio.c
65+
mxc/i2cm.c
66+
mxc/i2cs.c
67+
mxc/icc.c
68+
mxc/ioman.c
69+
mxc/lp.c
70+
mxc/maa.c
71+
mxc/mxc_aes.c
72+
mxc/mxc_assert.c
73+
mxc/mxc_sys.c
74+
mxc/owm.c
75+
mxc/pmu.c
76+
mxc/prng.c
77+
mxc/pt.c
78+
mxc/rtc.c
79+
mxc/spim.c
80+
mxc/spix.c
81+
mxc/tmr.c
82+
mxc/tmr_utils.c
83+
mxc/uart.c
84+
mxc/wdt.c
85+
mxc/wdt2.c
86+
87+
${STARTUP_FILE}
88+
)

targets/TARGET_Maxim/TARGET_MAX32630/device/TOOLCHAIN_ARM_STD/MAX3263x.sct

Lines changed: 1 addition & 1 deletion
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-m4
22
; MAX3263x
33
; 2MB FLASH (0x200000) @ 0x000000000
44
; 512KB RAM (0x80000) @ 0x20000000

tools/cmake/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ The following targets are supported:
2323
- ARM FM targets
2424
- Cypress targets
2525
- Freescale targets
26+
- MAXIM targets
2627
- STM targets
2728

2829
### Supported toolchains

0 commit comments

Comments
 (0)