View Single Post
Old January 12th, 2013   #2
Join Date: Feb 2006
Posts: 429
Send a message via AIM to sblair Send a message via MSN to sblair

There is not a standard method for doing this as there are a lot of factors that vary from one architecture to another that have made creating a standardized method difficult.

There are many people that have implemented this using manufacturer-specific PIDs in RDM. There may be some other folks on here that can share their method of doing it.

Here's a basic process in general though.

You need a PID to PREPARE_FOR_CODE. This PID will tell the target device to erase it's flash or whatever it may need to do to expect a file transfer to occur.

You then need 1 or more PID's to handle block transfer of your data. You basically split your file transfer up into whatever block size is convienent for your device within the payload constraints allowed by RDM. Generally you will want a field to indicate what the Block # or address is in the packet along with the data. After sending the block it is generally a good idea to send a command to verify the Block was correctly received or allow the device to respond with a request to resend the block. This way you know that blocks of data are not getting lost and the device can indicate a failure has occurred.

An Upload Complete PID. This PID is used to indicate that you have completed the transfer and for the device to complete the programming process. It is also a good idea in this packet to include a robust checksum, like a CRC, of the code you have uploaded that the device can then verify whether the upload was valid or whether errors occurred in the transfer.

Hope this helps. Feel free to ask more questions as needed.

Scott M. Blair
RDM Protocol Forums Admin
sblair is offline   Reply With Quote