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.

BQ27742-G1: Update the firmware from Application Processor via I2C

Part Number: BQ27742-G1
Other Parts Discussed in Thread: BQSTUDIO

Hello there,

We are using many BQ27742-G1 in our products, and we use Battery Management Studio to program the firmware during production time, which doesn't have any problem. However, we would like the application main processor is able to program the firmware via I2C interface. what I know is it must enter ROM mode(AA 00 00 0F), and then use device address (0x0B 7bit), The golden image bqfs file lists all I2C commands, but I don't fully understand the commands meanings. Doesn't any one have the experience? or tell me the commands meanings, for instance, the following commands:

W: 16 00 04 00 00 00 83 DE
W: 16 64 65 01

W: 16 00 02 00 00 00 EA FF 33 EB FB 33 6D FC 33 65 FE 33 7D FE 33 FF FF 3F FF FF 3F FF FF 3F FF FF 3F FF FF 3F FF FF 3F FF FF 3F FF FF 3F FF FF 3F FF FF 3F FF FF 3F 03 01 3F 58 CB 33 ED 00 08 00 00 00 00 00 00 FF AA 0E FB A7 0E FF A6 0E FF A1 0E FF A0 0E FE A3 0E 47 A2 0E D2 FF 3A FF A1 0E 58 A0 0E FF A3 0E
W: 16 64 CE 35

Thanks in advance.

  • Hi Shirish,

    Probably my question is not clear. My intension is to program the .srec firmware into the BQ27442-G1. I have converted the .srec file to a C file ( an const array), then I am going to program the array data into the BQ27742-G1. What I mean commands are the byte following the ADDR 0x16, e.g. 0x00, 0x64, 0x66, 0x65.  Another thing is that it is always sending 16 64 XX YY " after writing 32 bytes data,  where are the data "XX" and "YY" from, are they checksum? if it is checksum, how to calculate the checksum?

  • The .srec file doesn't include the commands that are necessary for the gauge to understand how to program the data from the .srec to flash. bqStudio generates this internally so when you program an .srec, bqStudio issues the necessary commands in the background.

    The .bq.fs file contains the commands as well as all the information from the .srec file. Please use the .bq.fs file instead.

  • Hi there,

    Thank you for your reply. 

    What I am going to do is to program the data included in the .srec file into Bq27742-G1. Therefore, the first thing I have to do is to convert the .srec to C file where an array[] includes all data, and I have done this step. Then I am going to program the data defined in the array into BQ27742-G1,. that is why I asks the command, because .srec file doesn't include the commands. I captured all commands issued from bqStudio, but don't understand the capture so I can't  program the array data into the BQ chip. If there is a document to explain the commands, that will be great.

  • Please do not use the .srec file. Please convert the data from the .bq.fs file into a header file.

    TI does not provide the information how to convert a .srec file to a list of commands that the gauge understands.

    bqStudio does this for you with the .bq.fs file. See slua801 how to parse the .bq.fs file.

  • Thank you for providing me the important document. My host uC doesn't support a file system, in the document, it says "If the host uC does not support a file system, the content of the FlashStream file can be copied into a constant zero-terminated C-string (for example, in a header file which is then compiled into the firmware image)." what I want is the C-string. I appreciate it if you can provide more information for how to get the Constance zero-terminated C-string from .bq.fs file..

    Thanks so much in advance.

  • Hello Joan,

    Different compilers can act differently. If your compiler can accept a static string, then you can enclose the content of the file in double quotes and use backslash to spread over multiple lines. Or you can simplify into a custom format to save space.