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.

BQ27510-G3: Writing DFI File, and how to recover from a failed DFI write?

Part Number: BQ27510-G3
Other Parts Discussed in Thread: BQ27510, BQSTUDIO, , EV2400

I am attempting to write the DFI file to a BQ27510.  I am having to write my own 'driver' to write the DFI file through our production tester, and I have to saw I am a little confused by all of the scattered documentation, various file formats, etc.

I finally stumbled on "SLUA801 - Gauge Communication", and found the section describing the df.fs file format. My understanding is that the entire DFI update process can be accomplished by simply following the "W:", "C:" and "X:" commands per section 5 on the app note, correct?

However, I am getting an comparison error about 75% through the ROM write section.  At this point the device is in ROM mode, and am not sure how to get it back to a state where I can try again.

So, 

1) How do I recover from a comparison error? Do I need to get out of ROM mode and start from scratch, or start from the beginning of the 'ROM write' section again, etc?

2) Any hints for troubleshooting why the comparison operation failed?  Is there an app note I can look at to try to figure out what it is trying to write when the comparison fails?

Thanks...

  • Ok, I figured out I can 'restart' writing the file from the 'Data block' section since the devices is already in ROM mode.

    The current error occurs on the following lines:

    ...
    W: 16 64 05 00
    X: 170
    C: 16 66 00
    C: 16 04 FD 7E 81 87
    ...

    Instead of  FD 7E 81 87, I am getting back 93 2D 8D D3

  • Hello Luis,

    1)

    You don't need to start from scratch, just go back to right after you went into ROM mode and it should get you out of that error.

    2)

    The best way is to check the lines with a logic analyzer to make sure the correct commands are being sent. I would continue to use the app note you referenced in your post.

    You can use bqStudio to program the DFI file as well and log the commands being sent to check with yours as well.

    Sincerely,

    Wyatt Keller

  • Hi Wyatt,

    Thanks for the hint about using BQstudio.  I'll give that a try.

    Another data point is that I tried programming the .bq.fs file (i.e., including the firmware image), starting right after entering ROM mode.  My code went through 2000+ lines with no errors until it got to the same line I referenced above in the flash image section.

    After that I tried starting again with just the .df.fs file, after entering ROM, it keeps failing at the same place.

    Part of my problem is that I have no idea what the expected reply (or the reply I am actually getting) means. Am I missing some datasheet or app note that explains this, or is this TI proprietary data?

  • Here are my suggestions.
    a) Go to the Programming Window in the bqStudio, program your bq.fs file or dt.fs file and see if you program the file successfully.  In this way, you can determine whether there is something wrong with the bq.fs or dt.fs file.
    b) Use a logic analyzer to capture the entire sequence and implement the same sequence in your production tester.
    c) Add a small delay (e.g. 2 or 3 ms) between i2c writes.
    d) Use the 100kHz i2c clock speed.
    Andy
  • Hi Andy,

    I ended up hooking up a logic analyzer and the EV2300 directly to my board, and trying to use bqstudio (1.3.86) to program the df.fs file as you suggested.  It errored-out at the same line number my own software was stopping at.

    So, I have been trying to generate a new DFI file with bqstudio.  Unfortunately I have not been able to get past the 'Parameter Q&A' section -- I keep getting the error "Error writing to the data memory; Parameter value does not match type and data format" .  I'll start a separate support topic to see if we can figure that one out, and come back here once I have a new DFI file.

    Thanks!

  • Okay. I see your new post and our software expert will help you with it.  

    Andy

  • Ok, I did a test today (and ended up bricking the gauge)....

    In bqStudio, I clicked on 'Golden Image' and extracted the image files from a working bq27510-G3.   I then went to Programming and programmed the file I had just extracted.  I programmed the .srec file.  In hindsight, I probably should have just done the .df.fs file.

    bqStudio programmed the file successfully (or at least that is what the pop-up window said at the end of the programming operation).  However, once it finished programming, the device quit responding.  I clicked on the 'Execute FW' button, but it just shows the error "Failed to execute Firmware - No acknowledgement from device".

    Is there some obvious step I'm missing here?

  • If you just program the srec file,  will the device also fail?
    Andy
  • Hi Andy,

    Yes, trying to program the .srec file also bricked the device.

    I decided to take step back and try to get this process to work on the eval board.

    • Place new bq27510-g3 on the eval board and connect eval board to EV2300 and to my battery
    • Open bqStudio, verify I can see the device and it responds to commands.
    • Making no changes, go to 'Golden Image' and click on "Create Image Files".  
    • After several seconds, I see the pop-up "Golden image files were created successfully"  and my .srec, bq.fs and df.fs files now appear on disk.
    • However, I noticed the error "ROM Command results returned invalid checksum" on the lower left corner of the bqStudio window!  (see the attached image).

    Is it possible that bqStudio is generating corrupted or otherwise invalid image files even though it says 'files were created successfully', and this is why I keep bricking these devices when trying to program them?

  • Hello Luis,

    It is possible some of the data could be transferred incorrectly, the EV2400 is recommended for gauge communication, I would also try using the test version of bqStudio along with the EV2400.

    The ROM error appears after bqStudio successfully the golden files?

    Sincerely,

    Wyatt Keller

  • Hi Wyatt,

    What exactly is the difference between the EV2300 and EV2400 that makes one recommended over the other? are they not both USB-to-I2C interfaces? Can I truly expect bqStudio to not be as flaky with the EV2400? 

    At this point I'm willing to try anything, so I'll buy the EV2400 and report back next week.  I would suggest that the web team update the bq27510EVM page, though, as it specifically says the EV2300 is required with the eval board.

    Regarding the bqstudio version, I am running version 1.3.86.  Help/About shows it as "1.3.86, Build Date: June 8, 2018".  I went to the website just now and downloaded the version listed there -- shown as v1.3.86.6, with a date of 13 Jan 2020 -- however, after downloading the file, it's identical to what I have.  So, can you please confirm what is the actual latest version of bqStudio?

    Regarding the ROM error - I tried to do it again, this time paying more attention to the bottom left corner of the window.

    1. Open bqstudio

    2. Immediately turn off Auto refresh.

    3. Click on 'Golden Image" -- within a few seconds of being on the Golden Image tab, without clicking on anything, I see the error "Packet checksum mismatch" on the lower left corner.  

    4. Click on A few of the commands in the Command window (DEVICE TYPE, FW VERSION, CONTROL STATUS, etc.) -- just to confirm I can communicate with the gauge -- No errors are shown here and the gauge responds with the expected data.  The Packet checksum mismatch is replaced with I2C Read Block: Operation Executed Successfully.

    5. Click back on the Golden Image tab, and "Packet checksum mismatch" appears again.

    6. Clicked on 'Create Image Files' and immediately saw the ROM Command Results returned invalid checksum error, even though the software continues to read the flash until it goes through the entire memory and displays the "Golden Image Files were created successfully". While the software is reading data, every once in a while I'll see another red message flash by on the lower left corner, but it goes by too fast to read.

    Also, just for completeness, the battery voltage is around 4V, and the I2C signals look 'clean' when viewed on a scope.

  • Hello Luis,

    The EV2400 is the supported device that continues to get updates, the EV2300 is no longer updated for new applications but can still work for some gauges.

    I see on the webpage it is recommended, I'll see if this can be changed.

    The new updated bqStudio should be version 1.3.101, it is the test version of bqStudio and has some bug fixes in it that could relieve your communication issue. On the bqStudio page there is BQSTUDIO-STABLE and BQSTUDIO-TEST.

    Sincerely,

    Wyatt Keller

  • Hi Wyatt,

    Thanks.  I received the EV2400 today and installed version 1.3.101 of bqstudio.  I was able to read a flash image and program it back on the EVM.  On my own board, with a 'bricked' device from trying to use the previous version of bqStudio, I was able to program the .srec file and get it work again.

    I will now attempt to run a new learning cycle on my board and see if I can extract a valid 'golden file'.

    So far so good...but why oh why do you guys have a version called BQSTUDIO-STABLE that's full of bugs, and another one called BQSTUDIO-TEST (which, judging from the readme.txt file, is about 10 versions newer!) that actually works?? ;)

    Anyway, I'll come back here in a couple of days after (hopefully) being able to run a successful learning cycle and programming a DFI file.

    Thanks!

    Luis

  • Hi All,

    Just wanted to come back and put some closure to this.

    After using the EV2400 and the 'TEST' version of bqStudio, I was able to extract a valid DFI file with no errors.  I also noticed the constant stream of errors when trying to read the memory with bqStudio is gone. 

    I was able to use this DFI file to program the gauge on my own board with my own programmer and software tools (with no modifications).  So, my guess is that when I was using outdated eval hardware and software, the DFI file being read from the device was corrupted.

    Note that even with the newer bqStudio version, the 'Q&A section' is still unusable.  I just went directly to the flash memory section and manually put in the parameters for my system.

    Thanks again for the help.

    Luis