From 4b785268e87cf0c92a5244feb1340783d372ff87 Mon Sep 17 00:00:00 2001 From: Bumsik Kim Date: Sat, 29 Feb 2020 21:26:09 +0900 Subject: [PATCH 1/5] stm32mp1: Prevent sending extra newline with DUMMY --- run_arduino_gen.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run_arduino_gen.sh b/run_arduino_gen.sh index f09f1935e..00b811a77 100755 --- a/run_arduino_gen.sh +++ b/run_arduino_gen.sh @@ -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." } From 8dce686acecf044543f0ce1b8ed199599a6f7f11 Mon Sep 17 00:00:00 2001 From: Bumsik Kim Date: Sat, 29 Feb 2020 21:27:33 +0900 Subject: [PATCH 2/5] stm32mp1: monitor: Fix not printing until newline --- run_arduino_gen.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run_arduino_gen.sh b/run_arduino_gen.sh index 00b811a77..da3ead8fd 100755 --- a/run_arduino_gen.sh +++ b/run_arduino_gen.sh @@ -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) From 9d708eb1bc0d9b7afa53f03458fbaa688bb8da81 Mon Sep 17 00:00:00 2001 From: Bumsik Kim Date: Sat, 29 Feb 2020 21:30:31 +0900 Subject: [PATCH 3/5] stm32mp1: send-file set buffer size as 496 --- run_arduino_gen.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/run_arduino_gen.sh b/run_arduino_gen.sh index da3ead8fd..e3cbb74b2 100755 --- a/run_arduino_gen.sh +++ b/run_arduino_gen.sh @@ -213,7 +213,10 @@ 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 ;; minicom) autodetect_board From e800cfdb6736fc3a38f719cd2f52ea227b5c6b4e Mon Sep 17 00:00:00 2001 From: Bumsik Kim Date: Sat, 29 Feb 2020 21:31:17 +0900 Subject: [PATCH 4/5] stm32mp1: Add log command --- run_arduino_gen.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/run_arduino_gen.sh b/run_arduino_gen.sh index e3cbb74b2..e516c6e2e 100755 --- a/run_arduino_gen.sh +++ b/run_arduino_gen.sh @@ -218,6 +218,9 @@ case "$1" in # 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 TERM=xterm minicom -D $RPMSG_DIR @@ -234,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" @@ -269,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 "" From 34e1baf98bc2606f88fb6bdd91b4f10bd73c43ef Mon Sep 17 00:00:00 2001 From: Bumsik Kim Date: Wed, 4 Mar 2020 10:44:16 +0900 Subject: [PATCH 5/5] run_arduino_gen.sh: Silent dos2unix --- run_arduino_gen.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run_arduino_gen.sh b/run_arduino_gen.sh index e516c6e2e..269caeb3b 100755 --- a/run_arduino_gen.sh +++ b/run_arduino_gen.sh @@ -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 }