Skip to content

run_arduino_sh: Add log command, some improvements #55

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 4, 2020
Merged
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
20 changes: 15 additions & 5 deletions run_arduino_gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ generate_packaged_script() {
fi
echo "'" >> $output_script
tail -n +$(grep -n "%}" "$this_script" | cut -d: -f1 | head -n 1) $this_script >> $output_script
dos2unix $output_script
dos2unix $output_script 2> /dev/null
}


Expand Down Expand Up @@ -167,7 +167,7 @@ try_send() {
# Linux host must send any dummy data first to finish initialization of rpmsg
# on the coprocessor side. This message should be discarded.
# See: https://github.com/OpenAMP/open-amp/issues/182
echo "DUMMY" >$RPMSG_DIR
echo -n "DUMMY" >$RPMSG_DIR
echo "Virtual serial $RPMSG_DIR connection established."
}

Expand Down Expand Up @@ -204,7 +204,7 @@ case "$1" in
;;
monitor)
autodetect_board
stty igncr onlcr -echo -F $RPMSG_DIR
stty raw -echo -echoe -echok -F $RPMSG_DIR
cat $RPMSG_DIR
;;
send-msg)
Expand All @@ -213,7 +213,13 @@ case "$1" in
;;
send-file)
autodetect_board
dd if="$2" of=$RPMSG_DIR
# Maximum buffer size at a time: 512 - 16 bytes
# Otherwise, it used to return error in earlier version of OpenSTLinux
# Reference: https://elixir.bootlin.com/linux/v5.5.6/source/drivers/rpmsg/virtio_rpmsg_bus.c#L581
dd if="$2" bs=496 of=$RPMSG_DIR
;;
log)
cat /sys/kernel/debug/remoteproc/remoteproc0/trace0
;;
minicom)
autodetect_board
Expand All @@ -231,7 +237,8 @@ case "$1" in
*)
echo "Usage: $0 [start|stop|restart]"
echo " $0 [install|uninstall]"
echo " $0 [monitor|send-msg|send-file|minicom]"
echo " $0 [monitor|minicom|log]"
echo " $0 [send-msg|send-file] ..."
echo " $0 [generate]"
echo ""
echo "$0 is a helper script that helps managing an Arduino binary"
Expand Down Expand Up @@ -266,6 +273,9 @@ case "$1" in
echo "$0 minicom"
echo " Launch minicom interactive serial communication program."
echo ""
echo "$0 log"
echo " Print debugging log in OpenAMP trace buffer."
echo ""
echo "$0 stop"
echo " Stop the coprocessor."
echo ""
Expand Down