Skip to content

Instantly share code, notes, and snippets.

@TiNredmc
Last active February 2, 2022 07:27
Show Gist options
  • Save TiNredmc/79c4b286dba4617ee7beea43fb793f46 to your computer and use it in GitHub Desktop.
Save TiNredmc/79c4b286dba4617ee7beea43fb793f46 to your computer and use it in GitHub Desktop.
Reseal the Fuel gauge protection of BQ27541/BQ27542 via i2ctransfer on Linux
#!/bin/bash
# Simple Script to re-seal the BQ27541 or BQ27542
# Coded by TinLethax 2021/06/02 +7
# structure [Control_command0x00][lower byte][higher byte]
# Sending SEAL subcommand cause it to reseal (Sending Big endian )
i2ctransfer -y -f 0 w3@0x55 0x00 0x20 0x00
sleep 1
i2ctransfer -y -f 0 w3@0x55 0x00 0x00 0x00
i2ctransfer -y -f 0 w1@0x55 0x00 r2
echo Resealed!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment