SLUUCO9A April 2023 – November 2023 BQ28Z620
Accessing data flash (DF) is only supported by the MACSubcmd() by addressing the physical address.
To write to the DF, send the starting address, followed by the DF data block. The DF data block is the intended revised DF data to be updated to DF. The size of the DF data block ranges from 1 byte to 32 bytes. All individual data must be sent in Little Endian.
Write to DF example:
Assuming: data1 locates at address 0x4000 and data2 locates at address 0x4002. | ||||
Both data1 and data2 are U2 type. | ||||
To update data1 and data2, send a block write with command = 0x3E | ||||
block = | starting address + DF data block | |||
= | 0x00 + 0x40 + data1_LowByte + data1_HighByte + data2_LowByte + data2_HighByte | |||
To read the DF, send a block write to the MACSubcmd(), followed by the starting address, then send a block read to the MACSubcmd(). The return data contains the starting address followed by 32 bytes of DF data in Little Endian.
Read from DF example: | ||||
Taking the same assuming from the read DF example, to read DF: | ||||
a. Send the write block with command 0x3E, block = 0x00 + 0x40 | ||||
b. Send the read block with command 0x3E | ||||
The returned block | = a starting address + 32 bytes of DF data | |||
= 0x00 + 0x40 + data1_LowByte + data1_HighByte + data2_LowByte + data2_HighByte.... data32_LowByte + data32_HighByte | ||||
The gauge supports an auto-increment on the address during a DF read. This greatly reduces the time required to read out the entire DF. Continue with the read from the DF example. If another read block is sent with command 0x3E, the gauge returns another 32 bytes of DF data, starting with address 0x4020.