Difference between revisions of "Bootload CAN Communication Protocol"

From OpenMotics
Jump to navigation Jump to search
 
(5 intermediate revisions by 2 users not shown)
Line 9: Line 9:
 
! width="5%"|Byte5
 
! width="5%"|Byte5
 
! width="5%"|Byte6
 
! width="5%"|Byte6
! width="5%"|Byte6
+
! width="5%"|Byte7
 
!Description
 
!Description
 
|-
 
|-
Line 16: Line 16:
 
|<div align="center">0</div>
 
|<div align="center">0</div>
 
|<div align="center">94</div>
 
|<div align="center">94</div>
 +
|<div align="center">ID.Byte2</div>
 +
|<div align="center">ID.Byte1</div>
 
|<div align="center">ID.Byte0</div>
 
|<div align="center">ID.Byte0</div>
|<div align="center">ID.Byte1</div>
 
|<div align="center">ID.Byte2</div>
 
 
|<div align="center">Checksum</div>
 
|<div align="center">Checksum</div>
 
|<div align="center">-</div>
 
|<div align="center">-</div>
Line 28: Line 28:
 
|<div align="center">94</div>
 
|<div align="center">94</div>
 
|<div align="center">94</div>
 
|<div align="center">94</div>
 +
|<div align="center">ID.Byte2</div>
 +
|<div align="center">ID.Byte1</div>
 
|<div align="center">ID.Byte0</div>
 
|<div align="center">ID.Byte0</div>
|<div align="center">ID.Byte1</div>
 
|<div align="center">ID.Byte2</div>
 
 
|<div align="center">AppMode</div>
 
|<div align="center">AppMode</div>
 
|<div align="center">Checksum</div>
 
|<div align="center">Checksum</div>
Line 40: Line 40:
 
|<div align="center">0</div>
 
|<div align="center">0</div>
 
|<div align="center">96</div>
 
|<div align="center">96</div>
 +
|<div align="center">ID.Byte2</div>
 +
|<div align="center">ID.Byte1</div>
 
|<div align="center">ID.Byte0</div>
 
|<div align="center">ID.Byte0</div>
|<div align="center">ID.Byte1</div>
 
|<div align="center">ID.Byte2</div>
 
 
|<div align="center">Ping Message</div>
 
|<div align="center">Ping Message</div>
 
|<div align="center">Checksum</div>
 
|<div align="center">Checksum</div>
Line 52: Line 52:
 
|<div align="center">1</div>
 
|<div align="center">1</div>
 
|<div align="center">96</div>
 
|<div align="center">96</div>
 +
|<div align="center">ID.Byte2</div>
 +
|<div align="center">ID.Byte1</div>
 
|<div align="center">ID.Byte0</div>
 
|<div align="center">ID.Byte0</div>
|<div align="center">ID.Byte1</div>
 
|<div align="center">ID.Byte2</div>
 
 
|<div align="center">Ping Message</div>
 
|<div align="center">Ping Message</div>
 
|<div align="center">Checksum</div>
 
|<div align="center">Checksum</div>
Line 64: Line 64:
 
|<div align="center">0</div>
 
|<div align="center">0</div>
 
|<div align="center">123</div>
 
|<div align="center">123</div>
 +
|<div align="center">ID.Byte2</div>
 +
|<div align="center">ID.Byte1</div>
 
|<div align="center">ID.Byte0</div>
 
|<div align="center">ID.Byte0</div>
|<div align="center">ID.Byte1</div>
 
|<div align="center">ID.Byte2</div>
 
 
|<div align="center">Bootloader Mode</div>
 
|<div align="center">Bootloader Mode</div>
 
|<div align="center">Checksum</div>
 
|<div align="center">Checksum</div>
 
|<div align="center">-</div>
 
|<div align="center">-</div>
|Write bootloader mode in byte 128 of the Micro CAN EEPROM
+
|Write bootloader time in byte 128 of the Micro CAN EEPROM
 
|-
 
|-
 
!<div align="center">S->M</div>
 
!<div align="center">S->M</div>
Line 76: Line 76:
 
|<div align="center">123</div>
 
|<div align="center">123</div>
 
|<div align="center">123</div>
 
|<div align="center">123</div>
 +
|<div align="center">ID.Byte2</div>
 +
|<div align="center">ID.Byte1</div>
 
|<div align="center">ID.Byte0</div>
 
|<div align="center">ID.Byte0</div>
 +
|<div align="center">Bootloader Mode</div>
 +
|<div align="center">Checksum</div>
 +
|<div align="center">-</div>
 +
|Response on bootloader time being programmed
 +
|-
 +
!<div align="center">M->S</div>
 +
|<div align="center">7</div>
 +
|<div align="center">0</div>
 +
|<div align="center">125</div>
 +
|<div align="center">ID.Byte2</div>
 
|<div align="center">ID.Byte1</div>
 
|<div align="center">ID.Byte1</div>
 +
|<div align="center">ID.Byte0</div>
 +
|<div align="center">Bootloader safety flag</div>
 +
|<div align="center">Checksum</div>
 +
|<div align="center">-</div>
 +
|Write the bootloader safety flag (1 = set bit, 0 = clear bit)
 +
|-
 +
!<div align="center">S->M</div>
 +
|<div align="center">7</div>
 +
|<div align="center">125</div>
 +
|<div align="center">125</div>
 
|<div align="center">ID.Byte2</div>
 
|<div align="center">ID.Byte2</div>
|<div align="center">Bootloader Mode</div>
+
|<div align="center">ID.Byte1</div>
 +
|<div align="center">ID.Byte0</div>
 +
|<div align="center">Bootloader safety flag</div>
 
|<div align="center">Checksum</div>
 
|<div align="center">Checksum</div>
 
|<div align="center">-</div>
 
|<div align="center">-</div>
|Response on bootloader byte being programmed
+
|Response on bootloader safety flag written
 
|}
 
|}
  
Line 90: Line 114:
 
* S->M: This means that the Micro CAN (Slave) is sending information to the Master or CAN Control
 
* S->M: This means that the Micro CAN (Slave) is sending information to the Master or CAN Control
 
* This CAN protocol only works for firmware Version 2.x.x
 
* This CAN protocol only works for firmware Version 2.x.x
* CAN protocol speed is 25kbps
+
* CAN protocol speed is 125kbps
* Since the Micro CAN in bootload mode will only respond to messages with SID 0, make sure to have the SID set at 0.
+
* Since the Micro CAN in bootload mode will only respond to messages with SID 1, make sure to have the SID set at 1.
 
* Checksum is calculated as the sum of the previous bytes. Example: Nr of bytes=5 (so 5 bytes to transmit), Checksum=Byte0+Byte1+Byte2+Byte3
 
* Checksum is calculated as the sum of the previous bytes. Example: Nr of bytes=5 (so 5 bytes to transmit), Checksum=Byte0+Byte1+Byte2+Byte3

Latest revision as of 13:31, 15 October 2019

Direction Nr Of Bytes Byte0 Byte1 Byte2 Byte3 Byte4 Byte5 Byte6 Byte7 Description
M->S
6
0
94
ID.Byte2
ID.Byte1
ID.Byte0
Checksum
-
-
Reset uCAN with specific ID
S->M
7
94
94
ID.Byte2
ID.Byte1
ID.Byte0
AppMode
Checksum
-
Resetting CAN has been done (App_mode=1 -> App running, =0 -> In Bootloader)
M->S
7
0
96
ID.Byte2
ID.Byte1
ID.Byte0
Ping Message
Checksum
-
Ping the Micro CAN slave to see if the Micro CAN is available
S->M
7
1
96
ID.Byte2
ID.Byte1
ID.Byte0
Ping Message
Checksum
-
Micro CAN will respond to a ping request from the Master
M->S
7
0
123
ID.Byte2
ID.Byte1
ID.Byte0
Bootloader Mode
Checksum
-
Write bootloader time in byte 128 of the Micro CAN EEPROM
S->M
7
123
123
ID.Byte2
ID.Byte1
ID.Byte0
Bootloader Mode
Checksum
-
Response on bootloader time being programmed
M->S
7
0
125
ID.Byte2
ID.Byte1
ID.Byte0
Bootloader safety flag
Checksum
-
Write the bootloader safety flag (1 = set bit, 0 = clear bit)
S->M
7
125
125
ID.Byte2
ID.Byte1
ID.Byte0
Bootloader safety flag
Checksum
-
Response on bootloader safety flag written


Notes:

  • M->S: This means that the Master or CAN Control is sending information to Micro CAN (Slave)
  • S->M: This means that the Micro CAN (Slave) is sending information to the Master or CAN Control
  • This CAN protocol only works for firmware Version 2.x.x
  • CAN protocol speed is 125kbps
  • Since the Micro CAN in bootload mode will only respond to messages with SID 1, make sure to have the SID set at 1.
  • Checksum is calculated as the sum of the previous bytes. Example: Nr of bytes=5 (so 5 bytes to transmit), Checksum=Byte0+Byte1+Byte2+Byte3