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: Golden Image questions about address, register & checksum

Part Number: BQ34Z100-G1
Other Parts Discussed in Thread: BQSTUDIO, BQ34Z100, EV2400

Hi,

in order to create a Golden Image file I've used the BQStudio Software and the BQ34Z100-G1 EVM board. It worked well.

Now we implemented the BQ34Z100-G1 into our PCB. Communication via I²C is working great.

My question is about the content of the Golden Image File and the checksum. Here just one small part of it:

;Unseal device
;--------------------------------------------------------
W: AA 00 14 04
W: AA 00 72 36
W: AA 00 FF FF
W: AA 00 FF FF
X: 1000
;--------------------------------------------------------
;Go To ROM Mode
;--------------------------------------------------------
W: AA 00 00 0F
X: 1000
;--------------------------------------------------------
;Data Block
;--------------------------------------------------------
W: 16 00 03 00 00
W: 16 64 03 00
X: 20
C: 16 66 00
W: 16 00 02 00 00 00 EA FF 33 B1

1)

The beginning makes sense with "W: AA 00 14 04"

AA is the adress, 00 the register and the 14 04 the unseal key and so on.

But starting with the Data Block the W: 16 00 03 00 00 or W: 16 64 03 00. Why the address is changing to 0x16? There is no information about it in the datasheet of the BQ.

And what register is 0x64? also no information in all sheets of the BQ34Z100-G1. Normally I know TI that they do great datasheets, but this time.... -,-

2)

At the end of all data block writings there should be done a CheckSum calculation. Is this calculation already inside the Golden Image file at the end? Or should I do it by my own after every 32 Bytes?

Thank you

Regards

Markus

  • Hello Markus,

    The 0x16 address corresponds to the ROM mode for the gas gauge.

    The checksum is computed in the gauge. The host just needs to compare the C line according to this app note: http://www.ti.com/lit/an/slua541a/slua541a.pdf?ts=1591395260486&ref_url=https://www.google.com/

    The host will send the pre-computed checksum and see if the checksum in the gauge matches.

  • Hello Kang Kang,

    thank you for you help.

    To enter Rom Mode I use (regarding to your sheet):

    Device Address:

    0xAA

    Register:

    0x00

    Data:

    0x0F00

    After that communication is just possible with the device address 0x16, and not anymore 0xAA.

    But how to exit from the ROM Mode?

    I tried the same way like 0x16 (adress) 0x00 (register) 0x0F00 (data).

    After a short delay I tried to communicate again with 0xAA (device adress) but still not working. Just 0x16 adress.

    What should I do or send to get out of this ROM Mode?

    Thank you for you help.

    Regards

    Markus

  • Hello Markus,

    Can you try 0x00 0x0F instead of 0xF0 0x00.

  • Hi Kang Kang,

    I tried every possible combination. And I have here several PCBs here, all have the same problem, they can't go out of the ROM Mode.

    I tried to send in 2 seperate HAL_I2C Commands

    0x00 and 0x0F or

    0x00 and 0xF0 or

    0xF0 and 0x00 or

    0x0F and 0x00.

    Also tried the same way to send it in ONE HAL_I2C_Write Command.

    For the address 0x16 I get everytime a HAL_OK as return value.

    After that I check the communication to read something from the 0xAA address and its still not working (HAL_ERROR).

    Thank you for your help

  • Hi  Markus
    You need to send the two commands below to exit from ROM mode.
     
    W: 16 00 0F
    W: 16 64 0F 00
     
    I have checked using the Advanced Comm I2C Window in the bqStudio.
    Basically, I can exit from the ROM mode after I send these two commands.
    Andy
  • Hi Andy Liu,

    thank you for your reply.

    1. Why this information about enter and exit ROM Mode is not inside the offical data sheet of the BQ34Z100-G1???

    2. Well your post helped me and didn't.

    I tried to do it with the EVM2400 and the BQ34Z100 EVM board. I did the same way how you explained and it worked fine. Thank you for that.

    But, then I tried it on my microcontroller (STM32L072VBTx) communicating with the BQ-IC (BQ34Z100-G1). And it didn't work. He is not able to exit the ROM Mode.

    During programming the Golden Image there was an failure and then he was not able to go out.

    I checked the signals (SDA and SCL of I²C) of both (EVM board and our BQ IC) with a oscilloscope and they look the same.

    The speed is at 100 kHz of both signals. Voltage at 3,3 V. Schematic is the same like in the recommended schematic in the data sheet.

    Is the BQ in an unrecoverable mode?

    Markus

  • Hi Markus,
    I would suggest you use the EV2400 to communicate with the bq34z100-g1 device.  If it cannot exit from the ROM mode, it is
    likely that the device was not properly programmed.  Use the bqStudio to program the default firmware to that device and try again.
    Andy
  • Hi Andy,

    I am pretty sure that it will repair my problem. But its not the solution to avoid this problem.

    I have checked now that when I just enter the ROM Mode and then just exit, it works fine.

    But when I am inside the ROM Mode and write some stuff, and want the exit after that, its not working and I have to change the bq on our PCB.

    1)

    What is the meaning behind "not properly programmed". Or lets say which commands, which data the BQ needs in order to know that he is programmed properly??

    I want to understand it. Because during production this case could happen again. And then its not possible to connect everytime the BQ again with the EV2400.

    We are programming the bq with our microcontroller from STM32. The Golden Image is a char array and the code is selfmade + from the paper SLUA801 (Gauge communication).

    2)

    What is the Bqstudio doing to programm the default firmware? Could I implement in manually in a code/hex-code?

    Thank you for your help

    Markus

  • Hi Markus,
    Did you make any change to the C code you can find in the app note "Gauge communication"?
    You have to modify the C code so that it can work with the FlashStream files for bq34z100-g1.
    See the discussion in the following thread. 
    Andy
  • Hi Andy,

    I found the solution.

    And your thread helped me too to confirm my solution.

    It was important to add in the options-window of creating the golden image file a limit of 32-bytes.

    Due to the sheet (Gauge Communication - SLUA801) its written down that the C-Code just support up to 32-bytes.

    In the past I did not use this limit, therefore the flashing code (my added golden image code too) used just the first 32 bytes of the data block and could not complete the flash process.

    Therefore he was still bricked in the ROM Mode and could not go out.

    When someone will have the same problem and is stucked in the ROM Mode and is not able to change the BQ chip, should do the following:

    Solder some wires on the SDA, SCL and GND Pins. Connect 3,3 V on the EN-Pin & 3,3 V Pins. Connect the I²C lines to your EVM2400. Programm the BQ completely new. The new BQ Studio software should find the address 0x16. And your BQ IC is fine again.

    Improvement for TI and the documentation:

    - to add the Rom Mode and everything related to that to the official datasheet of the BQ34Z100-G1.

    - to add the rom mode register tables into the datahseet

    - to explain very clear what to do if stucked in the rom mode

    - to make much better flowcharts which kind of flash/rom/sealed/unsealed modes you are at the moment, and not just a lot of text pages

    - to know that there are more I2C addresses then 0xAA. to know that there is also the 0x16

    Thank you Andy

    Regards

    Markus

  • Hello Markus,

    Let me take this feedback to our documentation team.

    Thank you!