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.

bq20z75 write data flash



Hello,

I use a MCU with an I2C link. I can read and write SBS Commands, and i can read Data Flash. But I cannot write Data Flash.

I don't understand the C.1.4 Example of the bq20z75 Technical Reference Manual.

As a matter of fact, concerning the "Write Subclass ID", the Slave Address is sometimes "0x16" and sometimes "0x17". The last bit, is the read/write bit. So it should always be "0", and the Slave Address should always be "0x16", isn't it ?

Furthermore, I think the protocol to read the subclass would rather be :

- Slave Address 0x16 (write)
- 0x77
- 0x50
- 0x00

- Slave Address 0x16 (write)
- 0x78

- Slave Address 0x17 (read)
- read 32 bytes

- Slave Address 0x17 (read)
- read 32 bytes

Did someone managed to write the Data Flash ?

Thank you.

Jerome

 

  • The address is usually considered to be 0x16. However, it's easier for me to remember if I view the address os 0x0B, and then the last bit, making it 0x16 or 0x17, is the read/write bit.

    To help you out, you can try going into the Pro Screen in EVSW and try to play around with the commands. You should be able to use the commands in EVSW and read and write data manually. This is very useful for debugging your code.

  • Thank you for your answer.

    Thank you for telling me what is the read/write bit, but could you please read the C.1.4 Example of the bq20z75 Technical Reference Manual, and tell me if there is a mistake according this read/write bit concerning the "Write Subclass ID" ?

    The EVSW is useless to me as I do not have the evaluation board. That's why I asked such questions. I would be very pleased if you could answer them.

    Furthermore, I think I have found some things that are not explained in the uncomplete datasheets...

    Jerome

     

     

     

  • Jerome,

    I double-checked the instructions in the technical reference and I was able to successfully update the data flash using the instructions.

    Here is another example you can try. These are the exact steps I followed:

    1) Write Subclass ID using device address of 0x16.

                      Use SMB Command 0x77 and write Subclass ID 0x00.

    2) Read Subclass using device address of 0x16.

                     Use SMB Command 0x78 to read 32 bytes of data. This will give the contents of Subclass ID 0x00.

    3) Overwrite offset 0 of Subclass 0x00 with new value. I decided to change the COV Threshold from 4300mV (0x10CC) to 4400mV (0x1130).

    Now, write the data you changed back to the data flash.

    4) Write Subclass ID using device address of 0x16.

                      Use SMB Command 0x77 and write Subclass ID 0x00.

    5) Write Subclass using device address of 0x17.

                     Use SMB Command 0x78 to write the 32 bytes of data back to the data flash.

  • Hi,

    I'm struggling to get overwrite the data flash as well. Would it be possible to see your code for the process above?

    Thanks,

    CC