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.

BQ34Z100-G1: BQ34Z100-G1

Part Number: BQ34Z100-G1
Other Parts Discussed in Thread: BQ34Z100

The following is the continuation of this question.

https://e2e.ti.com/support/power-management/f/196/p/822988/3046215#3046215

Due to my long absence that question has been locked. I checked if the device is in FAS(full access sealed mode) and i also tried unsealing the data flash before attempting to read from it using the Control cmd (0x00,0x01) and the unseal key (first 2 bytes 0x0414,second 2 bytes 0x3672) sent in the usual lower byte first order. This too doesnt resolve the issue.

  • Hi Mohammed,

    It looks like you might be sealed. You can also use the command tab to send the unseal and full access commands. If that doesn't work, please send us a screenshot of your registers.

  • Hi Batt,

    Thank you for the response. I have narrowed down the issue to wrong checksum calculation. When reading a subclass block and writing back the same checksum without modifying the Data Flash the write Checksum command succeeds. Here is my code to calculate the check sum:

    void BQ34Z100::writeCheckSum() {                                                                                                                                                                                                                                                                                                                                                                            
    int chkSum=0;
    //These indexes                                                                                                                                                                                         
    for(int i=lastreadIndex;i<lastreadBlocksize;i++)                                                                                                                                                     
    {                                                                                                                                                                                                    
    chkSum += flashData[i];                                                                                                                                                                            
    }
    //invert the last byte of the calculated checksum                                                                                                                                                                                               
    checkSum = static_cast<uint8_t>(~chkSum);                                                                                                                                                            
    write_reg(0x60,checkSum);                                                                                                                                                                            
     }         

    The above method works correctly since when i read the a flash block and the check sum and calculate the checksum without modifying the flash data, i get the same result as that stored on the  bq34z100. The issue however happens when i modify the flash data and write the new checksum. Could anybody tell me what is the proper procedure to calculate the checksum for a flash block. Some blocks are 32 bytes long and others are 16 bytes long. Do we have to only use the most recently read flash block to calculate the new checksum? how about if we want to modify the flash contents individually without reading the entire block?

  • Hi Mohammed,

    Please make sure that when you write the new data, you write the checksum followed by the length. You will have to use the data that's written in total to calculate the checksum of the entire block.