@@ -111,7 +111,7 @@ generate_packaged_script() {
111
111
fi
112
112
echo " '" >> $output_script
113
113
tail -n +$( grep -n " %}" " $this_script " | cut -d: -f1 | head -n 1) $this_script >> $output_script
114
- dos2unix $output_script
114
+ dos2unix $output_script 2> /dev/null
115
115
}
116
116
117
117
@@ -167,7 +167,7 @@ try_send() {
167
167
# Linux host must send any dummy data first to finish initialization of rpmsg
168
168
# on the coprocessor side. This message should be discarded.
169
169
# See: https://github.com/OpenAMP/open-amp/issues/182
170
- echo " DUMMY" > $RPMSG_DIR
170
+ echo -n " DUMMY" > $RPMSG_DIR
171
171
echo " Virtual serial $RPMSG_DIR connection established."
172
172
}
173
173
@@ -204,7 +204,7 @@ case "$1" in
204
204
;;
205
205
monitor)
206
206
autodetect_board
207
- stty igncr onlcr -echo -F $RPMSG_DIR
207
+ stty raw -echo -echoe -echok -F $RPMSG_DIR
208
208
cat $RPMSG_DIR
209
209
;;
210
210
send-msg)
@@ -213,7 +213,13 @@ case "$1" in
213
213
;;
214
214
send-file)
215
215
autodetect_board
216
- dd if=" $2 " of=$RPMSG_DIR
216
+ # Maximum buffer size at a time: 512 - 16 bytes
217
+ # Otherwise, it used to return error in earlier version of OpenSTLinux
218
+ # Reference: https://elixir.bootlin.com/linux/v5.5.6/source/drivers/rpmsg/virtio_rpmsg_bus.c#L581
219
+ dd if=" $2 " bs=496 of=$RPMSG_DIR
220
+ ;;
221
+ log)
222
+ cat /sys/kernel/debug/remoteproc/remoteproc0/trace0
217
223
;;
218
224
minicom)
219
225
autodetect_board
@@ -231,7 +237,8 @@ case "$1" in
231
237
* )
232
238
echo " Usage: $0 [start|stop|restart]"
233
239
echo " $0 [install|uninstall]"
234
- echo " $0 [monitor|send-msg|send-file|minicom]"
240
+ echo " $0 [monitor|minicom|log]"
241
+ echo " $0 [send-msg|send-file] ..."
235
242
echo " $0 [generate]"
236
243
echo " "
237
244
echo " $0 is a helper script that helps managing an Arduino binary"
@@ -266,6 +273,9 @@ case "$1" in
266
273
echo " $0 minicom"
267
274
echo " Launch minicom interactive serial communication program."
268
275
echo " "
276
+ echo " $0 log"
277
+ echo " Print debugging log in OpenAMP trace buffer."
278
+ echo " "
269
279
echo " $0 stop"
270
280
echo " Stop the coprocessor."
271
281
echo " "
0 commit comments