From 582aa4ab0d05fc6a5eb8bc6ab7395bd2981cdbd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20N=C3=B3brega?= Date: Fri, 11 Sep 2026 02:27:45 +0100 Subject: [PATCH] Add minicom script for video demo showing linux boot, micropython and SSH. make fpga-build fpga-run BOARD=iob_aes_ku040_db_g make fpga-run BOARD=iob_aes_ku040_db_g RUN_LINUX=1 VIDEO_DEMO=1 --- hardware/fpga/child2_fpga_build.mk | 13 +++-- hardware/fpga/minicom_video_demo.txt | 74 ++++++++++++++++++++++++++++ hardware/fpga/video_demo.sh | 29 +++++++++++ 3 files changed, 113 insertions(+), 3 deletions(-) create mode 100644 hardware/fpga/minicom_video_demo.txt create mode 100755 hardware/fpga/video_demo.sh diff --git a/hardware/fpga/child2_fpga_build.mk b/hardware/fpga/child2_fpga_build.mk index 114e15f..da4460d 100644 --- a/hardware/fpga/child2_fpga_build.mk +++ b/hardware/fpga/child2_fpga_build.mk @@ -27,11 +27,18 @@ ifeq ($(ETH_DEMO),1) GRAB_TIMEOUT= 1500 MINICOM_SCRIPT=minicom_eth_demo.txt CONSOLE_CMD += && ( cd ../../software/tests/iob_eth && ./validate_eth.sh -S root -p root -s 192.168.74.2 -i $(ETH_IF) ) -# # Override CONSOLE_CMD: skip minicom (appended by child_fpga_build.mk) and run eth test instead -# # Use = (deferred expansion) to preserve variable references for later expansion -# CONSOLE_CMD = $(IOB_CONSOLE_PYTHON_ENV) $(PYTHON_DIR)/console_ethernet.py -s $(BOARD_SERIAL_PORT) -c $(PYTHON_DIR)/console.py -m "$(RMAC_ADDR)" -i "$(ETH_IF)" && ( cd ../../software/tests/iob_eth && ./validate_eth.sh -S root -p root -s 192.168.74.2 -i $(ETH_IF) ) endif +# Pass VIDEO_DEMO flag to remote systems +UFLAGS+=VIDEO_DEMO=$(VIDEO_DEMO) + +ifeq ($(VIDEO_DEMO),1) +GRAB_TIMEOUT= 1500 +MINICOM_SCRIPT=minicom_video_demo.txt +CONSOLE_CMD += && ( ./video_demo.sh ) +endif + + # include fpga build segment of (level 3) child systems # child systems can add their own child3_fpga_build.mk without having to override this one. ifneq ($(wildcard child3_fpga_build.mk),) diff --git a/hardware/fpga/minicom_video_demo.txt b/hardware/fpga/minicom_video_demo.txt new file mode 100644 index 0000000..9a29d95 --- /dev/null +++ b/hardware/fpga/minicom_video_demo.txt @@ -0,0 +1,74 @@ +# SPDX-FileCopyrightText: 2026 IObundle +# +# SPDX-License-Identifier: MIT + +# Script for "runscript" program of minicom, to runs scripts for demo SoC-Linux video + +# Set 15min timeout +# runscript has 2min timeout by default: +# check `timeout` in: https://linux.die.net/man/1/runscript +timeout 900 + +# Wait for the "buildroot login:" message +# Or jump straight to shell if we are already logged in +print "\n[minicom] Waiting for buildroot login..." +send "" +expect { + "buildroot login:" + "\n#" goto post_login + timeout 300 goto on_timeout +} + +print "\n[minicom] Detected login prompt. Logging in..." + +send "root" + +expect { + "Password:" + timeout 20 goto on_timeout +} + +send "root" + +expect { + "#" + timeout 20 goto on_timeout +} + +post_login: + +# +# Run tests +# + +print "\n[minicom] Logged in. Running tests..." + +print "\n[minicom] Demo MicroPython" +send "micropython -c 'print(\"Hello from MicroPython!\")'" +expect { + "#" + timeout 30 goto on_timeout +} + +print "\n[minicom] Show IP" +send "ip address" +expect { + "#" + timeout 30 goto on_timeout +} + +print "\n[minicom] Exit minicom to run ping test" + +# Exit minicom +! kill `cut -f4 -d' ' /proc/$PPID/stat` + + +# Jump here when timeout is triggered +on_timeout: + +print "\n[minicom] Timeout reached. Exiting..." + +# Exit minicom +! kill `cut -f4 -d' ' /proc/$PPID/stat` + + diff --git a/hardware/fpga/video_demo.sh b/hardware/fpga/video_demo.sh new file mode 100755 index 0000000..8650d8f --- /dev/null +++ b/hardware/fpga/video_demo.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +# SPDX-FileCopyrightText: 2026 IObundle +# +# SPDX-License-Identifier: MIT + +# Exit immediately if a command exits with a non-zero status +set -e + +# Define target IP and credentials +TARGET_IP="192.168.74.2" +PASSWORD="root" + +echo "------------------------------------------------" +echo "Running: ping -c 1 ${TARGET_IP}" +echo "------------------------------------------------" +ping -c 1 "${TARGET_IP}" + +# Add a clean newline space +echo "" + +echo "------------------------------------------------" +echo "Running: ssh root@${TARGET_IP} 'echo SSH connected successfully!; uname -a'" +echo "------------------------------------------------" + +# Use env variable to avoid exposing password in process lists +export SSHPASS="${PASSWORD}" + +sshpass -e ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@"${TARGET_IP}" 'echo "SSH connected successfully!"; uname -a'