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.

BQ28Z610: Flash srec without using bqStudio

Part Number: BQ28Z610
Other Parts Discussed in Thread: BQSTUDIO, EV2400

Hi,

Good day. I need to automate onboarding of our power supply board in which bq28z610 is used. I am more specific about flashing a srec image to the bms and we have been doing this manually with the use of the Firmware tab on bqStudio. Is there a headless mode for bqStudio where i can send commands to EVM2400 thru command line? I came accross an article regarding bqSDKTools and that I would need to contact you for download access. (and this I hope that this is the tool i am looking for, plus some examples). Thank you so much and more power.

Best regards,

Adrian

  • Hello Adrian,

    We have a app note on developing a flash stream parser to update gauges quickly, I would recommend following it: www.ti.com/.../slua801

    Sincerely,

    Wyatt Keller

  • Hi Wyatt,

    I saw that an srec file can be converted to bqfs file using bqStudio. However, the tool is only present if I launch the 2610_1_01-bq28z610R1.bqz from the supported targets. I have always used the 2610_0_17-bq28z610.bqz because that is the default frimware version when we receive our board from assembly and 2610_0_20-bq28z610.bqz  after updating since we are running the 0_20 fw version. Will there be no conflicts or incompatibility issues regarding the generated bqfs file? I am assuming compatibility but I need to be sure of this.

    And from SLUA801, has someone been successful on updating firmware on bq28z610 following this app note? 

    Thanks,
    Adrian

  • Hello Adrian,

    You can flash the R1 firmware and it should run fine, then you can use the R1 bqz to program using flash stream.

    The app note as been used for multiple gauges and is designed for any gauge that supports flash stream files.

    Sincerely,

    Wyatt Keller

  • Hi Wyatt,

    I followed what you said. I was able to modify the c code to run on an MCU. I was wondering why it doesn't work as I completely understood how the gauge_execute_fs function parsing works in gauge.c 

    Then I used EVM2400 and bqStudio to communicate with bq28z610 and try to write line by line the generated bqfs file. Start of the file looks like this.

    W: AA 3E 33 00
    X: 1000
    W: 16 09 00 00
    W: 16 0A CC 00
    W: 16 09 02 00
    W: 16 0A 00 00
    W: 16 00 00 00
    W: 16 1A DE 83
    W: 16 06 00 00
    X: 250
    W: 16 00 80 00
    W: 16 1A DE 83
    W: 16 06 80 00
    X: 250
    W: 16 09 00 00
    W: 16 0A CC 00
    W: 16 09 02 00
    W: 16 0A B8 00
    W: 16 00 80 01
    W: 16 1A DE 83
    W: 16 06 80 01
    X: 250
    W: 16 09 00 00
    W: 16 0A CC 00
    W: 16 09 02 00
    W: 16 0A 00 00
    W: 16 11 DE 83
    X: 400
    W: 16 07 DE 83
    X: 250
    W: 16 0F 22 00 40 77 2F AD BF 66 BF 91 4A 9D 3F 68 F6 B2 48 00 00 40 00 00 00 00 00 00 00 00 FF FF FF FF FF FF FF
    X: 3
    W: 16 0F 22 40 40 20 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 7A 78 79 30 31 32 33 34
    X: 3
    W: 16 0F 22 60 40 35 76 08 1B 33 00 00 21 00 01 00 11 54 65 78 61 73 20 49 6E 73 74 72 75 6D 65 6E 74 73 00 00 00

    ............

    And right away at the 5th line, the bms stopped responding. Exactly the same line where the MCU reports i2c error.

    Just what I was mentioning if it will work on bq28z610. I hope you can help me how to proceed with this.

    Thanks and regards,

    Adrian

  • Hello Adrian,

    You should be able to program the gauge in the Programming tab, not in the advanced comm tab. Did the programming not work in either the programming tab or the MCU?

    Sincerely,

    Wyatt Keller

  • Hi Wyatt,

    Ah, you think I was trying to flash firmware thru the Advanced Tab. That might take a week to finish. 

    What I did was to check sending the first few lines of the bqfs file manually using EV2400, which is also what gauge_execute_fs from gaugce.c in the app note you mentioned is basically doing. 

    Using the MCU, the bqz28z610 stops responding on the 5th line (W: 16 09 02 00)
    Using the EV2400, the bqz28z610 stops responding when I reach the 5th line as well.

    Which means there is something wrong with the bqfs file generated.

    Thanks for your help.

    Regards,

    Adrian

  • Hello Adrian,

    I was checking to see if you were having issues with the normal uploading process.

    Can you share your .srec and bq.fs files? I would like to try on my side to see what issue you're running in to.

    Sincerely,

    Wyatt Keller

  • Hi Wyatt,

    Sorry for the late reply. I ended up with a different approach which works so far. I killed 2 ic's because of wrong flashing but i found my mistake.

    I had a logic analyzer connected to the I2C lines while flashing the srec file thru bqstudio. Every byte read and written is recorded in a file and that is what i used. Parsing the file with python and sending the commands to the MCU connected to the BMS I2C.

    The beginning of the file looks like this, right before the DF flashing starts. I inserted the delays based on the bqfs file generated from before.

    Start, hAA [ h55 | WR ], h00, h33, h00, Stop
    Delay, 1000
    Start, h16 [ h0B | WR ], h00, 
    Restart, h17 [ h0B | RD ], h17, h17 NAK, Stop
    Start, h16 [ h0B | WR ], h0D, 
    Restart, h17 [ h0B | RD ], h01, h91, hD8 NAK, Stop
    Start, h16 [ h0B | WR ], h09, h00, h00, Stop
    Start, h16 [ h0B | WR ], h0B, 
    Restart, h17 [ h0B | RD ], h02, h00, h6D NAK, Stop
    Start, h16 [ h0B | WR ], h0A, h0A, h00, Stop
    Start, h16 [ h0B | WR ], h09, h02, h00, Stop
    Start, h16 [ h0B | WR ], h0A, h00, h00, Stop
    Start, h16 [ h0B | WR ], h00, h00, h00, Stop
    Start, h16 [ h0B | WR ], h1A, hDE, h83, Stop
    Start, h16 [ h0B | WR ], h06, h00, h00, Stop
    Delay, 250
    Start, h16 [ h0B | WR ], h00, h80, h00, Stop
    Start, h16 [ h0B | WR ], h1A, hDE, h83, Stop
    Start, h16 [ h0B | WR ], h06, h80, h00, Stop
    Delay, 250
    Start, h16 [ h0B | WR ], h09, h00, h00, Stop
    Start, h16 [ h0B | WR ], h0B, 
    Restart, h17 [ h0B | RD ], h0A, h00, hC5 NAK, Stop
    Start, h16 [ h0B | WR ], h0A, h0A, h00, Stop
    Start, h16 [ h0B | WR ], h09, h02, h00, Stop
    Start, h16 [ h0B | WR ], h0A, hB8, h00, Stop
    Start, h16 [ h0B | WR ], h00, h80, h01, Stop
    Start, h16 [ h0B | WR ], h1A, hDE, h83, Stop
    Start, h16 [ h0B | WR ], h06, h80, h01, Stop
    Delay, 250
    Start, h16 [ h0B | WR ], h09, h00, h00, Stop
    Start, h16 [ h0B | WR ], h0B, 
    Restart, h17 [ h0B | RD ], h0A, h00, hC5 NAK, Stop
    Start, h16 [ h0B | WR ], h0A, h0A, h00, Stop
    Start, h16 [ h0B | WR ], h09, h02, h00, Stop
    Start, h16 [ h0B | WR ], h0A, h00, h00, Stop
    Start, h16 [ h0B | WR ], h11, hDE, h83, Stop
    Delay, 400
    Start, h16 [ h0B | WR ], h07, hDE, h83, Stop
    Delay, 250

    I saw some differences compared to the output of the srec to bqfs converter from bqStudio (please see my previous post). Maybe that explains why it didn't work. Hope this helps.


    Thanks and regards,

    Adrian

  • Hello Adrian,

    I'm glad you were able to get it working, thanks for posting an explanation to hat you encountered to help others.

    Sincerely,

    Wyatt Keller