By default, the fuel gauge contains a default plain-text authentication key of
0x0123456789ABCDEFFEDCBA9876543210. This default key is intended for development purposes. It must be changed to a secret key and the part immediately SEALED, before putting a pack into operation. Once written, a new plain-text key cannot be read again from the fuel gauge while in SEALED mode.
To change the pre-programmed authentication key from its default value, follow the steps below:
- Unseal the fuel gauge.
- Send the Authenticate() command.
- Write 0x00 to BlockDataControl() to enable the authentication data commands.
- Send the DataFlashClass() command with 112 (0x70) to set the Security class.
- Up to 32 bytes of data can be read directly from the BlockData() (0x40 through 0x5F) and the authentication key is located at 0x48 (0x40 + 0x08 offset) to 0x57 (0x40 + 0x17 offset).
- Write the new authentication key to the corresponding locations (0x48 through 0x57) using the BlockData() command.
- Compute the correct checksum for the whole block (0x40 to 0x5F). The checksum is (255 – x) where x is the 8-bit summation of the BlockData() (0x40 through 0x5F) on a byte-by-byte basis.
- Send the BlockDataChecksum() (0x60) with the computed checksum from the previous step.
- Seal the fuel gauge.