Skip to content

Commit 15af74f

Browse files
committed
Makefile.multiboard_test: Adding for multiboard test.
Signed-off-by: zhanglinjing <Linjing.Zhang@infineon.com>
1 parent ce8df42 commit 15af74f

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

Makefile.multiboard_test

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Makefile.multiboard_test
2+
# Example usage:
3+
# make -f Makefile.multiboard_test test_wire_connected2 PORT_BOARD1=/dev/ttyACM0 PORT_BOARD2=/dev/ttyACM1 FQBN_BOARD1=arduino-git:xmc:kit_xmc47_relax FQBN_BOARD2=arduino-git:xmc:kit_xmc47_relax
4+
#
5+
# This Makefile is designed for multi-board testing and flashing.
6+
# It will flash two boards, run sync (/utils/sync_ports.py),
7+
# and start the monitor on the master board.
8+
9+
FQBN_BOARD1 ?=
10+
FQBN_BOARD2 ?=
11+
12+
PORT_BOARD1 ?=
13+
PORT_BOARD2 ?=
14+
PORT_LIST ?=
15+
16+
UNITY_PATH ?= Unity
17+
BAUD_RATE ?= 115200
18+
19+
.PHONY: test_wire_connected2 sync
20+
21+
# Target: test_wire_connected2
22+
# 1. Flash slave board with test_wire_connected2_slavepingpong
23+
# 2. Flash master board with test_wire_connected2_masterpingpong
24+
# 3. Run sync script to synchronize both boards
25+
# 4. Start monitor on the master board
26+
test_wire_connected2:
27+
$(MAKE) -f Makefile test_wire_connected2_slavepingpong PORT=$(PORT_BOARD1) FQBN=$(FQBN_BOARD1)
28+
$(MAKE) -f Makefile test_wire_connected2_masterpingpong PORT=$(PORT_BOARD2) FQBN=$(FQBN_BOARD2)
29+
$(MAKE) -f Makefile.multiboard_test sync PORT_LIST="$(PORT_BOARD1) $(PORT_BOARD2)"
30+
$(MAKE) -f Makefile monitor PORT=$(PORT_BOARD2)
31+
32+
test_uart_connected2:
33+
$(MAKE) -f Makefile test_uart_connected2_rx PORT=$(PORT_BOARD1) FQBN=$(FQBN_BOARD1)
34+
$(MAKE) -f Makefile test_uart_connected2_tx PORT=$(PORT_BOARD2) FQBN=$(FQBN_BOARD2)
35+
$(MAKE) -f Makefile.multiboard_test sync PORT_LIST="$(PORT_BOARD1) $(PORT_BOARD2)"
36+
$(MAKE) -f Makefile monitor PORT=$(PORT_BOARD2)
37+
38+
# Target: sync
39+
# Calls the Python script to send start tokens to all boards in PORT_LIST
40+
sync:
41+
python3 utils/sync_ports.py $(PORT_LIST)

0 commit comments

Comments
 (0)