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.
Part of our product's bq35100 can't switch from Full Access mode to UNSEALED mode. Can you provide some example code for mode switch?
the bq35100 is always in Full Access mode (0,1 Full Access)
Although we can enter UNSEALED mode using EV2400+BQ Studio, the large amount of data on the I2C bus makes it hard to analysis.
Even worse, some address like 0xAB cannot find relevant definitions on datasheet.
Our current mode switch code is as follows. Are there any obvious issues with these?
switch( security ) { /* #define BQ35100_DEFAULT_SEAL_CODES 0x04143672 #define BQ35100_CTRL_SEALED 0x0020 */ case BQ35100_SECURITY_UNSEALED: txbuffer[0] = 0x3E; txbuffer[1] = ( uint8_t )( BQ35100_DEFAULT_SEAL_CODES >> 16 ); txbuffer[2] = ( uint8_t )( BQ35100_DEFAULT_SEAL_CODES >> 24 ); i2c_write( cfg->bus, txbuffer, 3, cfg->i2c_addr ); k_msleep( 100 ); txbuffer[0] = 0x3E; txbuffer[1] = ( uint8_t )( BQ35100_DEFAULT_SEAL_CODES >> 0 ); txbuffer[2] = ( uint8_t )( BQ35100_DEFAULT_SEAL_CODES >> 8 ); i2c_write( cfg->bus, txbuffer, 3, cfg->i2c_addr ); k_msleep( 100 ); break; case BQ35100_SECURITY_SEALED: txbuffer[0] = 0x3E; txbuffer[1] = ( uint8_t )( BQ35100_CTRL_SEALED >> 0 ); txbuffer[2] = ( uint8_t )( BQ35100_CTRL_SEALED >> 8 ); i2c_write( cfg->bus, txbuffer, 3, cfg->i2c_addr ); k_msleep( 100 ); break; default: return -EIO; break; }
I also referred to the slua801.pdf, but couldn't find the code related to mode switching.
So we still hope to provide us with an example code.
Thank you and best regards.
Hello,
The address 0xAA and 0xAB are actually the same. The last bit signifies if the operations is a read or write. 0xAB represents a read while 0xAA represents a write. Also, the gauge is not designed to go directly from full access to unseal mode. These are what the gauge is designed to do:
Regards,
Nick Richards