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.

BQ27Z746: Checksum calculation as used in the Flashstream files

Part Number: BQ27Z746
Other Parts Discussed in Thread: BQSTUDIO,

Tool/software:

I've had a look at the Flashstream files generated by BQSTUDIO. The format and sequence is pretty clear. The FAQ and application notes explain them in detail.
With one exception:

After transferring each data block (e.g. some 4096 bytes in chunks of 16 bytes), some 16bit CRC is read back and checked (i.e. 0x30 0xCB in the example below).

-> What is the algorithm used to calculate this CRC?

Since I'm not working with BQSTUDIO or the TI evaluation boards I'm missing this information and need to calculate it on my own using the data from the data block only. In order to complete the programming as indicated by the original Flashstream file.

W: ...
X: 2
....
W: 16 0F 12 F0 4F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
X: 2
C: 16 14 30 CB

  • Hello Michael,

    Today is a national holiday, and we will work on your ticket in the upcoming business days.

    Thank you,
    Alan

  • Hello Michael,

    I would recommend reading over this document, it should include sample code that has the CRC calculation: https://www.ti.com/lit/an/sluaa11b/sluaa11b.pdf

    Regards,

    Adrian

  • Hi Adrian, the document explains a 8bit CRC, while the flashstream files check a 16bit CRC.

  • Hello Michael,

    Please look at this document: https://www.ti.com/lit/an/swra111e/swra111e.pdf?ts=1752090284783

    Regards,

    Adrian

  • Hi Adrian, no success so far. Your document describes a 16-bit CRC now, but does not go into detail how this is applied to the data present in a BQ27Z746 flashstream format.

    Let me give more lines from the flashstream file:

    ;--------------------------------------------------------
    ;Go To ROM Mode
    ;--------------------------------------------------------
    W: AA 00 00 0F
    X: 1000
    ;--------------------------------------------------------
    ;Data Block
    ;--------------------------------------------------------
    W: 16 11 DE 83
    X: 200
    W: 16 0F 12 00 40 70 2F 34 81 28 BF 79 F5 3B 3F FE DA 55 49 00 00
    X: 2
    W: 16 0F 12 10 40 40 00 00 00 00 00 00 00 00 FF FF FF FF FF FF FF
    X: 2
    ...
    W: 16 0F 12 E0 4F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    X: 2
    W: 16 0F 12 F0 4F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    X: 2
    C: 16 14 30 CB
    ;--------------------------------------------------------
    ;Execute Flash Code
    ;--------------------------------------------------------
    W: 16 08 11
    X: 4000

    I want to calculate this 30 CB in the check line near the bottom. I have a generic 16-bit CRC algorithm now from your PDF. But what to feed to the calc-routine? Shall I include the device address 16? Shall I include the commands 0F 12? Shall I include the addresses 00 40.. F0 4F (it's little endian obviously)? Shall I start with the data portion from the 0F 12 line? or also include the initial 11 de 83 command? Too many unknowns to guess.

    -> What is the algorithm used to calculate this CRC? (30 CB in the example above)

  • Hello Michael,

    This is something that we do not have documented. I will have to consult over members on my team about this. Please allow me some time to get back to you.

    Regards,

    Adrian

  • Any update? Any success? BR, Michael

  • Hello Michael,

    I contacted the firmware team and they told me that this is not information I can give out publicly. BQStudio should be used to create the golden image file and then your own MCU can be used to program the golden image file onto gauges.

    Regards,

    Adrian