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: I need a sample source code (preferably in C) to flash the BQ34Z100-G1 image using Linux APIs.

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

Hi,

Good Day. I have a customer who is working with BQ34Z100-G1. Please see below the query of our customer for your reference.

I already bought the devices(BQ34Z100-G1). What I am looking for is a sample code to flash the image to BQ34Z100-G1. I am keenly looking for the source code. Else, our HW engineers might have to rethink the current design.

Best Regards,

Ray Vincent

  • Hi Ray,

    The Gauge Communication document contains a C source code example. To understand I2C communication on the BQ34Z100, they can also refer to this document.

    Best,

    Jessica

  • Hi Jessica,

    Good Day. Please see below the response of our customer to your suggestion.Thank you very much.

    Thank you for the update. I already had this document and followed the source code in the document. However, this source code does not work for BQ34Z100-G1 even after making necessary changes.

    Following are the changes we incorporated for this chipset.
    1. Changed voltage register to 0x08 as per BQ34Z100-G1 datasheet
    #define CMD_VOLTAGE 0x08

    2. Changed reset to 0x0041 as per datasheet.
    #define SOFT_RESET 0x0041

    2. Changed i2c bus "/dev/i2c-0". On our HW, the bq chip sits on i2c bus 0.

    3. Commented out updating class DC_STATE as this section is for bq2742x.

    4. Added steps to seal the bq chip after the update operation.
    gauge_address(pHandle, GAUGE_DEVICE_ADDRESS);
    gauge_control(pHandle, 0x20); //seal
    5. Increased the delays. Experimented with 10x/2x/3x increment.

    6. Increased char pData[32]; to char pData[512]; With 32 as buffer size, all the data was not read.
    Please find the modified source codes attached for your reference.

    Even after all the changes, following are the observations after flashing.
    1. The flashing process did not show any error.
    2. The chip address which was initially at 0x55(0xAA>>1) is shifted to 0xB(0x16 >> 1). i.e. Prior to flash, i2cdetect shows the device at 0x55.
    3. However, after hard reboot, the bq chip is not more seen on i2c bus. Even, it is not seeing on bms studio. We are unable to recover the device. Our HW engineer says that the chip is alive, but they are also unable to recover it, probably ROM got corrupted. Honestly, something is terribly going wrong.

    We have a business impact if we can't resolve this. This chip is expected to go on to a large quantity of our HW units. As I mentioned in my earlier post, HW engineer might have to go for alternatives if not resolved through SW.
    Hence, please let us know your solutions to resolve this.

    Best Regards,

    Ray Vincent

  • Hi Jessica,

    Good Day. Is there any update with regards with this? Thank you very much.

    Best Regards,

    Ray Vincent

  • Hi Ray,

    They can try sending the following command to exit ROM mode:

    W: 16 00 0F
    W: 16 64 0F 00
    What kind of flash stream file are they using?
    Best,
    Jessica
  • Hi Jessica, 

    Good Day. Please see below the latest response of our customer to your reply. Thank you very much.

    Those commands are already present in the flash stream file we are trying. Attached is the flash stream file being used for flashing. The file name is renamed to bms.fs. The original name is 0100_0_16-bq34z100G1.bq.fs

    For the files came from the customer, I will send directly to your email so that you can check the codes of the customer.

    Best Regards,

    Ray Vincent

  • Hi Jessica,

    Good Day. Any update on this post? Thank you very much.

    Best Regards,

    Ray Vincent

  • Hi Ray,

    I apologize for the delay. I cannot debug your customer's code. I recommend that they use BQStudio to try to recover the unresponsive chip.

    Best,

    Jessica

  • Hi Jessica,

    Good Day. Please see below the response of our customer. Thank you very much.

    Our HW engineer even tried that. He could not.

    Honestly, all the recommendations provided so far are not useful. Though we provided all the needed information and source codes, we are not getting a proper direction to solve this issue. And the response time is long (~5 days). It is not helping us.

    Please let us know if there is a way to expedite this case.

    Best Regards,

    Ray Vincent

  • Hi Jessica,

    Good Day. Any update on this customer query. Thank you very much.

    Best Regards,

    Ray Vincent

  • Ray,

    Unfortunately we are unable to review or provide and source code examples beyond what we have. Our legal department doesn't allow it. With that being said let me revisit the issue at hand. 

    The Flash stream file is an I2C itterable file with list the commands needed to do the programming. it is critical that you program the entire file. If there is an error mid programming the device could be bricked if executed. In the case of failure retry the programming. Normally if an error occurs you are left in ROM mode (programming mode). Please see the attached zip for more details. 

    I suspect you are in ROM mode at the moment, Please load bqStudio and manually select the right device from the list. Then use the programming tab to program in the bq.fs or the srec file. 

    Thanks,

    Eric Vos

    7776.flashstream028_bundle.zip

  • Hi Vos,

    Good Day. Please see below the response of our customer to your reply. Thank you very much.

    >Unfortunately we are unable to review or provide and source code examples beyond what we have. Our legal department doesn't allow it.
    Ok.

    >With that being said let me revisit the issue at hand.
    Thank you.

    >If there is an error mid programming the device could be bricked if executed.
    Yes. We believe so. 2 units have already been bricked and we do not want to lose further.

    >Normally if an error occurs you are left in ROM mode (programming mode)....I suspect you are in ROM mode at the >moment
    Yes. The chip is in ROM mode. But not recoverable.

    >Please load bqStudio and manually select the right device from the list. Then use the programming tab to program in >the bq.fs or the srec file.
    We already tried this. It did not work.

    >Please see the attached zip for more details (e2e.ti.com/.../7776.flashstream028_5F00_bundle.zip).
    We will look into this and update.
    Best Regards,
    Ray Vincent
  • Ray,

    If you read command 0x0D and get no result from the device then you are correct and most likely dead. I suggest using the flash stream and adding slightly longer delays between writes just to be safe. 

    Thanks,

    Eric Vos