fix linking missing ivt symbol for imxrt with cmake

changed device port = 0, host port =1 for imxrt 1060 and 1064
This commit is contained in:
hathach
2023-05-08 17:25:47 +07:00
parent 654f182176
commit 4fc4f35a8a
13 changed files with 60 additions and 14 deletions

View File

@@ -1,5 +1,5 @@
if (TOOLCHAIN STREQUAL "gcc")
set(TOOLCHAIN_COMMON_FLAGS
list(APPEND TOOLCHAIN_COMMON_FLAGS
-mthumb
-mcpu=cortex-m7
-mfloat-abi=hard

View File

@@ -25,7 +25,13 @@ list(APPEND TOOLCHAIN_COMMON_FLAGS
-fno-strict-aliasing
)
set(TOOLCHAIN_WARNING_FLAGS
list(APPEND TOOLCHAIN_EXE_LINKER_FLAGS
-Wl,--print-memory-usage
-Wl,--gc-sections
-Wl,--cref
)
list(APPEND TOOLCHAIN_WARNING_FLAGS
-Wall
-Wextra
-Werror

View File

@@ -11,6 +11,9 @@ foreach(LANG IN ITEMS C CXX ASM)
set(CMAKE_${LANG}_FLAGS_DEBUG_INIT "-Og")
endforeach()
# Linker
list(JOIN TOOLCHAIN_EXE_LINKER_FLAGS " " CMAKE_EXE_LINKER_FLAGS_INIT)
# try_compile is cmake test compiling its own example,
# pass -nostdlib to skip stdlib linking
get_property(IS_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE)

View File

@@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 3.17)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)

View File

@@ -169,7 +169,7 @@ $(BUILD)/$(PROJECT).hex: $(BUILD)/$(PROJECT).elf
$(BUILD)/$(PROJECT).elf: $(OBJ)
@echo LINK $@
@$(LD) -o $@ $(LDFLAGS) $^ -Wl,--start-group $(LIBS) -Wl,--end-group
@$(LD) -o $@ $(LDFLAGS) $^ -Wl,--print-memory-usage -Wl,--start-group $(LIBS) -Wl,--end-group
endif