We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
What is the best protocol to use to send a file thru RS232. It is gonna be a 256Kbyte of data.
"Yes, I have mentioned the industrial z-modem somewhere before" Sorry, my question was directed to Tommy Kwan! "HEX format is cool for sending firmware updates" I get the impression that this is what he's trying to do! So come on Tommy - spill the beans!
I can send either a raw binary file, raw hex file (separated by comma), or intel format hexadecimal file. The whole point of this project is the file is sent thru RS232 for remote programming of another chip. Speed is not an issue just as long as it is under a few minutes. Most importantly, the data, about 256kbytes, that I recieved will be simultaneously programmed into an EEPROM. I like to say thank you for all the help from all of you!
Depending on how fast the EEPROM can be programmed, and how fast the incoming data is, you will probably need some kind of handshake to allow time for the programming to complete, or to handle error cases. You will also need a buffer large enough on the receiving end to store the data to be programmed.
The incoming data is much slower than the speed I am writing to the EEPROM. Therefore, whenever there is an incoming data, I will write straight to EEPROM.
Tommy, as you say that speed is not a problem, my personal inclination would be to keep things as simple and convenient as possible. Go for Intel format and start with a prototype version that simply ignores all those checksums. Get things working and add the bells and whistles that experience (and common sense) tells you are necessary. If you really want to keep things simple, consider having a write command and a verify command. In the case of a verify, the file is downloaded again, and the receiver simply checks that the data is identical to that received previously. This will save you from having to worry about checksums, CRCs etc. If you are actually downloading code that ends up getting executed, the code could include its own CRC check - which is not a bad idea anyway.