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: Export Battery Management Studio (bqStudio) data memory contents to C code for a microcontroller to program it

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

I have been using the Battery Management Studio (bqStudio) along with the EV2400 module to program the BQ34Z100-G1 battery fuel gauge IC using I2C. I have been able to program the fuel gauge with the settings that I would like and have created a Golden Image file of it. However, the fuel gauge on my design is connected to an I2C port on an MCU that we would like to use to program all future fuel gauges. The firmware for the MCU is C code. Is there a way to export the bqStudio data to my MCU C code in order to program it there? If not, do you have any suggestions on how I would be able to program the fuel gauge using my MCU?

  • Hi Eric,
    The Flashstream format is designed for exactly what you wish to do. In the golden image plugin of bqStudio you can export a .df.fs file and a .bq.fs file. The .df.fs file will program only the dataflash configuration section of the gauge, which is sufficient if you don't need to update the firmware on the gauge. The .bq.fs file will update both the dataflash and the instruction flash in the case where you need to update the firmware, too. For your case you can probably use the .df.fs file.
    An example of how to program Flashstream files is included in this app note: www.ti.com/.../slua801.pdf
  • It won't let me create either the .df.fs file or the .bq.fs file. Only the .srec file is available. I'm getting the error attached.

  • Hi Eric,
    If you leave all three check-boxes checked, does it work?
  • It still gives me the same error. The srec file is created, but the other two fail to be created.
  • We just tested bq34z100-G1 with bqStudio version 1.3.86 and it can export the Flashstream files okay. Can you please update your bqStudio, make sure the gauge is unsealed (no lock icon on the left side), and try again?
    www.ti.com/.../bqStudio
  • For some reason, my bqStudio is not able to communicate at all with the fuel gauge now. I don't know what happened. I am looking into that to see if I can figure it out.

  • Hi Eric,
    When you launch bqStudio and no gauge is autodetected then a window pops up with a list of gauges you can select. At the bottom of that window it shows what gauge and FW version were autodetected. Is there anything listed there? Maybe you could send a screenshot of that view, then manually select bq34z100-G1 and send a screenshot of the next screen, too.
  • Nothing is listed at the bottom. It is not detecting anything. Attached are my two screenshots.

  • Hi Eric,

    Please refer to the Quickstart Guide ( www.ti.com/.../sluubv2 ) before running through these quick debug steps:

    1. With the device powered, probe the TS pin and look for the pulsed waveform. If the pulsed waveform is seen, the device is executing firmware.

    2. Ensure the I2C is connected to Port 2 on the EV2400 and connected on the other end to the I2C connected on the EVM. It is very easy to accidentally switch to a different port on the EV2400 or accidentally plug into the HDQ port on the EVM.

    3. Ensure the device is powered by a voltage source across the BAT- and BAT+ pins.

    4. With bqStudio open as shown in the above screenshot (dashboard view), unplug the USB cable between the EV2400 and the PC and plug it back in. Power cycle the device.

    If the issues continue to persist after the above steps, or if these steps solved the issue, please let us know.

    Sincerely,
    Bryan Kahler
  • This still did not resolve the issue. The TS pin had a pulsed waveform that was pulsing from high to low every 1 second. I did ensure that the I2C pins are all connected properly together. The voltage between the BAT+ and BAT- pins is about 700 mV. I followed step 4 and it still did not connect.
  • I figured out the connection issue. A resistor was not populated on the Regulator In pin which was causing it to malfunction. Once I fixed that, the connection was resolved. I have now been able to create all of the files with the new version of bqStudio.

    Thanks for all of your help! I am trying to decipher the df.fs file for my C code. I assume the 'X' character means a delay (in ms), the 'W' character means a write, and the 'C' character means setting a subclass. Is that true? Are the bytes in little endian or big endian format? I notice that for each of the sections, the first byte is either "AA" or "16". Does that signify anything?
  • Hi Eric,

    See section 5 of SLUA801 and the sample code for parsing it at the end: