This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Can't change SHA-1 authentication key

Other Parts Discussed in Thread: BQ34Z100, BQEVSW, BQ34Z100-G1

I am using BQ34Z100 with a MCU controlling it. But I can't change the SHA-1 authentication key via I2C. Here are the steps. First I write 0x00 to 0x61 to enable the authentication data commands. Next I write 0x70 to 0x3E and 0x00 to 0x3F to specify subclass ID and offset. Then I write 16-byte new key to 0x4C. Finally, I read 32-byte data from 0x40 to 0x5F, calculate the checksum for the entire data block and write it to 0x60. Is there any misunderstanding for changing the key?

I tried to use bq Evaluation Software to do that. I can change the key in "security" tab but can't do so in "I2C Pro" using the same method above.

  • Most of the process looks correct, but you have to write the full 32 byte block f data to the device. Reference page 40 in the bq34z100-G1 Datasheet. You should also be able to change the keys in the data memory section with the bqEVSW program. If you cannot change them there, then check to make sure that the cell voltages are above the Flash Update OK voltage.

  • Thanks for your reply. I can change the key in the data memory section with the bqEVSW program. However, I can't do the same thing via I2C. I notified that in the datasheet, it says the checksum is (255-x) where x is the 8-bit summation of the BlockData() (0x40 to 0x5F) on a byte-by-byte basis. Here is how I calculate the checksum.

    I2CRead(0x40,32); //read 32-byte data and save it in RxData

    ptr = (unsigned char*)RxData;

    for (;BlockSize > 0;BlockSize--); //BlockSize = 32
    {
    sm += *ptr++;
    }

    checksum = 0xFF - sm;

    Thanks
  • I find a fault in my program which leads to the failure of checksum writing. Now the problem is fixed, thank you.