12.5.3.1 ISD Protocol
Zigbee server communicates with the PC Tools using ISD protocol
Following figure shows a typical Zigbee Network where a Zigbee Server is connected to network with multiple client nodes. Zigbee server is connected to PC Tool (MicrochipUtilityTool.exe) through serial port. OTA enabled Zigbee Server communicates with the PC Tool through ISD (Internal Storage Driver) protocols.
PC Tool sends entire image (*.zigbee) through ISD packet by ISD packet to OTA server and OTA server routes the packet to client node.
ISD Packet Format
PC Tool communicates with Zigbee Servers through ISD protocol. ISD frame format is common to both transmit to/and receive from Zigbee server. Details are given below.
ISD Frame Format | |||||
Byte 0 | Byte 1 | Byte 2 | Byte 3 | Byte 4 | Byte 5….n |
SOF | Length | ISD Command ID | ISD Payload |
SOF (1 Byte): Start of frame = 0x2A (ASCII ‘*’). This is mandatory for all Tx/Rx packets.
Length (2 Byte): ISD Command ID Length + ISD Payload Length. Total packet length exclude SOF(1 byte) and Length(2 byte)= Packet Length - 3
ISD Command ID (2 Byte): There are 4 types of commands between PC Tool and Zigbee server device
ISD_DRIVER_INIT_REQUEST 0x0100 (From Zigbee Server to PC)
ISD_DRIVER_INIT_RESPONSE 0x0101 (From PC to Zigbee Server)
ISD_ZCL_COMMAND_REQUEST 0x0044 (From PC to Zigbee Server)
ISD_ZCL_COMMAND_INDICATION 0x0046 (From Zigbee Server to PC)
ISD Payload (N-5 Byte):
ISD Payload is Zigbee Cluster Command (ZCL) and have following structure(ZCL Command ID + ZCL Payload)
ISD Payload | |
---|---|
ZCL Command ID | ZCL Payload |
ZCL Command
Here are details of ZCL Command ID
ZCL Commands |
ID |
Direction |
---|---|---|
Query Next Image Request | 0x01 | From Zigbee OTA server to PC Tool |
Query Next Image Response | 0x02 | From PC Tool to Zigbee OTA server |
Image Block Request | 0x03 | From Zigbee OTA server to PC Tool |
Image Block Response | 0x05 | From PC Tool to Zigbee OTA server |
Upgrade End Request | 0x06 | From Zigbee OTA server to PC Tool |
Upgrade End Response | 0x07 | From PC Tool to Zigbee OTA server |
ZCL Payload (RX): Received by PC
Field |
Size (bytes) |
Comment |
---|---|---|
Address mode | 1 | Standard addressing information that is used to identify the client to which the response is addressed |
Short address | 2 | |
Extended address | 8 | |
Profile ID | 2 | |
Endpoint | 1 | |
Source Cluster ID | 2 | |
Cluster ID | 2 | |
Direction | 1 | Being set to 1, indicates that the default response should be sent |
Command ID | 1 | May have one of the following values: QUERY_NEXT_IMAGE_REQUEST_ID(1) IMAGE_BLOCK_REQUEST_ID(3) UPGRADE_END_REQUEST_ID(6) (defined in the zclOTAUCluster.h file) |
Payload | Up to 16 bytes | Control field (1 Byte), Manufacture ID (2 Bytes), Image Type (2 Bytes), File Version (4 Bytes), File Offset (4 Bytes), Max Packet Size (1 Byte), Block Request Delay (2 Bytes) |
ZCL Payload (TX): Sent by PC
Field |
Size (bytes) |
Comment |
---|---|---|
Address mode | 1 | Standard addressing information that is used to identify the client to which the response is addressed |
Short address | 2 | |
Extended address | 8 | |
Profile ID | 2 | |
Endpoint | 1 | |
Source Cluster ID | 2 | |
Cluster ID | 2 | |
Direction | 1 | Being set to 1, indicates that the default response should be sent |
Command ID | 1 | May have one of the following values: QUERY_NEXT_IMAGE_Response_ID(2) IMAGE_BLOCK_Response_ID(5) UPGRADE_END_Response_ID(7) (defined in the zclOTAUCluster.h file) |
Payload | Depends on command | May be cast to one of the following types depending on the command ID: ZCL_OtauQueryNextImageResp_t ZCL_OtauImageBlockResp_t ZCL_OtauUpgradeEndResp_t |
Protocol
Details of data exchanged between PC Tool and Zigbee Server are given below.
From Zigbee OTA Server to PC Tool |
From PC Tool to Zigbee OTA Server | |
---|---|---|
Step 1 | Keep sending ISD_DRIVER_INIT_REQUEST command with Init marker to PC Tool | |
Step 2 | Sends ISD_DRIVER_INIT_RESPONSE with Init marker | |
Step 3 | Sends ISD_ZCL_COMMAND_INDICATION with "Query Next Image Request" | |
Step 4 | Sends ISD_ZCL_COMMAND_REQUEST with Query Next Image Response | |
Step 5 | Sends ISD_ZCL_COMMAND_INDICATION with "Image Block Request" with appropriate Image offset and length | |
Step 6 | Sends ISD_ZCL_COMMAND_REQUEST with "Image Block Response" with corresponding Image payload | |
Continue Step 5 | Continue step 6 for every step 5 request | |
Step N | Sends ISD_ZCL_COMMAND_INDICATION with "Upgrade End Request" | |
Step N+1 | Sends ISD_ZCL_COMMAND_REQUEST with "Upgrade End Response" |
Zigbee OTA server keeps sending ISD_DRIVER_INIT_REQUEST. This command is sent to PC tool after Zigbee Server node is connected to a Zigbee networks. ISD_ZCL_COMMAND_INDICATION has three ZCL Commands and ISD_ZCL_COMMAND_REQUEST (Query Next Image Request, Image Block Response, Upgrade End Response) has three ZCL commands (Query Next Image Response, Image Block Response, Upgrade End Response)
Packet Details
Following types of packets are received/sent from/to Zigbee OTA server.
ISD_DRIVER_INIT_REQUEST command: 2A 03 00 01 00 55
2A: SOF
03 00: Frame Length
01 00: ISD_DRIVER_INIT_REQUEST
55(ASCII “U”): init marker
Direction: From Zigbee OTA Server to PC
ISD_DRIVER_INIT_RESPONSE: 2A 03 00 01 01 55
2A: SOF
03 00: Frame Length
01 01: ISD_DRIVER_INIT_RESPONSE
55(ASCII “U”): init marker
Direction: PC to Zigbee OTA Server
ISD_ZCL_COMMAND_INDICATION
This command is sent from Zigbee OTA server to PC Tool and has following three ZCL commands
Query Next Image Request
Here is typical ZCL Command indication packet which is sent periodically from the Zigbee server after Driver Init Response has been sent from the PC.
Query Image Request | |||
Bytes | Typical Value | Description | Bytes |
0 | 2A | SOF | 1 |
1 | 1F | PKT LEN | 2 |
2 | 0 | PKT LEN | |
3 | 46 | ZCL Command Indication | 2 |
4 | 0 | ZCL Command Indication | |
5 | 2 | Address Mode | 1 |
6 | A0 | Sort Address | 2 |
7 | 50 | Sort Address | |
8 | 11 | Extended Address Mode | 8 |
9 | 0 | Extended Address Mode | |
10 | 0 | Extended Address Mode | |
11 | 0 | Extended Address Mode | |
12 | 0 | Extended Address Mode | |
13 | 0 | Extended Address Mode | |
14 | 0 | Extended Address Mode | |
15 | 0 | Extended Address Mode | |
16 | 4 | Profile ID | 2 |
17 | 1 | Profile ID | |
18 | 23 | End Point | 1 |
19 | 19 | SRC Cluster ID | 2 |
20 | 0 | SRC Cluster ID | |
21 | 19 | Cluster ID | 2 |
22 | 0 | Cluster ID | |
23 | 0 | Direction | 1 |
24 | 1 | Query Next Image Request | 1 |
25 | 0 | Control Field | 1 |
26 | 14 | Manufacture ID | 2 |
27 | 10 | Manufacture ID | |
28 | FF | Image Type | 2 |
29 | FF | Image Type | |
30 | 0 | Fi rmware Version | 4 |
31 | 7 | Fi rmware Version | |
32 | 3 | Fi rmware Version | |
33 | 50 | Fi rmware Version |
Image Block Request
Image Block Request | |||
Bytes | Typical Value | Description | Bytes |
0 | 2A | SOF | 1 |
1 | 26 | PKT LEN | 2 |
2 | 0 | PKT LEN | |
3 | 46 | ZCL Command Indication | 2 |
4 | 0 | ZCL Command Indication | |
5 | 2 | Address Mode | 1 |
6 | A0 | Sort Address | 2 |
7 | 50 | Sort Address | |
8 | 11 | Extended Address Mode | 8 |
9 | 0 | Extended Address Mode | |
10 | 0 | Extended Address Mode | |
11 | 0 | Extended Address Mode | |
12 | 0 | Extended Address Mode | |
13 | 0 | Extended Address Mode | |
14 | 0 | Extended Address Mode | |
15 | 0 | Extended Address Mode | |
16 | 4 | Profile ID | 2 |
17 | 1 | Profile ID | |
18 | 23 | End Point | 1 |
19 | 19 | SRC Cluster ID | 2 |
20 | 0 | SRC Cluster ID | |
21 | 19 | Cluster ID | 2 |
22 | 0 | Cluster ID | |
23 | 0 | Direction | 1 |
24 | 3 | Image Block Request | 1 |
25 | 2 | controlField | 1 |
26 | 14 | Manufacture ID | 2 |
27 | 10 | Manufacture ID | |
28 | FF | Image Type | 2 |
29 | FF | Image Type | |
30 | 0 | Fi rmware Version | 4 |
31 | 7 | Fi rmware Version | |
32 | 3 | Fi rmware Version | |
33 | 50 | Fi rmware Version | |
34 | xx | File Offset | 4 |
35 | xx | File Offset | |
36 | xx | File Offset | |
37 | xx | File Offset | |
38 | 30 | Max Pkt Size | 1 |
39 | E8 | Block RequestDelay | 2 |
40 | 3 | Block RequestDelay |
Upgrade End Request
Last Packet Request | |||
Bytes | Typical Value | Description | Bytes |
0 | 2A | SOF | 1 |
1 | 1F | PKT LEN | 2 |
2 | 0 | PKT LEN | |
3 | 46 | ZCL Command Indication | 2 |
4 | 0 | ZCL Command Indication | |
5 | 2 | Address Mode | 1 |
6 | A0 | Sort Address | 2 |
7 | 50 | Sort Address | |
8 | 11 | Extended Address Mode | 8 |
9 | 0 | Extended Address Mode | |
10 | 0 | Extended Address Mode | |
11 | 0 | Extended Address Mode | |
12 | 0 | Extended Address Mode | |
13 | 0 | Extended Address Mode | |
14 | 0 | Extended Address Mode | |
15 | 0 | Extended Address Mode | |
16 | 4 | Profile ID | 2 |
17 | 1 | Profile ID | |
18 | 23 | End Point | 1 |
19 | 19 | SRC Cluster ID | 2 |
20 | 0 | SRC Cluster ID | |
21 | 19 | Cluster ID | 2 |
22 | 0 | Cluster ID | |
23 | 0 | Direction | 1 |
24 | 6 | Upgrade End Request | 1 |
25 | 0 | Status | 1 |
26 | 14 | Manufacture ID | 2 |
27 | 10 | Manufacture ID | |
28 | FF | Image Type | 2 |
29 | FF | Image Type | |
30 | 0 | Firmware Version | 4 |
31 | 7 | Firmware Version | |
32 | 3 | Firmware Version | |
33 | 50 | Firmware Version |
ISD_ZCL_COMMAND_REQUEST
This command is sent from PC Tool to Zigbee Server and has following three ZCL Command.
Query Next Image Response with status 98
PC Tool sends the following response. Status 98 shows the PC is still not ready for OTA.
Query Image Response | |||
Bytes | Typical Value | Description | Bytes |
0 | 2A | SOF | 1 |
1 | 17 | PKT LEN | 2 |
2 | 0 | PKT LEN | |
3 | 44 | ZCL COMMAND REQUEST | 2 |
4 | 0 | ZCL COMMAND REQUEST | |
5 | 2 | Address Mode | 1 |
6 | A0 | Sort Address | 2 |
7 | 50 | Sort Address | |
8 | 11 | Extended Address Mode | 8 |
9 | 0 | Extended Address Mode | |
10 | 0 | Extended Address Mode | |
11 | 0 | Extended Address Mode | |
12 | 0 | Extended Address Mode | |
13 | 0 | Extended Address Mode | |
14 | 0 | Extended Address Mode | |
15 | 0 | Extended Address Mode | |
16 | 4 | Profile ID | 2 |
17 | 1 | Profile ID | |
18 | 23 | End Point | 1 |
19 | 23 | Destination End Point | 1 |
20 | 19 | Cluster ID | 2 |
21 | 0 | Cluster ID | |
22 | 0 | Default Resp | 1 |
23 | 0 | Command Options | 1 |
24 | 2 | Query Next Image Response | 1 |
25 | 98 | Status | 1 |
Query Next Image Response to Start OTA
In case PC Tool is ready for OTA operation (*.zigbee file has been selected by the Tool and Zigbee Update Button has been pressed), status is set to 0 and the following response is sent.
Query Next Image Response with Data | |||
Bytes | Typical Value | Description | Bytes |
0 | 2A | SOF | 1 |
1 | 23 | PKT LEN | 2 |
2 | 0 | PKT LEN | |
3 | 44 | ZCL COMMAND REQUEST | 2 |
4 | 0 | ZCL COMMAND REQUEST | |
5 | 2 | Address Mode | 1 |
6 | A0 | Sort Address | 2 |
7 | 50 | Sort Address | |
8 | 11 | Extended Address Mode | 8 |
9 | 0 | Extended Address Mode | |
10 | 0 | Extended Address Mode | |
11 | 0 | Extended Address Mode | |
12 | 0 | Extended Address Mode | |
13 | 0 | Extended Address Mode | |
14 | 0 | Extended Address Mode | |
15 | 0 | Extended Address Mode | |
16 | 4 | Profile ID | 2 |
17 | 1 | Profile ID | |
18 | 23 | End Point | 1 |
19 | 23 | Destination End Point | 1 |
20 | 19 | Cluster ID | 2 |
21 | 0 | Cluster ID | |
22 | 0 | defaultResp | 1 |
23 | 0 | Command Options | 1 |
24 | 2 | Query Next Image Response | 1 |
25 | 0 | Status | 1 |
26 | 14 | Manufacture ID | 2 |
27 | 10 | Manufacture ID | |
28 | ff | Image Type | 2 |
29 | ff | Image Type | |
30 | 1 | Firmware Version | 4 |
31 | 7 | Firmware Version | |
32 | 3 | Firmware Version | |
33 | 50 | Firmware Version | |
34 | 38 | Image Length | 4 |
35 | b9 | Image Length | |
36 | b4 | Image Length | |
37 | 0 | Image Length |
Image Block Response
Image Block Response | |||
Bytes | Typical Value | Description | Bytes |
0 | 2A | SOF | 1 |
1 | 54 | PKT LEN | 2 |
2 | 0 | PKT LEN | |
3 | 44 | ZCL COMMAND REQUEST | 2 |
4 | 0 | ZCL COMMAND REQUEST | |
5 | 2 | Address Mode | 1 |
6 | A0 | Sort Address | 2 |
7 | 50 | Sort Address | |
8 | 11 | Extended Address Mode | 8 |
9 | 0 | Extended Address Mode | |
10 | 0 | Extended Address Mode | |
11 | 0 | Extended Address Mode | |
12 | 0 | Extended Address Mode | |
13 | 0 | Extended Address Mode | |
14 | 0 | Extended Address Mode | |
15 | 0 | Extended Address Mode | |
16 | 4 | Profile ID | 2 |
17 | 1 | Profile ID | |
18 | 23 | End Point | 1 |
19 | 23 | Destination End Point | 1 |
20 | 19 | Cluster ID | 2 |
21 | 0 | Cluster ID | |
22 | 0 | Default Resp | 1 |
23 | 0 | Command Options | 1 |
24 | 5 | Image Block Response | 1 |
25 | 0 | Status | 1 |
26 | 14 | Manufacture ID | 2 |
27 | 10 | Manufacture ID | |
28 | ff | Image Type | 2 |
29 | ff | Image Type | |
30 | 1 | Firmware Version | 4 |
31 | 7 | Firmware Version | |
32 | 3 | Firmware Version | |
33 | 50 | Firmware Version | |
34 | 38 | File Offset | 4 |
35 | b9 | File Offset | |
36 | b4 | File Offset | |
37 | 0 | Image Length | |
38 | 30 | Frame Size | 1 |
39-xx | yy-yy | Payload | <=48 |
Upgrade End Response
Last Packet Response | |||
Bytes | Typical Value | Description | Bytes |
0 | 2A | SOF | 1 |
1 | 26 | PKT LEN | 2 |
2 | 0 | PKT LEN | |
3 | 44 | ZCL COMMAND REQUEST | 2 |
4 | 0 | ZCL COMMAND REQUEST | |
5 | 2 | Address Mode | 1 |
6 | A0 | Sort Address | 2 |
7 | 50 | Sort Address | |
8 | 11 | Extended Address Mode | 8 |
9 | 0 | Extended Address Mode | |
10 | 0 | Extended Address Mode | |
11 | 0 | Extended Address Mode | |
12 | 0 | Extended Address Mode | |
13 | 0 | Extended Address Mode | |
14 | 0 | Extended Address Mode | |
15 | 0 | Extended Address Mode | |
16 | 4 | Profile ID | 2 |
17 | 1 | Profile ID | |
18 | 23 | End Point | 1 |
19 | 23 | Destination End Point | 1 |
20 | 19 | Cluster ID | 2 |
21 | 0 | Cluster ID | |
22 | 0 | Default Resp | 1 |
23 | 0 | Command Options | 1 |
24 | 7 | Upgrade End Response | 1 |
25 | 14 | Manufacture ID | 2 |
26 | 10 | Manufacture ID | |
27 | ff | Image Type | 2 |
28 | ff | Image Type | |
20 | 1 | Firmware Version | 4 |
30 | 7 | Firmware Version | |
31 | 3 | Firmware Version | |
32 | 50 | Firmware Version | |
33 | xx | Time to Reboot | 8 |
34 | xx | Time to Reboot | |
35 | xx | Time to Reboot | |
36 | xx | Time to Reboot | |
37 | xx | Time to Reboot | |
38 | xx | Time to Reboot | |
39 | xx | Time to Reboot | |
40 | xx | Time to Reboot |