Quantcast

Proper use of sx

classic Classic list List threaded Threaded
5 messages Options
Richard Möhn Richard Möhn
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Proper use of sx

Hi!

I'm trying to transfer a Lua program from my computer to an STM32F4
Discovery. The shell is working fine with minicom and I am following
these steps

 1. Input recv in the shell. It outputs

      Waiting for file ... CC[...]
   
    outputting C's and making me hurry.

 2. Open minicom's dialog for sending files, select the program file and
    hit Enter. It says:

      Retry 0: Got 72 for sector ACK
      Retry 0: NAK on sector      
      Retry 0: Got 72 for sector ACK
      Retry 0: NAK on sector      
      Retry 0: Got 72 for sector ACK
      Retry 0: NAK on sector      
      [...]
      Retry 0: Retry Count Exceeded    

      Transfer incomplete

I have tried options like -a, -b, -X for sx, but to no avail. I disabled
flow control. I have tried screen. I have tried cutecom. All to no
avail.

How is this done properly? I'd especially like to hear of ways to avoid
those minicom dialogs. -- Just a command in a separate shell that sends
the file after I have sent "recv" to eLua.

Best,

Richard
_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
raman raman
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Proper use of sx


Dear Richard,

>  2. Open minicom's dialog for sending files, select the program file and
>     hit Enter. It says: [...]
>    Transfer incomplete

The XMODEM protocol supported by eLua uses 128-byte packets (the
default, original XMODEM protocol). In your case, if minicom (it probably
uses -1k by default?) doesn't support this with sx, your transfer will
fail.

> I have tried options like -a, -b, -X for sx, but to no avail. I disabled
> flow control. I have tried screen. I have tried cutecom. All to no
> avail.

I remember trying teraterm [1] for XMODEM in eLua and it worked well.

> How is this done properly? I'd especially like to hear of ways to avoid
> those minicom dialogs. -- Just a command in a separate shell that sends
> the file after I have sent "recv" to eLua.

Can someone please suggest a program for using XMODEM on GNU/Linux?

Best,
Raman

Links:

[1]: http://www.ayera.com/teraterm/
Patrick Patrick
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Proper use of sx

I've had success using:

sx -bl 32 config.lua

Best of Luck


On Wed, Aug 7, 2013 at 12:13 AM, raman <[hidden email]> wrote:

Dear Richard,

>  2. Open minicom's dialog for sending files, select the program file and
>     hit Enter. It says: [...]
>    Transfer incomplete

The XMODEM protocol supported by eLua uses 128-byte packets (the
default, original XMODEM protocol). In your case, if minicom (it probably
uses -1k by default?) doesn't support this with sx, your transfer will
fail.

> I have tried options like -a, -b, -X for sx, but to no avail. I disabled
> flow control. I have tried screen. I have tried cutecom. All to no
> avail.

I remember trying teraterm [1] for XMODEM in eLua and it worked well.

> How is this done properly? I'd especially like to hear of ways to avoid
> those minicom dialogs. -- Just a command in a separate shell that sends
> the file after I have sent "recv" to eLua.

Can someone please suggest a program for using XMODEM on GNU/Linux?

Best,
Raman

Links:

[1]: http://www.ayera.com/teraterm/




--
View this message in context: http://elua-development.2368040.n2.nabble.com/Proper-use-of-sx-tp7578110p7578111.html
Sent from the eLua Development mailing list archive at Nabble.com.
_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev



--
Patrick Barrett  //  E X O S I T E  //  Minneapolis, MN  //  www.exosite.com

_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
Richard Möhn Richard Möhn
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Proper use of sx

On Wed, Aug 07, 2013 at 08:26:58AM -0500, Patrick Barrett wrote:
> I've had success using:
>
> sx -bl 32 config.lua
>
> Best of Luck

Thanks for your responses, Raman and Patrick. sx sends 128 byte packets
as I understand it and the above version of sx doesn't work either. (My
fault, probably, but I don't know what I'm doing wrong.) I have even
experimented with TeraTerm on wine, but that's worse.

Next I'll be trying TeraTerm on a Windows machine and then, possibly,
write my own program for sending. Or is there a better way still?

Best,

Richard
_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
Martin Guy Martin Guy
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Proper use of sx

In reply to this post by Patrick
On 7 August 2013 21:24, Richard Möhn <[hidden email]> wrote:

> On Wed, Aug 07, 2013 at 08:26:58AM -0500, Patrick Barrett wrote:
>> I've had success using:
>>
>> sx -bl 32 config.lua
>>
>> Best of Luck
>
> Thanks for your responses, Raman and Patrick. sx sends 128 byte packets
> as I understand it and the above version of sx doesn't work either. (My
> fault, probably, but I don't know what I'm doing wrong.) I have even
> experimented with TeraTerm on wine, but that's worse.
>
> Next I'll be trying TeraTerm on a Windows machine and then, possibly,
> write my own program for sending. Or is there a better way still?

It also depends on the elua end, since there are several flavours of
XMODEM protocol.

While working on our 120KB flash image, where there is no space for
the shell, I wrote an xmodem receiver in Lua that works the same way
as the build-in shell one. It's small, so implements the barest subset
of XMODEM. In my tests (with minicom on Linux as the host end) it
transferred data faster than the built-in elua xmodem written in C,
probably due to better luck with protocol timing windows.  You could
give it a try and see if it and your Windows box like each other
better.
  Usage is to put it in "recv.lua" on the embedded board (on SD card
or in the ROMFS), then say
    require "recv"
  to the Lua prompt.  You can they use it the same as the "recv"
builtin, to store the data in a file or to put it in RAM and run it
directly.

https://github.com/martinwguy/elua-tools

Enjoy :)

   <
_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
Loading...