Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 07:26 26 Apr 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : XMODEM implementation that doesn't error out (MMBasic v4.5)

Author Message
flasherror
Senior Member

Joined: 07/01/2019
Location: United States
Posts: 159
Posted: 02:15am 27 May 2020
Copy link to clipboard 
Print this post

Not sure if this has been a problem for anyone else:

I'm using Olimex's Duinomite Mega board with v4.5 firmware

I want to be able to transfer a log file on the SD card under program control (to PC) programmatically and be able to recover from any possible outcome (timeout etc)

However even though are XMODEM RECEIVE / XMODEM SEND commands which seem like what I need, the manual says "The transfer can take up to 15 seconds to start and if the XMODEM command fails to establish communications it will return to the MMBasic prompt after 60 seconds"

If this is correct this means I cannot guarantee that my program will not abort due to timeout. (If so this behavior is not ideal for program control)

So do I:
1. Write my own implementation of XMODEM / YMODEM? (assuming I have memory for it). YMODEM would actually be better, since it sends the filename.
2. Use someone else's implementation (let me know if there is shared code anywhere). I see there is Xmodem CRC code at http://fruitoftheshed.com/MMBasic.Xmodem-CRC.ashx but I don't see a complete implementation.

How do you deal with transferring data under program control to PC?

By the way, does newer v5 MMBasic have the same "abort to prompt" XMODEM issue?
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5900
Posted: 03:31am 27 May 2020
Copy link to clipboard 
Print this post

XMODEM is simple enough if you stick to 128 bytes and Checksum instead of CRC.

The later versions of MMBasic 'might' be OK using 'ON ERROR SKIP nn' but it is not something I would like to do.

What you do will depend on what you have at the PC end.
If you initiate the send sequence from the PC , the 60 second timeout is very long.

For unattended data transfers, I use simple PRINT statements and checksums.
Depending o the data, I will implement some sort of resend ability.

Jim
VK7JH
MMedit   MMBasic Help
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024