CanServo/Protocol/LongMessage

From HITEC_HELP
Revision as of 09:56, 26 February 2026 by Choiyh (talk | contribs) (→‎Long Message)
Jump to navigation Jump to search

Up

Long Message

  • A method of sending a long message by dividing it into multiple packets.
    • Of course, 1 packet is also possible.
  • This content refers to the message format of UAVCAN.
    • Thanks to UAVCAN
  • Note:
    • CRC16 : byte order : low byte first, little endian
  • Transmission method
    • Check the length of the message to be sent, and if it cannot be sent in one packet, calculate CRC16 and add it to the end of the message.
      • The starting value for CRC16 calculation is 0xFFFF (-1).
    • Repeat the process of cutting from the front, attaching the Tail Byte, and sending it as one packet.
      • At this time, if the length (including Tail Byte) exceeds 8 bytes, the exact length is placed in the first byte.
    • NOTE: If it is not an FD, the maximum is 8 bytes, so it can be up to 7 bytes.
      • In the case of FD, the maximum is 64 bytes, so excluding the first byte of length, it can be up to 62 bytes.

CAN 2.0

CAN-FD

  • CAN-FD data is expanded up to 64 bytes.
    • 0~8, 12, 16, 20, 24, 32, 48, 64

Tail Byte

  • Tail Byte
    • bit 7 = first packet
    • bit 6 = last packet
    • bit 5 = 1 if first packet, toggle bit on each packet
    • bit 4:0 = Seq, 0 ~ 31, inc 1 on each message