Skip to content

Commit 4fc4f35

Browse files
committed
fix linking missing ivt symbol for imxrt with cmake
changed device port = 0, host port =1 for imxrt 1060 and 1064
1 parent 654f182 commit 4fc4f35

File tree

13 files changed

+60
-14
lines changed

13 files changed

+60
-14
lines changed

.idea/runConfigurations/rt10xx.xml renamed to .idea/runConfigurations/rt1010.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations/tinyusb_examples.xml

Lines changed: 0 additions & 5 deletions
This file was deleted.

examples/cmake/cpu/cortex-m7.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
if (TOOLCHAIN STREQUAL "gcc")
2-
set(TOOLCHAIN_COMMON_FLAGS
2+
list(APPEND TOOLCHAIN_COMMON_FLAGS
33
-mthumb
44
-mcpu=cortex-m7
55
-mfloat-abi=hard

examples/cmake/toolchain/arm_gcc.cmake

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,13 @@ list(APPEND TOOLCHAIN_COMMON_FLAGS
2525
-fno-strict-aliasing
2626
)
2727

28-
set(TOOLCHAIN_WARNING_FLAGS
28+
list(APPEND TOOLCHAIN_EXE_LINKER_FLAGS
29+
-Wl,--print-memory-usage
30+
-Wl,--gc-sections
31+
-Wl,--cref
32+
)
33+
34+
list(APPEND TOOLCHAIN_WARNING_FLAGS
2935
-Wall
3036
-Wextra
3137
-Werror

examples/cmake/toolchain/set_flags.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ foreach(LANG IN ITEMS C CXX ASM)
1111
set(CMAKE_${LANG}_FLAGS_DEBUG_INIT "-Og")
1212
endforeach()
1313

14+
# Linker
15+
list(JOIN TOOLCHAIN_EXE_LINKER_FLAGS " " CMAKE_EXE_LINKER_FLAGS_INIT)
16+
1417
# try_compile is cmake test compiling its own example,
1518
# pass -nostdlib to skip stdlib linking
1619
get_property(IS_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE)

examples/device/cdc_msc/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
cmake_minimum_required(VERSION 3.17)
2+
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
23

34
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
45

examples/rules.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ $(BUILD)/$(PROJECT).hex: $(BUILD)/$(PROJECT).elf
169169

170170
$(BUILD)/$(PROJECT).elf: $(OBJ)
171171
@echo LINK $@
172-
@$(LD) -o $@ $(LDFLAGS) $^ -Wl,--start-group $(LIBS) -Wl,--end-group
172+
@$(LD) -o $@ $(LDFLAGS) $^ -Wl,--print-memory-usage -Wl,--start-group $(LIBS) -Wl,--end-group
173173

174174
endif
175175

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
set(MCU_VARIANT MIMXRT1062)
2+
3+
set(JLINK_DEVICE MIMXRT1062xxx6A)
4+
set(PYOCD_TARGET mimxrt1060)
5+
6+
function(update_board TARGET)
7+
target_sources(${TARGET} PUBLIC
8+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/evkmimxrt1060_flexspi_nor_config.c
9+
)
10+
target_compile_definitions(${TARGET} PUBLIC
11+
CPU_MIMXRT1062DVL6A
12+
BOARD_TUD_RHPORT=0
13+
BOARD_TUH_RHPORT=1
14+
)
15+
endfunction()

hw/bsp/imxrt/boards/mimxrt1060_evk/board.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ JLINK_DEVICE = MIMXRT1062xxx6A
77
# For flash-pyocd target
88
PYOCD_TARGET = mimxrt1060
99

10-
BOARD_TUD_RHPORT = 1
11-
BOARD_TUH_RHPORT = 0
10+
BOARD_TUD_RHPORT = 0
11+
BOARD_TUH_RHPORT = 1
1212

1313
# flash using pyocd
1414
flash: flash-pyocd
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
set(MCU_VARIANT MIMXRT1064)
2+
3+
set(JLINK_DEVICE MIMXRT1064xxx6A)
4+
set(PYOCD_TARGET mimxrt1064)
5+
6+
function(update_board TARGET)
7+
target_sources(${TARGET} PUBLIC
8+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/evkmimxrt1064_flexspi_nor_config.c
9+
)
10+
target_compile_definitions(${TARGET} PUBLIC
11+
CPU_MIMXRT1064DVL6A
12+
BOARD_TUD_RHPORT=0
13+
BOARD_TUH_RHPORT=1
14+
)
15+
endfunction()

0 commit comments

Comments
 (0)