Other Parts Discussed in Thread: EV2400, BQSTUDIO
I've finished the code for flashing the fuel gauge via our microcontroller, but I find it is not very robust, i2c will often fail part way through the flashing process, or on occasions not start to flash due to the fuel gauge sending NAK's to every request.
When the fuel gauge is in the NAK mode (I'm presuming ROM mode) it cannot be flashed. However, BQ studio can flash the gauge by sending a sequence of bytes that somehow settle the fuel gauge back down into a programmable state.
I've logged this transaction as shown below
// Leave ROM mode
2.681803500000000,I2C,Setup Write to [0x16] + ACK
2.681895500000000,I2C,0x00 + ACK
2.682029500000000,I2C,0x0F + ACK
2.697807500000000,I2C,Setup Write to [0x16] + ACK
2.697900000000000,I2C,0x64 + ACK
2.698034500000000,I2C,0x0F + ACK
2.698142500000000,I2C,0x00 + ACK
5.929884000000000,I2C,Setup Write to [0xAA] + NAK
5.992867000000000,I2C,Setup Write to [0xAA] + NAK
6.009887500000000,I2C,Setup Write to [0x34] + NAK
6.070874000000000,I2C,Setup Write to [0x34] + NAK
6.085886000000000,I2C,Setup Write to [0x10] + NAK
6.148875000000000,I2C,Setup Write to [0x10] + NAK
9.258963000000000,I2C,Setup Write to [0xAA] + NAK
// Every response NAK, BQ Studio then sends the following magic sequence
W: 16 00 0D 00 00 00 00 00 00 00
W: 16 64 0D 00
C: 16 66 00
C: 16 04 01 08 00 00
C: 16 64 09 00
W: 16 00 0D
W: 16 64 0D 00
C: 16 66 00
C: 16 04 01 08
// Start of original data block which starts flashing without any problems
W: 16 00 04 00 00 00 83 DE
W: 16 64 65 01
C: 16 66 00
I've searched the forums on solutions and what this sequence actually does, but cannot find any useful information, most threads that ask questions on ROM mode appear to be locked without any answers.
Is it too much to ask to have some documentation on how to use this chip when it is in ROM mode?
The code examples that are provided (slua801) detail nothing about error recovery.
The fact you can 'brick' the chip when an error occurs, requiring the surface mounted component be replaced is beyond belief, anything brickable should have a recovery mode!
Cheers
Glen.