Skip to content

Commit 8e3bdd2

Browse files
committed
add python script to help building cmake, build all imxrt boards with ci
1 parent 4c796b8 commit 8e3bdd2

File tree

11 files changed

+221
-8
lines changed

11 files changed

+221
-8
lines changed

.github/workflows/cmake_arm.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CMake Build ARM
1+
name: CMake ARM
22

33
on:
44
push:
@@ -51,8 +51,4 @@ jobs:
5151
run: python3 tools/get_family_deps.py ${{ matrix.family }}
5252

5353
- name: Build
54-
run: |
55-
mkdir -p examples/build
56-
cd examples/build
57-
cmake -DFAMILY=${{ matrix.family }} -DBOARD=mimxrt1060_evk ..
58-
cmake --build .
54+
run: python tools/build_cmake.py ${{ matrix.family }}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
set(MCU_VARIANT MIMXRT1011)
2+
3+
set(JLINK_DEVICE MIMXRT1011DAE5A)
4+
set(PYOCD_TARGET mimxrt1010)
5+
set(NXPLINK_DEVICE MIMXRT1011xxxxx:EVK-MIMXRT1010)
6+
7+
function(update_board TARGET)
8+
target_sources(${TARGET} PUBLIC
9+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/evkmimxrt1010_flexspi_nor_config.c
10+
)
11+
target_compile_definitions(${TARGET} PUBLIC
12+
CPU_MIMXRT1011DAE5A
13+
CFG_EXAMPLE_VIDEO_READONLY
14+
)
15+
endfunction()
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
set(MCU_VARIANT MIMXRT1015)
2+
3+
set(JLINK_DEVICE MIMXRT1015DAF5A)
4+
set(PYOCD_TARGET mimxrt1015)
5+
set(NXPLINK_DEVICE MIMXRT1015xxxxx:EVK-MIMXRT1015)
6+
7+
function(update_board TARGET)
8+
target_sources(${TARGET} PUBLIC
9+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/evkmimxrt1015_flexspi_nor_config.c
10+
)
11+
target_compile_definitions(${TARGET} PUBLIC
12+
CPU_MIMXRT1015DAF5A
13+
CFG_EXAMPLE_VIDEO_READONLY
14+
)
15+
endfunction()
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
set(MCU_VARIANT MIMXRT1021)
2+
3+
set(JLINK_DEVICE MIMXRT1021DAG5A)
4+
set(PYOCD_TARGET mimxrt1020)
5+
set(NXPLINK_DEVICE MIMXRT1021xxxxx:EVK-MIMXRT1020)
6+
7+
function(update_board TARGET)
8+
target_sources(${TARGET} PUBLIC
9+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/evkmimxrt1020_flexspi_nor_config.c
10+
)
11+
target_compile_definitions(${TARGET} PUBLIC
12+
CPU_MIMXRT1021DAG5A
13+
)
14+
endfunction()
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
set(MCU_VARIANT MIMXRT1024)
2+
3+
set(JLINK_DEVICE MIMXRT1024DAG5A)
4+
set(PYOCD_TARGET mimxrt1024)
5+
set(NXPLINK_DEVICE MIMXRT1024xxxxx:MIMXRT1024-EVK)
6+
7+
function(update_board TARGET)
8+
target_sources(${TARGET} PUBLIC
9+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/evkmimxrt1024_flexspi_nor_config.c
10+
)
11+
target_compile_definitions(${TARGET} PUBLIC
12+
CPU_MIMXRT1024DAG5A
13+
CFG_EXAMPLE_VIDEO_READONLY
14+
#-Wno-error=array-bounds
15+
)
16+
endfunction()
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
set(MCU_VARIANT MIMXRT1052)
2+
3+
set(JLINK_DEVICE MIMXRT1052xxxxB)
4+
set(PYOCD_TARGET mimxrt1050)
5+
set(NXPLINK_DEVICE MIMXRT1052xxxxB:EVK-MIMXRT1050)
6+
7+
function(update_board TARGET)
8+
target_sources(${TARGET} PUBLIC
9+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/evkbimxrt1050_flexspi_nor_config.c
10+
)
11+
target_compile_definitions(${TARGET} PUBLIC
12+
CPU_MIMXRT1052DVL6B
13+
BOARD_TUD_RHPORT=0
14+
BOARD_TUH_RHPORT=1
15+
)
16+
endfunction()
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
set(MCU_VARIANT MIMXRT1062)
2+
3+
set(JLINK_DEVICE MIMXRT1062xxx6A)
4+
set(PYOCD_TARGET mimxrt1060)
5+
set(NXPLINK_DEVICE MIMXRT1062xxxxA:EVK-MIMXRT1060)
6+
7+
function(update_board TARGET)
8+
target_sources(${TARGET} PUBLIC
9+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/teensy40_flexspi_nor_config.c
10+
)
11+
target_compile_definitions(${TARGET} PUBLIC
12+
CPU_MIMXRT1062DVL6A
13+
BOARD_TUD_RHPORT=0
14+
BOARD_TUH_RHPORT=1
15+
)
16+
endfunction()
17+
18+
# flash by using teensy_loader_cli https://github.com/PaulStoffregen/teensy_loader_cli
19+
# Make sure it is in your PATH
20+
# flash: $(BUILD)/$(PROJECT).hex
21+
# teensy_loader_cli --mcu=imxrt1062 -v -w $<

hw/bsp/imxrt/boards/teensy_40/teensy40_flexspi_nor_config.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* SPDX-License-Identifier: BSD-3-Clause
66
*/
77

8-
#include <bsp/imxrt/boards/teensy_40/teensy40_flexspi_nor_config.h>
8+
#include "teensy40_flexspi_nor_config.h"
99

1010
/* Component ID definition, used by tools. */
1111
#ifndef FSL_COMPONENT_ID
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
set(MCU_VARIANT MIMXRT1062)
2+
3+
set(JLINK_DEVICE MIMXRT1062xxx6A)
4+
set(PYOCD_TARGET mimxrt1060)
5+
set(NXPLINK_DEVICE MIMXRT1062xxxxA:EVK-MIMXRT1060)
6+
7+
function(update_board TARGET)
8+
target_sources(${TARGET} PUBLIC
9+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/teensy41_flexspi_nor_config.c
10+
)
11+
target_compile_definitions(${TARGET} PUBLIC
12+
CPU_MIMXRT1062DVL6A
13+
BOARD_TUD_RHPORT=0
14+
BOARD_TUH_RHPORT=1
15+
)
16+
endfunction()
17+
18+
# flash by using teensy_loader_cli https://github.com/PaulStoffregen/teensy_loader_cli
19+
# Make sure it is in your PATH
20+
# flash: $(BUILD)/$(PROJECT).hex
21+
# teensy_loader_cli --mcu=imxrt1062 -v -w $<

hw/bsp/imxrt/boards/teensy_41/teensy41_flexspi_nor_config.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* SPDX-License-Identifier: BSD-3-Clause
66
*/
77

8-
#include <bsp/imxrt/boards/teensy_40/teensy40_flexspi_nor_config.h>
8+
#include "teensy41_flexspi_nor_config.h"
99

1010
/* Component ID definition, used by tools. */
1111
#ifndef FSL_COMPONENT_ID

0 commit comments

Comments
 (0)