Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions hardware/fpga/child2_fpga_build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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),)
Expand Down
74 changes: 74 additions & 0 deletions hardware/fpga/minicom_video_demo.txt
Original file line number Diff line number Diff line change
@@ -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`


29 changes: 29 additions & 0 deletions hardware/fpga/video_demo.sh
Original file line number Diff line number Diff line change
@@ -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'
Loading