From 2b17010dee9c2f2a4755fa419158bcbd92fbdc7e Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 14 Jul 2013 12:34:45 -0600 Subject: Fix an error in the ordering of fields in zm_transition_s structure; update documentation --- apps/system/zmodem/README.txt | 33 +++++++++++++++++++++++++++++++-- apps/system/zmodem/zm.h | 2 +- apps/system/zmodem/zm_receive.c | 6 +++--- 3 files changed, 35 insertions(+), 6 deletions(-) (limited to 'apps') 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 @@ -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 t /dev/ttyS0 + + Where 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); -- cgit v1.2.3