1、 ANSI/CTA Standard Modular Communications Interface for Firmware Transfer Message Set ANSI/CTA-2045.1 (Formerly ANSI/CEA-2045.1) July 2014 NOTICE Consumer Technology Association (CTA) Standards, Bulletins and other technical publications are designed to serve the public interest through eliminating
2、misunderstandings between manufacturers and purchasers, facilitating interchangeability and improvement of products, and assisting the purchaser in selecting and obtaining with minimum delay the proper product for his particular need. Existence of such Standards, Bulletins and other technical public
3、ations shall not in any respect preclude any member or nonmember of the Consumer Technology Association from manufacturing or selling products not conforming to such Standards, Bulletins or other technical publications, nor shall the existence of such Standards, Bulletins and other technical publica
4、tions preclude their voluntary use by those other than Consumer Technology Association members, whether the standard is to be used either domestically or internationally. Standards, Bulletins and other technical publications are adopted by the Consumer Technology Association in accordance with the A
5、merican National Standards Institute (ANSI) patent policy. By such action, the Consumer Technology Association does not assume any liability to any patent owner, nor does it assume any obligation whatever to parties adopting the Standard, Bulletin or other technical publication. This document does n
6、ot purport to address all safety problems associated with its use or all applicable regulatory requirements. It is the responsibility of the user of this document to establish appropriate safety and health practices and to determine the applicability of regulatory limitations before its use. This do
7、cument is copyrighted by the Consumer Technology Association and may not be reproduced, in whole or part, without written permission. Federal copyright law prohibits unauthorized reproduction of this document by any means. Organizations may obtain permission to reproduce a limited number of copies b
8、y entering into a license agreement. Requests to reproduce text, data, charts, figures or other material should be made to the Consumer Technology Association. (Formulated under the cognizance of the CTA R7.8 Modular Communication Interface for Energy Management Subcommittee.) Published by CONSUMER
9、TECHNOLOGY ASSOCIATION 2015 Technology Phone 800-699-9277; Fax 734-780-2046; Internet http:/; Email 2.2 Compliance Notation As used in this document “shall” and “must” denote mandatory provisions of the standard. “Should” denotes a provision that is recommended but not mandatory. “May” denotes a fe
10、ature whose presence does not preclude compliance, and implementation of which is optional. “Optional” denotes items that may or may not be present in a compliant device. 2.3 Definitions and Abbreviations Big-Endian Specifies that the transmission byte order of a data stream is MSB first CRC CRC-16-
11、CCITT using the x16+ x12+ x5+ 1 polynomial with a starting value of zero LSB Least Significant Byte e.g. for the value 0x12345678, 0x78 is the LSB LSN Bits 23through 20e.g. the LSN of 0xAB is 0xB MSB Most Significant Byte e.g. for the value 0x12345678, 0x12 is the MSB 1 MSN Bits 27through 24e.g. the
12、 MSN of 0xAB is 0xA Nibble Four bit value obtained by dividing a byte in half OTAP Over-the-Air Programming SGD Smart Grid Device the end device that is being informed of grid conditions SINT8 Eight-bit signed value (ones compliment) SINT16 16-bit signed value (ones compliment) UCM Universal Communi
13、cations Module the communications device that provides communication connectivity to an SGD UINT8 Eight-bit unsigned value UINT16 16-bit unsigned value UINT32 32-bit unsigned value 3 Message Set The Firmware Download message set is an extension of the ANSI/CEA-2045 Intermediate DR message set (Messa
14、ge Type = 0x08, 0x02). Unlike the Basic DR Application message set, which is fixed at 8 bytes total message length, Intermediate DR application messages have variable lengths. Some message definitions include Null terminated strings which causes the length of the packet to be content specific. Prior
15、 to sending any of the messages defined in this specification, the device must negotiate the maximum payload size using the “Query: Maximum payload length?“ and “Response: Maximum payload length“ messages defined in Section 6 of ANSI/CEA-2045. ANSI/CEA-2045 prohibits transfer of serial messages that
16、 would overflow buffers of the recipient. Intermediate DR commands are all optional, however if the device supports the Firmware Transfer message set, all messages in this specification shall be fully supported. Where the terms “optional” and “mandatory” are used in the tables in this section, they
17、refer only to the requirement for those fields within the message being described. Where multiple fields are labeled as “optional”, the sender must include all elements up to the last “optional” value transmitted. 3.1 Firmware Download The messages in this section are used to transfer a firmware ima
18、ge from the UCM to the SGD to reprogram the SGD. 3.1.1 Current Image Parameters This command is used to retrieve the current image parameters from the SGD. 2 Parameters Image Size: size of the image in bytes, UINT32. Image CRC: CRC value for the image, UINT16. Version String: version label for the i
19、mage, Null terminated string. Revision String: revision label for the image, Null terminated string. Build String: build label for the image, Null terminated string. SGD Get: Not Applicable SGD Set: Not Applicable UCM Get: SGD responds UCM Set: SGD responds 3.1.1.1 Get Firmware Version Request Paylo
20、ad Byte Value Comments Mandatory/Optional 1 0x09 OpCode1 M 2 0x00 OpCode2 M 3.1.1.2 Get Firmware Version Response Payload Byte Value Comments Mandatory/Optional 1 0x09 OpCode1 M 2 0x80 OpCode2 M 3 Response Code M 4-7 Image Size M 8-9 Image CRC M 10-? Version String (Null Terminated) M ?-? Revision S
21、tring (Null Terminated) M ?-? Build String (Null Terminated) M Set Firmware Version Request: Not Applicable Set Firmware Version Response: Not Applicable 3.1.2 OTAP Action This command is used to cause an action in the SGD. The actions may take longer than the ANSI/CEA-2045 maximum response delay al
22、lows. When the action is completed, the SGD will send the OTAP status command to notify the UCM of success/failure. 3 Parameters Action, UINT8. Value Action Comment 0 Prepare for OTAP Prepair Flash area for reception of new image. 1 Validate Image Validate the received image 2 Load Image Load the re
23、ceived image Image Size: the size of the image that will be sent. Only sent in the Prepare for OTAP message, UINT32. SGD Get: Not Applicable SGD Set: Not Applicable UCM Get: SGD responds UCM Set: SGD responds Get OTAP Action Request: Not Applicable Get OTAP Action Response: Not Applicable 3.1.2.1 Se
24、t OTAP Action Request Payload Byte Value Comments Mandatory/Optional 1 0x09 OpCode1 M 2 0x01 OpCode2 M 3 Action M 4-7 Image Size (bytes) O 3.1.2.2 Set OTAP Action Response Payload Byte Value Comments Mandatory/Optional 1 0x09 OpCode1 M 2 0x81 OpCode2 M 3 Response Code M 3.1.3 OTAP Status This messag
25、e is used to pass the result of an OTAP Action command. 4 Parameters Status, UINT8. Value Action Comment 0 Ready for OTAP Ready to start receiving the OTAP image 1 Image Valid The received image is valid and can be loaded 2 Image Corrupted The image is corrupted 3 Hardware Mismatch The image is not
26、for this device 4 Image Load Completed The image loaded successfully 5 Image Load Failed The image load failed 6 Restart OTAP The SGD has detected an unrecoverable error and is requesting that the OTAP be restarted from the beginning 7 Image Size Error The image size is incorrect. Only applicable to
27、 the Prepare for OTAP response. 8 Other Error Failure Info: Additional failure information, UINT16. SGD Get: Not Applicable SGD Set: UCM responds UCM Get: Not Applicable UCM Set: Not Applicable Get OTAP Status Request: Not Applicable Get OTAP Status Response: Not Applicable 3.1.3.1 Set OTAP Status R
28、equest Payload Byte Value Comments Mandatory/Optional 1 0x09 OpCode1 M 2 0x02 OpCode2 M 3 Status M 4-5 Failure Info O 3.1.3.2 Set OTAP Status Response Payload Byte Value Comments Mandatory/Optional 1 0x09 OpCode1 M 2 0x82 OpCode2 M 3 Response Code M 5 3.1.4 OTAP Image Transfer This command is used t
29、o transfer the firmware image. Parameters Block Number: the number of the current block. A zero value will indicate the start of a new transfer, UINT16. Image Data: a portion of the new image to transfer. The number of bytes transferred is based on the Data Link Packet Size negotiation. SGD Get: Not
30、 Applicable SGD Set: Not Applicable UCM Get: Not Applicable UCM Set: SGD responds Get Image Transfer Request: Not Applicable Get Image Transfer Response: Not Applicable 3.1.4.1 Set Image Transfer Request Payload Byte Value Comments Mandatory/Optional 1 0x09 OpCode1 M 2 0x03 OpCode2 M 3-4 Block Numbe
31、r M 5? Image Data M 3.1.4.2 Set Image Transfer Response Payload Byte Value Comments Mandatory/Optional 1 0x09 OpCode1 M 2 0x83 OpCode2 M 3 Response Code M 4-5 Block Number M 3.2 Firmware Transfer Sequence Diagrams This section contains diagrams that illustrate the messaging sequences for successful
32、and unsuccessful firmware transfers. 6 UCM SGDStore and Validate FileSet Image Transfer Request 09:03(Block = 0, Data)Set Image Transfer Response 09:83(Response = Success, Block = 0)Set Image Transfer Request 09:03(Block = 1, Data)Set Image Transfer Response 09:83(Response = Success, Block = 1)Set I
33、mage Transfer Request 09:03(Block = n, Data)Set Image Transfer Response 09:83(Response = Success, Block = n)Set OTAP Action Request 09:01(Validate Image)Set OTAP Status Request 09:02(Image Valid)Validate Received ImageSet OTAP Action Request 09:01(Load Image)Set OTAP Action Response 09:81(Response =
34、 Success)Load Image and RestartSet OTAP Status Request 09:02(Image Load Completed)Set OTAP Status Response 09:82(Response = Success)2567910Save DataSave DataSave Data1114Set OTAP Action 09:01(Prepare for OTAp)Set OTAP Action Response 09:81(Response = Success)Set OTAP Status Request 09:02(Ready for O
35、TA)Set OTAP Status Response 09:82(Response = Success)Prepare to receive new imageSet OTAP Action Response 09:81(Response = Success)Set OTAP Status Response 09:82(Response = Success)38Figure 1: Successful Firmware Transfer Sequence Diagram 7 Successful Firmware Transfer Sequence 1. The OTAP file is r
36、eceived and validated by the UCM. 2. The UCM sends the OTAP Action, Prepare for OTAP command to the SGD. The SGD makes preparations for receiving a new image. 3. When the SGD is ready to begin receiving the image, it sends the OTA Status Request, Ready for OTAP to the UCM. 4. The UCM will transfer t
37、he image to the SGD one block at a time. The SGD saves the blocks, assembling the image. 5. After sending the last block to the SGD. 6. The UCM sends the command to have the SGD validate the received file. 7. The SGD validates the received file. 8. After verifying the image, the SGD sends the OTAP S
38、tatus, Image Valid request. 9. After receiving the Image Valid status, the UCM sends the Load Image command. 10. After receiving the Load Image command, The SGD reprograms its micro and restarts. 11. The SGD sends the Load Image Completed message. 8 UCM SGDStore and Validate FileSet Image Transfer R
39、equest 09:03(Block = 0, Data)Set Image Transfer Response 09:83(Response = Success, Block = 0)Set Image Transfer Request 09:03(Block = 1, Data)Set Image Transfer Response 09:83(Response = Success, Block = 1)OTAP Status Request 09:02(Restart OTA)OTAP Status Response 09:82(Response = Success256Save Dat
40、aSave DataSave Data14Set OTAP Action 09:01(Prepare for OTA)Set OTAP Action Response 09:81(Response = Success)Set OTAP Status Request 09:02(Ready for OTA)Set OTAP Status Response 09:82(Response = Success)Prepare to receive new image3Set Image Transfer Request 09:03(Block = 0, Data)Set Image Transfer
41、Response 09:83(Response = Success, Block = 0)Set Image Transfer Request 09:03(Block = 1, Data)Set Image Transfer Response 09:83(Response = Success, Block = 1)Save DataSet OTAP Action 09:01(Prepare for OTA)Set OTAP Action Response 09:81(Response = Success)Set OTAP Status Request 09:02(Ready for OTA)S
42、et OTAP Status Response 09:82(Response = Success)Prepare to receive new imageFigure 2: Restart Firmware Transfer Sequence Diagram 9 Restart Firmware Transfer Sequence 1. The OTA file is received and validated by the UCM. 2. The UCM sends the OTA Action, Prepare for OTA command to the SGD. The SGD ma
43、kes preparations for receiving a new image. 3. When the SGD is ready to begin receiving the image, it sends the OTA Status Request, Ready for OTA to the UCM. 4. The UCM will transfer the image to the SGD one block at a time. The SGD saves the blocks, assembling the image. 5. The SGD detects an unrec
44、overable error and sends the Restart OTA Status Request. 6. The UCM restarts the OTA process from the beginning. 10 Consumer Technology Association Document Improvement Proposal If in the review or use of this document a potential change is made evident for safety, health or technical reasons, please email your reason/rationale for the recommended change to standardsce.org. Consumer Technology Association Technology & Standards Department 1919 S Eads Street, Arlington, VA 22202 FAX: (703) 907-7693 standardsce.org