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.

Writing data flash class 104 on BQ34Z100-G1

Other Parts Discussed in Thread: BQ34Z100-G1

I can't change the content of the class 104 (calibration data) in data flash of BQ34Z100-G1.

I can write to others classes in data flash. Write data, write checksum, read checksum and check if it is writed right.

In the case of class 104, I can write data, read it back (I think I'm reading the scratchpad and not the real saved data) but when I read the updated checksum, the old one is still there.

After a reset, if I read the content of class 104 again, I read the old data.


Seems like there is some register I need to unlock to write in that class but can't find any information in documentation.

Any help will be apreciated.

  • I tried writing SubClass 104 and was successful in updating the data flash. This document contains an example of updating the data flash. Please check to make sure that you are using the right commands.

    5775.bq34z100-G1 DF access.pdf

  • Is the data stored after a reset?

    I use the right commands.

    bool BQ34z100G1::flashBlockWrite(uint8_t const subclass, uint8_t const block, const uint8_t src[BLOCK_SIZE])
    {
    	bool result = false;
    	if (writeByte(DATA_FLASH_CLASS, subclass))
    	{
    		if (writeByte(DATA_FLASH_BLOCK, block))
    		{
    			if (writeMem(BLOCK_DATA, &src[0], BLOCK_SIZE))
    			{
    				uint8_t const checksum = calculateChecksum(src);
    				if (writeByte(CHECKSUM, checksum))
    				{
    					result = (readByte(CHECKSUM) == checksum);
    				}
    			}
    		}
    	}
    	return (result);
    }
    

    In all the other classes I write to, I have result=true cause the checksum I write is also readed. In the case of class 104, the checksum I read back is the checksum before write new data.

    If I read the data before a reset, I read the data just flashed. I think the BQ is reading the content of the scratchpad so the real data is not readed back.

    After a reset if I read the data on class 104, is the same before I write it.

    Any other class works fine.