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.

bq40z50 Creating & using a golden data flash image

Other Parts Discussed in Thread: BQ40Z50, BQMTESTER, BQSTUDIO

Assuming you've done a successful learning cycle on your pack, is this the sequence to create a golden data flash image for the bq40z50?

1. Start Battery Management Studio.

2. Go to the Data Memory tab and click the "Read All" button.

3. Click the "Export" button and choose a *.gg.csv filename for saving the pre-learned defaults.

4 Open the saved file in a text editor such as Notepad, and change the value of Update Status from 06
to 02, which indicates that the parameters are learned but IT is disabled (as it should be in a new pack
before calibration). Also, the cycle number in the SBS Configuration can be changed to 0.

5. Write a .senc file (with the correct chemical ID) to the bq40z50, to clear the hidden data-flash constants. This is done under the Firmware tab: click "Browse" (the one next to the "Program" button text box) to load the .senc file, make sure the "Execute after programming' checkbox is cleared, and then click "Program". (NOTE: BMStudio refers to it by "srec", not "senc".)

6. Go back to the Data Memory tab, click "Import from File" and select the gg.csv file that you modified. Then click "Write_All" to update the bq40z50.

So far, so good.

7. You are now ready to export the data-flash image (*.ROM) file to be used in production.

Based on slua665, the .DFI can be programmed by a customer, but a .ROM has to be programmed by bqMTester. But this forum posting: says that TI is not recommending the use of .DFI anymore.

How is an export to a .ROM file done with Battery Management Studio?

How can I update data flash with a .ROM file in my system, without using TI PC software?



  • Here's the answer for Step 7, with help from a few emails with Tom Cosby (TI):

    Using Battery Management Studio (aka bqStudio), go to the Firmware tab.

    Click the "Browse" button opposite from the "Read srec" button. Go to the location where you want the file saved.

    Enter the name of the srec file you want to create in the text box. Click "Save".

    Click "Read srec". This will save the entire flash contents, instructions and data, into the file. It will take a little time to read it all.

    Open the srec file with your favorite text editor. Find the last line that has an address between 0x4000 and 0x5FFF. Delete all lines that have an address above 0x5FFF. It looks like bqStudio saves the data as Motorola S3 data records, so here is how an S3 line is decoded (if you have S1 or S2 lines, Google for "Motorola s-records" to decode. This is the first data line from my 40z50 (with apologies to the colorblind!):


    Byte count = binary byte count of the ASCII pairs: (Address + Data + Checksum ASCII Characters)/2
                        = (8 + 70 + 2)/2 = 40 (binary) bytes = 0x28

    32 bit address: 0x00004000


    Checksum = 1's complement of the binary (not ASCII) representation of the ASCII pairs of the byte count, address, and data.

    Here is the first line of the instruction (program) part of the srec file:

    Delete from this line to the end of the file and save it as a different name. This is now a golden data file.

  • Hi TcPaden,

    When I follow these instructions I get an error "This file does not contain a version and would be unsafe to program". If I leave in the lines S32800100000 onwards it allows me to program successfully. 

    Presumably I should leave a couple of those lines in, any hints on which ones?



  • Hi Ben,

    Interesting. I don't know what lines we'd need. I got my info from Tom Cosby, but it wasn't a complete breakdown of their file format.

    You should repost this question so Tom can see it, since this one is marked as Answered. Maybe he'll divulge more of the format!

    I haven't gotten back to the batteries since these posts due to design changes!

    Thanks for the find.


  • Hey Ben,

    I'm finally back on this part of the project, trying to design the Test Station for our battery pack.

    Would you mind sending me the srec file that didn't work using my idea? I need to figure this out so I can completely automate the calibration and golden file download for the battery pack assembly.