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.

DataFlash Checksum

Other Parts Discussed in Thread: BQ20Z65-R1

Hi,

I have written an app to write a DFI file to my BQ20z65-R1 (or BQ20z95) which, as per SLUA355, does the following:

Puts the device in ROM mode

Erases a row (x11)

Write a row (x10)

<repeat on every 32 bytes in the DFI>

Get checksum (0x0E)

Send x08 to start Firmware.

I have 2 questions:

1. does the command 0x11 in ROM mode erase 32 or 64 bytes?

2. how do I calculate the checksum to get the same result as the DF checksum?

Thanks

  • Hello David,

    Detailed information on the bq20z95 are in the Technical Reference Manual http://www.ti.com/lit/pdf/SLUU264

    1. The Flash blocks are read and written in 32 byte blocks for the bq20z95.  Section C.1.1

    2. The checksum is calculated automatically using the DFChecksum (0x0004) function. Section A.1.1.4

    Thanks,

  • Thanks for your reply, however this doesn't answer my questions:

    1. The datasheets don't explain what the 'erase' command does. From what I can tell, the erase command will erase 2 blocks at once (i.e. 64 bytes)... I can't find anything to confirm this for the devices I mentioned though.

    2. I realise the checksum is auto calculated but how do I calculate in software to ensure the checksum of the data I receive matches the generated checksum?

    Thanks

  • Hello David,

    Without having the actual device to test the erase function, I can only say this:

    erase = write.   If the Datasheet states that it writes in blocks of 32, then it will erase in blocks of 32 bytes.  It also states that it can write to blocks less than 32 bytes.   If the erase funcation has size parameters then it will erase the number of bytes you specify.   I don't see why it would erase in 64 byte blocks if the blocks are specified as 32. The only thing you can do is try It, I don't have access to that device.

     As for the checksum you can search the web for checksum calculations and add it to your software in VB, C or C#.   There are plenty of examples out there.  The calculation is straight forward and the same method is used for all MCUs.

    Thanks,