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.

Programming BQ27542 with df.fs file

Other Parts Discussed in Thread: BQ27542EVM, EV2400, BQSTUDIO

I'm working on a design using the BQ27542 lithium-ion fuel gauge, and have created a golden file for my application.  However, when I try to use Battery Management Studio to program the BQ27542 from the generated golden files, the operation sometimes fails, bricking the fuel gauge.

I've attached my golden files for reference.  The .srec file works every time, but the df.fs file is what I'd like to use in production, and it only sometimes works.  I have not tried the bq.fs file.  I've also attached csv files taken from a TotalPhase Beagle I2C sniffer.  They show the data on the I2C bus during two programming attempts with Battery Management Studio, an EV2400, a BQ27542EVM, and the attached golden files.  One attempt was successful.  The other attempt failed and bricked the BQ27542.  Both used the attached golden files.

Is there some state that the fuel gauge must be in before programming can take place?

Thanks,

Adam J.

BQ27542 Golden Files.zip

I2C Logs.zip

  • Hello Adam,

    Is bqStudio providing an exception error popup or is there an error on the status bar? Can you verify if there are any error logs generated in the bqStudio installation directory?

    Thank you.
  • Fernando,

    After the programming finished, there was an error that said something like "No acknowledgement from gauge."  There were no popup messages.

    Thanks,

    Adam J.

  • I don't see any logs with the word "error" anywhere in the installation directory. What would the files be called?

    Adam J.
  • Oh...I see two files, one is called ".log" and another is called ".bak_0.log".  I'll attach both:

    .bak_0.log.txt

    .log.txt

  • Hello Adam,

    Thanks for the logs.

    Please try the following:

    • Uninstall bqStudio.
    • Manually delete the installation directory where bqStudio was previously installed.
    • Reinstall latest version 1.3.47.
    • Test to see if you still have the issue.

    This will help us rule out any corruption during installation took place.

    Thank you.

  • OK.  I uninstalled, then deleted the directory, then reinstalled from a new download, then connected a EV2400 and BQ27542EVM, then started bqStudio, then programmed using the df.fs file.

    The BQ27542 bricked on the first try.  I didn't capture the I2C data, in case the capture hardware might have interfered.  But the software started to program, and the popup-window with a progress bar appeared, and it kept going for a few seconds, but then partway through it just stopped and then the gauge wouldn't communicate.  That's exactly what I saw earlier.

    I've attached a screenshot of the Registers plugin prior to programming, in case that matters.

  • Hello,

    Is there anything else I can try?  Another test to help pinpoint the problem?  Is there a way to tell if the df.fs file is somehow corrupted?

    Have you been able to replicate this issue?

    I've attached log files (from the test in my last post) for your reference.

    Thank you,

    Adam J.

    bqStudioLogs.zip

  • Hello Adam,

    We haven't been able to replicate the issue.

    Have you tried generating a new dffs file on the latest bqStudio version and tried programming that one? Does bqStudio behave the same when programming as srec file? 

    What firmware version is your EV2400? You can find this by looking on the Dashboard to the left in bqStudio.

    Also, can you provide the dffs file you are using?

    Thank you.

  • Fernando,

    I just programmed a fuel gauge with the .srec file, and then generated a new srec, dffs, and bqfs files. They are all identical to the ones I had before. Programming with the .srec file works every time.

    My EV2400 has firmware version 0.18.

    The dffs file is attached to my original post on this thread, in the "BQ27542 Golden Files.zip" attachment.

    To program the fuel gauge, here is my sequence of operations:
    (1) Connect fuel gauge (BQ27542EVM), battery, and EV2400 to PC.
    (2) Click "Refresh" on Registers Plugin. Wait for registers to update.
    (3) Click "UNSEAL" on Commands Plugin.
    (3.1) bqStudio will hang. Wait.
    (3.2) If bqStudio hangs for a really long time, kill it, and go back to step (2).
    (4) Click "Refresh" on Registers Plugin. Wait for registers to update.
    (5) Click "UNSEAL_FULL_ACCESS" on Registers Plugin.
    (5.1) bqStudio will hang. Wait.
    (5.2) If bqStudio hangs for a really long time, kill it, and go back to step (4).
    (6) In the Programming plugin, select the desired programmable file.
    (7) In the Programming plugin, click "Program". Wait for programming to complete. If the dffs file was used, this step will sometimes fail, bricking the fuel gauge.

    To generate new files, here is my sequence of operations:
    (1) Connect fuel gauge (BQ27542EVM), battery, and EV2400 to PC.
    (2) Click "Refresh" on Registers Plugin. Wait for registers to update.
    (3) Click "UNSEAL" on Commands Plugin.
    (3.1) bqStudio will hang. Wait.
    (3.2) If bqStudio hangs for a really long time, kill it, and go back to step (2).
    (4) Click "Refresh" on Registers Plugin. Wait for registers to update.
    (5) Click "UNSEAL_FULL_ACCESS" on Registers Plugin.
    (5.1) bqStudio will hang. Wait.
    (5.2) If bqStudio hangs for a really long time, kill it, and go back to step (4).
    (6) In the Golden Image plugin, select the desired output directory.
    (7) In the Golden Image plugin, check boxes for all output formats.
    (8) In the Golden Image plugin, click "Create Image Files". Wait for generation to complete.

    Thank you,

    Adam J.
  • I spent the last few days trying to program with the BQFS file. The results are the same. Sometimes it works. Other times it fails. I've also noticed that sometimes when the BQFS file fails I'm able to recover the gauge by programming with the SREC file.

    From my I2C logs (sniffed using a TotalPhase Beagle), it seems that all goes well until there is a glitch on the I2C bus, and then the programming process is unable to recover.  The gauge remains in ROM mode after that.

    If this issue remains unresolved, I'll have to write firmware to write an SREC file to the fuel gauge. Which I was hoping to avoid.  So I'm still in looking forward to a solution.

    - Adam J.

  • Hello Adam,

    If the gauge is still in ROM mode after programming the gauge using the BQFS file, are you able to recover and enter Firmware mode by hitting the execute FW button on the Programming plugin?

    Thank you.
  • I haven't tried the execute FW button. Nor have I tried to reprogram with the BQFS file. But I have been able to recover some of the gauges by reprogramming with the SREC file.

    If the programming process fails partway through, wouldn't it be unable to run in firmware mode, since not all of the firmware is programmed?

  • Hello Adam,

    If the part is stuck in ROM mode, it doesn't necessary mean that the programming failed; maybe the only step that is failing is exiting ROM mode and entering Firmware mode, but the firmware information was programmed.
  • I understand, but when the programming fails, it's usually in the middle of the process. Not at the end. Sometimes I can recover by programming again, but many times I cannot.

    Is there any chance a virus software might interfere with the I2C programming process? My workplace is running McAfee on all its computers. Or perhaps the version of Java installed matters?
  • Hello Adam,

    It's plausible that anti-virus software may interfere with bqStudio, which may cause errors when communicating through I2C. Do you have a computer that's not running McAfee or can you set an exception on the software just in case?

    What Java version do you have? I believe the minimum requirement is Java 6. Also make sure, you are running bqStudio in administrator mode.

    Thank you.
  • Fernando,

    My personal laptop, which uses a different virus scan program and has not been configured by my employer's IT department, seems to work fine. Some form of Java 8 is running on all computers that I've been using bqStudio on.

    I believe we've found the problem!

    Thank you,

    Adam J.