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: Import data from learned sample IC to the fresh IC

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

Hello,
As I wrote in the previous thread:
e2e.ti.com/.../3202903

I use direct I2C communication between the BQ34Z100-G1 IC and  microcontroller, which act as I2C master.
Unfortunately I have not the EV2300/EV2400 device, and at this time I have no possibilites to buy it.

Currently I successfuly finished IC learning cycle for my battery.
And now I have one learned sample IC (BQ34Z100-G1)

But now, I need  export  the flash data from it, and to flash this data into three other virgin ICs

For this, I read the VB code examples, from the SLUA 665,  "Goind to production with bq34z1XX".
I speak now about the parts  where described export and import to / from DFI File.

But I see some discrepancy between the piece of code for writing DFI data into the IC
and how it is done in DF.FS files.
This applies to code on the Figure 4 (page 7)

Let me explain this:
In the sample Visual Basic code I see the next sequences (code blocks):

1) Put device into ROM mode
2) Mass erase data flash
3) Writing data into IC row by row (with checksum calculation and writnig to the IC)
4) Return from ROM mode ("Executing gas gauge programm")

From first look all seems Ok

But!

If we look at the df.fs file (Flash stream),
we will see additional data that that is written to the IC,
before the commands for mass data falsh erasure are issued.
And after writing data rows and before return from ROM mode.

For example:
In attached df.fs FlashStream file the strings with numbers
24..44
Where "C:" strings - for compare data,
"X:" strings for  delay between I2C transactions, and
"W:" strings for writing data to the IC
(The string numbers is counted from begin the df.fs file)

This block of strings, are identical in all df.fs files which I have.
These df.fs files for different packs, with different chemical IDs,
but the string block, described above, is identical.

We also see the lines “C:”, “X:” and “W:” with numbers 171..191 with data that is written to the IC,
after writing data lines and before returning from ROM mode.
These strings alse identical, in different df.fs files, but one "C:" string is differs, it is string number 177.
As follows from the documentation, this is a comparison string that is read from address / register 0x04


From all that has been said, please explain to me;

1) Can the code in SLUA 665 be used directly or must it be changed ?

2) Will the IC work correctly if I just write DFI data without additions, which are present in the df.fs file ?

3) If the code needs to be changed and additional data need to be writen,  as in the DF.FS file,
then how to calculate the value for line 177 ?


Thank you for advance,
Dmytro

0100_0_16-bq34z100G1.df.fs.zip

  • Hello Dmytro,

    1. You may need to modify the code in SLUA 665.

    2. The IC should be written using the df.fs file. We moved to the fs file from the DFI file.

    3. Let me check on this

  • Hello Kang,

    I had suspicions about outdated information in the slua665 documentation.
    Therefore, I did not apply the code that is written there.

    To change or even write completely different code is not a problem for me, in any case,
    I do not use Visual Basic, I use the C programming language for the main microcontroller.

    But I need to know what to do.
    I will be waiting for your reply.

    Thanks again,
    Dmytro

  • Hello Dmytro,

    SLUA665 provides sample code. It is not complete. It is intended as a guide for calculation of checksums.

    The DF.FS file has additional safeguards to allow device recovery in case of certain types of communication errors. Please use the DF.FS file commands for programming.

  • Hello Shirish,

    I understand your answer, but ....
    Can you explain how to make a complete DF.FS file from a learned IC or even from a fresh IC, without EV2400 and BqStudio?

    At this time, I can execute the df.fs file and flash the IC using commands from df.fs.
    But (again) how to make df.fs file from IC?

    Just for information,
    I already did export flash data, to the MCU memory, from IC using sample code from slua665.

    So I can convert the data to DF.FS format, without problem,  but I don't know about additional data/command strings, in df.fs which I described above

    Regards,
    Dmytro

  • Hello Dmytro,

    I do not think that the process to create a DF.FS file is public information. Let me check on it.

  • Hello Dmytro,

     I enquired about the DF.FS file creation process.

     DF.FS is not a standard file format. bqStudio exported the DF.FS format to simplify the data flash writing process. The DF.FS file requires no knowledge of the commands required to program data flash to the gauge. Currently the only known method to generate a DF.FS file is by using bqStudio.

    I hope this answers your question. Let me know if you have further questions.

  • Hello Shirish,

    In my project, the MCU, must have possibility to read flash data from one learned IC,
    and write this data to other unlearned ICs. This is one of the key requirements.

    Please note, I do not require the knowledge about commands in ROM mode.

    I want to know when I write data to IC;
    1) Should I use a constant block of commands from the DF.FS file (lines with numbers 22..44)
    2) How to calculate the value (checksum?) In line No. 177

    Ok, I will ask by another words:

    If I cannot use the DF.FS method and as well as follows from the Kang answer, using the DFI method described in slua665 is also not applicable....

    Then how to correctly export data from one IC  and write this data to another IC, by I2C communication ?

    Regards,
    Dmytro

  • Hello Dmytro,

    The DFI method is a valid method and was the only method for a long time. The DF.FS method is the new method that reduces the possibility of error.

    The document for the DFI method provides sample code. It does not use the checksum that gets used in the DF.FS file. The extra steps in DF.FS allow recovery of the device under abnormal conditions like very noisy communication, loss of power during programming and such. The DF.FS does not cover all risks but is less error prone. You are already aware that by using the DFI method you will be exposed to the risk that any errors in your code can brick the IC that is being programmed. The other risk that you may not be aware of is that of encountering an unexpected condition/state. The DF.FS addresses a few of these unexpected conditions but the risk is still present.

    Please ensure an ideal programming environment

    1. ensure proper power supply

    2. noise free communication setup

    3. test the code using simulated results

    before attempting to program the IC. This is not an exhaustive list though.

    Thanks for rewording the question. The main misunderstanding was regarding the use of DFI. The DFI method is still valid and applicable, just outdated.

  • Hello Shirish,

    Thank you too much for the information.
    Of course, I will comply with the conditions when I will write data to the IC.
    I will  to do this some later, and will post result here.

    Regards,
    Dmytro

  • Hello Shirish,

    I successfuly imported flash data into fresh IC.
    The data was previously exported  from learned IC.
    I used the DFI method and it work correctly :)

    Thank you very much once more.

    Regards,
    Dmytro