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.

BQ40Z80: Unable to read SREC from Device

Part Number: BQ40Z80
Other Parts Discussed in Thread: BQSTUDIO, EV2400

I am experiencing a new, but consistent issue with BQStudio and the BQ40Z80. I am unable to read an SREC file from the fuel gauge. This is not a problem I have experienced before, as I generally program my battery packs with a .srec file I previously generated, but I am consistently (across 3 separate battery packs) unable to do it anymore. When I attempt to read SREC from the device, I get a "no acknowledge" error in the lower left, the BQ40Z80 disconnects from BQStudio, and I have to manually select the component I am connecting to. After manually connecting, everything is incorrect and I need to reflash with my existing .srec in order to return to a normal state. Below are some images showing the process I just explained. I have tried fully uninstalling BQStudio (and deleting the ti folder from my C drive) and reinstalling, but I still get the error.

1. Error message immediately after pressing Read SREC from Device

2. Disconnection from BQ40Z80 (gray icons on left side) and manual device reselect

3. Register interface after manually selecting device

4. Firmware re-flashing (proving communication is working fine between EV2400 and device)

  • Also adding the .srec file I have been flashing with. It wasn't letting me upload the .srec file directly so I threw it in a zipped folder.

    8372.srec.zip

  • Hello Nathan,

    It looks like the gauge has entered ROM mode, when you send SMBus command 0x08 while in this mode the gauge should re-enter FW mode. It may be the safest option to reflash the SREC regardless.

    Sincerely,

    Wyatt Keller

  • Hi Wyatt,

    Is there a way to confirm whether or not I'm in ROM mode? I tried sending the SMBus command 0x08 and reading the SREC multiple times, but I encountered the exact same sequence of events documented in the original post. I have attached an image of the successful command being sent. Let me know if it looks like I did anything wrong and what to try next.

    Thank you,

    Nathan

  • Hello Nathan,

    Please read word 0x0D and see if the result is around 0x9000, if it is then the gauge is in ROM mode. There are integrity bytes as part of the FW upload process and if they are not valid (from bad SREC upload) then it will not boot to firmware mode.

    Sincerely,

    Wyatt Keller

  • Hi Wyatt,

    It looks like the BQ40Z80 is not in ROM mode, I read word 0D and got the value 3E back. After that I attempted to read the SREC and got the same issue mentioned in the original post. After the re-flash to recover from everything breaking I am still reading 3E, so it appears to consistently not be in ROM mode.

    Let me know what you think,

    Nathan

  • Nathan, 

    It looks like the gauge exited ROM mode after you sent the 0x08 command.

    Just to confirm, when you open BQStudio, what do you see? Does the device target get autodetected? 

    To clarify, Read srec from device is to extract the golden image. Program button is used to program the gauge with an existing golden image. 

    Regards,
    Jose Couso

  • Hi Jose,

    When I open BQStudio the device gets autodetected. A few months ago I created a golden image, which I program the BQ40Z80 with. I am trying to start with that golden image, alter some registers which are not the correct values (mainly advanced charging algorithm values to better match the expected current), and generate a new golden image. I am able to connect, auto-detect the IC, and flash the old image without any issues. I am also able to update and write to data memory without any issues. But when I attempt to to Read srec from device to generate my new Golden Image, I am encountering the issues documented in the original post.

    Let me know if you need any more information from me,

    Nathan

  • Hi Nathan,

    I wonder if it is a data flash parameter you changed causing this issue. Can you export the gg.file? Please provide me the exported gg and the old working golden image.

    In the meantime, I suggest to install the TEST version of BQStudio. See if this helps fix the issue.


    Regards,
    Jose Couso

  • Hi Jose,

    I have attached my .srec I have been flashing with along with the .gg file I am trying to update to. I also had the same idea as you, so I have tried just flashing with the old .srec file and then reading srec from device without changing anything and I still encounter the error. So it should not be due to something I am changing, because I encounter the same problem whether or not I change anything.

    Let me know if you find anything,

    Nathan

    BQStudio Files.zip

  • Hello Nathan,

    This testing is done with the most recent BQStudio version (the test version as Jose linked)?

    Sincerely,

    Wyatt Keller

  • Hi Wyatt,

    That testing was done on the latest stable version. I have now installed the latest test version and done some testing with it. Below are some notes and screenshots.

    1. The BQ40Z80 was autodetected (without installing the additional support for it that I need to install on the stable version)

    2. I read word 0x0D before and after sending the command 0x08 to exit ROM mode. Both times the response was 0x003E, so I do not believe the BQ40Z80 is ever in ROM mode to begin with.

    3. I am no longer able to flash the BQ40Z80 with the Golden File I had been using on the stable version

    4. I am still unable to read the SREC from the device

    5. Outside of the Advanced Comm SMB tab it seems like I am unable to communicate with the device at all. Attempting to send any commands using the buttons in the Commands tab, refresh the registers, or read/write data memory fails and gives various error messages.

    Overall, I am not having very much luck with the Test Version. Is there a factory reset command I can send through Advanced Comm SMB? I was going to attempt to re-write all data memory to default values but I can't do that without reinstalling the Stable Version again, and flipping back and forth between the two versions is not ideal.

    Let me know what you think,

    Nathan

  • Hello Nathan,

    The test version should be very similar to the stable version in functionality. You should be able to upload the SREC as long as it's a valid SREC, so the default SREC should always allow you to upload it. If you use the default you cannot upload with the test version?

    Sincerely,

    Wyatt Keller 

  • Hi Wyatt,

    I seem to have found a solution, not really sure why it worked/was broken in the first place. I had the battery pack flashed with the firmware golden file which I sent previously. I flashed it using the Stable version of BQStudio, and when I switched to the Test version I was unable to communicate with the battery pack outside of the Advanced Comm SMB interface. Attempting to use any command buttons or read/write in the Data Memory tabs gave me communication errors.

    FIX: I re-installed the Stable version of BQStudio, flashed the battery pack with the default BQ40Z80 SREC file (from the SLUC672 install found here https://www.ti.com/product/BQ40Z80), then re-installed the Test version of BQStudio and I am now able to communicate with the BQ40Z80 and read the SREC from the device. I don't know if this is due to an issue with my old golden file or a discrepancy in the two versions of BQStudio, but I will go through the process of creating a Golden File again using the Test version of BQStudio since it seems to have better built in support for the BQ40Z80 than the stable version does.

    Out of curiosity, which Data Memory registers should I be setting? I made my original golden file by following the instructions here: https://www.ti.com/lit/an/slua848/slua848.pdf?ts=1699994409090&ref_url=https%253A%252F%252Fwww.google.com%252F

    Those instructions cover setting ChemID, Design Capacity, Design Voltage, Charge Term Taper Current, Dsg Current Threshold, Chg Current Threshold, Quit Current, and Term Voltage. This seems like a good start, but the changes I was trying to make now were values in the Protections and Advanced Charge Algorithm sections of Data Memory. Reading through the Technical Reference Manual, it seems like I should be setting many of the Protections registers because our cells are rated for operation outside of the default values there, and many of the Advanced Charge Algorithm registers to provide more details about expected charge current/voltage based on our battery charger circuit parameters.

    I have two questions for you:

    1. Am I supposed to be changing Data Memory values in the Protections and Advanced Charge Algorithm sections of Data Memory (assuming everything is still within the safe operating conditions of the cells based on the manufacturer's datasheet)?

    2. Should I set those registers before or after completing the learning cycle described in "How to Complete a Successful Learning Cycle for the bq40z80"?

    Thank you again for all your help,

    Nathan