It looks like you're reading in two bytes after the 128 databytes. I believe you only need to read in 1 (the checksum), if you're using standard xmodem. There's a second form of Xmodem (Xmodem CRC, I believe) that uses 2 bytes for checksum. Also, i'd recommend doing yourself a favor, and implementing the whole protocol. Keep track of and check your block numbers and their complement, and calculate the checksum and verify it. Nack packets that don't add up. If you are doing any kind of serious work, you'll be sorry if you don't. I implemented an Xmodem receiver myself here: This is in the field, and seems to work good. It uses the oldest, 8 bit checksum. After looking into this a bit further, it seems it's the NULL character that's causing the PIC to screw up somehow. I compared what was coming out of the EEPROM with a display of the file as ints on a PC, and whenever the PIC stops writing to the EEPROM, there's an 0 in the display of ints on the PC (i.e. Just to confirm this, I made a program to create a text file containing chars 255-0 in reverse order just so I knew when a NULL should be occuring, and, sure enough, as soon as a NULL occurs, it all goes wrong. The 128 byte packet it receives from the PC is written into 2 64 byte strings purely for memory reasons (the compiler claims to have run out of memory when I declare a single 128 byte one). It would appear that the PIC gets a null, freaks out, then doesn't write anything to the string for the remainder of the 64 bytes, then gets to the next string, writes fine until it gets another NULL, doesn't write anything for the rest of that string, then because both strings are half empty, when it comes to write them to the EEPROM, only the data in the EEPROM that 'lines up' with the data in the strings gets overwritten, the rest stays as it is, explaining why old data gets displayed. Lightroom for mac free trial. Your free trial starts the day you install Lightroom and lasts for seven days. You can convert your trial to a paid Creative Cloud membership during the trial period or after the trial has No, this free trial is available only for desktop. Adobe does offer a collection of free mobile apps for both iOS and Android. The question now is, why does the PIC freak out when it gets a NULL, and how do I get round it? The wikipedia article on XMODEM indicates that CAN (cancel) was not used in XMODEM and goes on to explain that use of CAN and many other suggestions were rejected by the original author Ward Christensen. This resulting in a plethora of incompatible 'improved' protocols. Searching around I find the original and proper XMODEM is described in chapter 7 of the attached document (by the author of YMODEM) and it states 'the use of CAN was never adopted as a standard' Chapter 4 describes use of a double CAN as an enhancement other enhancements being 16 bit CRCs etc etc. I have to send a file via serial port to my program that is running on an embedded device using HyperTerminal and XMODEM protocol. The serial communication is OK (9600 baud, 1 StopBit, No parity, 8 data bits, no flow control), because both sending commands and receiving answers work properly. Firmware Upgrading a SecureStack via TFTP or XModem Helpful? Code transfer completed successfully. Downloading to a Standalone unit, via the Serial Port (XModem) A serial download is a viable alternative to TFTP. Be ready for thousands of support calls as people try out XMODEM for the Prop with all kinds of incompatible software[noparse]:)[/noparse] ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ For me, the past is not over yet.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |