blob: dc68cc1740c7209b3c7dc34410ea404e81a9a7e6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
|
# CROSS COMPILER SETTING
SET(CMAKE_SYSTEM_NAME Generic)
CMAKE_MINIMUM_REQUIRED (VERSION 2.6)
# THE VERSION NUMBER
SET (Tutorial_VERSION_MAJOR 1)
SET (Tutorial_VERSION_MINOR 0)
# ENABLE ASM
ENABLE_LANGUAGE(ASM)
SET(CMAKE_STATIC_LIBRARY_PREFIX)
SET(CMAKE_STATIC_LIBRARY_SUFFIX)
SET(CMAKE_EXECUTABLE_LIBRARY_PREFIX)
SET(CMAKE_EXECUTABLE_LIBRARY_SUFFIX)
SET(CMAKE_SKIP_INSTALL_RULES TRUE)
# CURRENT DIRECTORY
SET(ProjDirPath ${CMAKE_CURRENT_SOURCE_DIR})
SET(BspRootDirPath ${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../..)
# RELEASE/DEBUG LINK FILE
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -T${BspRootDirPath}/platform/devices/MCIMX7D/linker/gcc/MCIMX7D_M4_tcm.ld -static")
# DEFAULT ASM FLAGS
SET(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mthumb -Wall -fno-common -ffunction-sections -fdata-sections -ffreestanding -fno-builtin -mapcs -std=gnu99")
# DEFAULT C FLAGS
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mthumb -MMD -MP -Wall -fno-common -ffunction-sections -fdata-sections -ffreestanding -fno-builtin -mapcs -std=gnu99")
# DEFAULT LD FLAGS
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 --specs=nano.specs -Wall -fno-common -ffunction-sections -fdata-sections -ffreestanding -fno-builtin -mthumb -mapcs -Xlinker --gc-sections -Xlinker -static -Xlinker -z -Xlinker muldefs")
# DEBUG ASM FLAGS
SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -g")
# DEBUG C FLAGS
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g -O0")
# DEBUG LD FLAGS
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -g")
# RELEASE C FLAGS
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Os")
# ASM MACRO
SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -D__DEBUG")
# C MACRO
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D__DEBUG")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -D__NDEBUG")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DCPU_MCIMX7D_M4")
# INCLUDE_DIRECTORIES
IF(CMAKE_BUILD_TYPE MATCHES Debug)
ELSEIF(CMAKE_BUILD_TYPE MATCHES Release)
ENDIF()
INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../..)
INCLUDE_DIRECTORIES(${BspRootDirPath}/platform/CMSIS/Include)
INCLUDE_DIRECTORIES(${BspRootDirPath}/platform/devices)
INCLUDE_DIRECTORIES(${BspRootDirPath}/platform/devices/MCIMX7D/include)
INCLUDE_DIRECTORIES(${BspRootDirPath}/platform/devices/MCIMX7D/startup)
INCLUDE_DIRECTORIES(${BspRootDirPath}/platform/drivers/inc)
INCLUDE_DIRECTORIES(${BspRootDirPath}/platform/utilities/inc)
INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../..)
# ADD_EXECUTABLE
ADD_EXECUTABLE(ecspi_interrupt_master_example
"${BspRootDirPath}/platform/devices/MCIMX7D/startup/gcc/startup_MCIMX7D_M4.S"
"${BspRootDirPath}/platform/utilities/src/debug_console_imx.c"
"${BspRootDirPath}/platform/utilities/inc/debug_console_imx.h"
"${BspRootDirPath}/platform/utilities/src/print_scan.c"
"${BspRootDirPath}/platform/utilities/src/print_scan.h"
"${BspRootDirPath}/platform/drivers/inc/ccm_analog_imx7d.h"
"${BspRootDirPath}/platform/drivers/inc/ccm_imx7d.h"
"${BspRootDirPath}/platform/drivers/inc/lmem.h"
"${BspRootDirPath}/platform/drivers/inc/rdc.h"
"${BspRootDirPath}/platform/drivers/inc/rdc_defs_imx7d.h"
"${BspRootDirPath}/platform/drivers/inc/wdog_imx.h"
"${BspRootDirPath}/platform/drivers/src/ccm_analog_imx7d.c"
"${BspRootDirPath}/platform/drivers/src/ccm_imx7d.c"
"${BspRootDirPath}/platform/drivers/src/lmem.c"
"${BspRootDirPath}/platform/drivers/src/rdc.c"
"${BspRootDirPath}/platform/drivers/src/wdog_imx.c"
"${BspRootDirPath}/platform/devices/MCIMX7D/startup/system_MCIMX7D_M4.c"
"${BspRootDirPath}/platform/devices/MCIMX7D/startup/system_MCIMX7D_M4.h"
"${ProjDirPath}/../../../../../pin_mux.c"
"${ProjDirPath}/../../../../../pin_mux.h"
"${ProjDirPath}/../../../../../board.c"
"${ProjDirPath}/../../../../../board.h"
"${ProjDirPath}/../../../../../clock_freq.c"
"${ProjDirPath}/../../../../../clock_freq.h"
"${ProjDirPath}/../hardware_init.c"
"${ProjDirPath}/../main.c"
"${BspRootDirPath}/platform/drivers/src/ecspi.c"
"${BspRootDirPath}/platform/drivers/inc/ecspi.h"
"${BspRootDirPath}/platform/drivers/src/uart_imx.c"
"${BspRootDirPath}/platform/drivers/inc/uart_imx.h"
)
SET_TARGET_PROPERTIES(ecspi_interrupt_master_example PROPERTIES OUTPUT_NAME "ecspi_interrupt_master_example.elf")
TARGET_LINK_LIBRARIES(ecspi_interrupt_master_example -Wl,--start-group)
# LIBRARIES
IF(CMAKE_BUILD_TYPE MATCHES Debug)
ELSEIF(CMAKE_BUILD_TYPE MATCHES Release)
ENDIF()
# SYSTEM LIBRARIES
TARGET_LINK_LIBRARIES(ecspi_interrupt_master_example m)
TARGET_LINK_LIBRARIES(ecspi_interrupt_master_example c)
TARGET_LINK_LIBRARIES(ecspi_interrupt_master_example gcc)
TARGET_LINK_LIBRARIES(ecspi_interrupt_master_example nosys)
TARGET_LINK_LIBRARIES(ecspi_interrupt_master_example -Wl,--end-group)
# MAP FILE
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Xlinker -Map=${EXECUTABLE_OUTPUT_PATH}/ecspi_interrupt_master_example.map")
# BIN AND HEX
ADD_CUSTOM_COMMAND(TARGET ecspi_interrupt_master_example POST_BUILD COMMAND ${CMAKE_OBJCOPY} -Oihex ${EXECUTABLE_OUTPUT_PATH}/ecspi_interrupt_master_example.elf ${EXECUTABLE_OUTPUT_PATH}/ecspi_interrupt_master_example.hex)
ADD_CUSTOM_COMMAND(TARGET ecspi_interrupt_master_example POST_BUILD COMMAND ${CMAKE_OBJCOPY} -Obinary ${EXECUTABLE_OUTPUT_PATH}/ecspi_interrupt_master_example.elf ${EXECUTABLE_OUTPUT_PATH}/ecspi_interrupt_master_example.bin)
|