summaryrefslogtreecommitdiff
path: root/apps/system/zmodem
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2013-07-14 12:34:45 -0600
committerGregory Nutt <gnutt@nuttx.org>2013-07-14 12:34:45 -0600
commit2b17010dee9c2f2a4755fa419158bcbd92fbdc7e (patch)
tree57d80fc1071cc2809cec9b99774bfec47815fb46 /apps/system/zmodem
parent2428fdc9def43aaf9d4da1452cb2a8c24aedd579 (diff)
downloadnuttx-2b17010dee9c2f2a4755fa419158bcbd92fbdc7e.tar.gz
nuttx-2b17010dee9c2f2a4755fa419158bcbd92fbdc7e.tar.bz2
nuttx-2b17010dee9c2f2a4755fa419158bcbd92fbdc7e.zip
Fix an error in the ordering of fields in zm_transition_s structure; update documentation
Diffstat (limited to 'apps/system/zmodem')
-rwxr-xr-xapps/system/zmodem/README.txt33
-rw-r--r--apps/system/zmodem/zm.h2
-rw-r--r--apps/system/zmodem/zm_receive.c6
3 files changed, 35 insertions, 6 deletions
diff --git a/apps/system/zmodem/README.txt b/apps/system/zmodem/README.txt
index 63d15cecb..ebde16c1d 100755
--- a/apps/system/zmodem/README.txt
+++ b/apps/system/zmodem/README.txt
@@ -4,6 +4,8 @@ README
Using NuttX Zmodem with a Linux Host
====================================
+ Sending Files from the Target to the Linux Host PC
+ --------------------------------------------------
The NuttX Zmodem commands have been verified against the rzsz programs
running on a Linux PC. To send a file to the PC, first make sure that
the serial port is configured to work with the board:
@@ -11,7 +13,7 @@ Using NuttX Zmodem with a Linux Host
$ sudo stty -F /dev/ttyS0 57600
$ sudo stty -F /dev/ttyS0
- start rz on the Linux host:
+ Start rz on the Linux host:
$ sudo rz </dev/ttyS0 >/dev/ttyS0
@@ -38,4 +40,31 @@ Using NuttX Zmodem with a Linux Host
Where filename is the full path to the file to send (i.e., it begins
with the '/' character).
- \ No newline at end of file
+ Receiving Files on the Target from the Linux Host PC
+ ----------------------------------------------------
+ To send a file to the target, first make sure that the serial port on the
+ host is configured to work with the board:
+
+ $ sudo stty -F /dev/ttyS0 57600
+ $ sudo stty -F /dev/ttyS0
+
+ Start rz on the on the target:
+
+ nsh> rz -d /dev/ttyS1
+
+ Then use the sz command on Linux to send the file to the target:
+
+ $ sudo sz <filename> t </dev/ttyS0 >/dev/ttyS0
+
+ Where <filename> is the file that you want to send.
+
+ The resulting file will be found where you have configured the Zmodem
+ "sandbox" via CONFIG_SYSTEM_ZMODEM_MOUNTPOINT.
+
+ You can add the az -v option multiple times, each increases the level
+ of debug output. If you want to capture the Linux rz output, then
+ re-direct stderr to a log file by adding 2>az.log to the end of the
+ rz command.
+
+ If you don't have the az command on your Linux box, the package to
+ install rzsz (or possibily lrzsz).
diff --git a/apps/system/zmodem/zm.h b/apps/system/zmodem/zm.h
index 60be71ff4..10f4640c5 100644
--- a/apps/system/zmodem/zm.h
+++ b/apps/system/zmodem/zm.h
@@ -287,8 +287,8 @@ typedef int (*action_t)(FAR struct zm_state_s *pzm);
struct zm_transition_s
{
uint8_t type; /* Event (Frame type) */
- uint8_t next; /* Next state */
bool bdiscard; /* TRUE: discard buffered input */
+ uint8_t next; /* Next state */
action_t action; /* Transition action */
};
diff --git a/apps/system/zmodem/zm_receive.c b/apps/system/zmodem/zm_receive.c
index 132257a23..12589886f 100644
--- a/apps/system/zmodem/zm_receive.c
+++ b/apps/system/zmodem/zm_receive.c
@@ -81,14 +81,14 @@
* <---- ZRINIT ZMR_START
* ZSINIT ---->
* <---- ZACK ZMR_INITWAIT
- * ZFILE ---->
+ * ZFILE ---->
* <---- ZRPOS ZMR_FILEINFO
* ZDATA ---->
* <---- ZCRC ZMR_CRCWAIT
* ZCRC ----> ZMR_READREADY
* Data packets ----> ZMR_READING
* Last packet ---->
- * ZEOF ---->
+ * ZEOF ---->
* <---- ZRINIT
* ZFIN ---->
* <---- ZFIN ZMR_FINISH
@@ -955,7 +955,7 @@ static int zmr_zfin(FAR struct zm_state_s *pzm)
* meaning that we are all done.
*/
- zmdbg("PSTATE %d:%d->%d.%d: send ZFIN\n",
+ zmdbg("PSTATE %d:%d->%d.%d: Send ZFIN\n",
pzm->pstate, pzm->psubstate, PSTATE_IDLE, PIDLE_ZPAD);
zmdbg("ZMR_STATE %d\n", pzm->state);