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.

BQ40Z50-R1: Data Flash Power Registers not able to read/write

Part Number: BQ40Z50-R1
Other Parts Discussed in Thread: BQSTUDIO, EV2400

Hi,

I’m trying to increase charger present threshold that has starting address of 0x47DF. I’m first trying to read it’s value but I’m getting failure whenever I try to read it. I tried by giving it full access as well but still not able to read it. 

I’m able to read other registers like RaTable and other non-power related registers but for power class registers  getting error -107 from i2c_write function i.e. it doesn’t get response from i2c and it returns that there is no device connected. 


In this photo, RaTable registers i.e. 0x4102 read/write is working fine. The 0x47DF is giving error. 

  • Hi Tahir,

    Can you confirm that the I2C is SMBus compatible? If it is, would you happen to have an EVM to test reading this register through bqStudio?

  • Yes i2c is SMBus Compatible and unfortunately I don't have EVM to test through BQStudio.

  • What is the order of bytes that you are sending to the device when reading 0x47DF and 0x4102? I would like to confirm that the endianness and the format of the byte string is correct since you're not using bqStudio.

  • System is little endian. I'm using APIs from linux kernel driver which can be found here (https://github.com/tibms/kernel-4.4/blob/release/drivers/power/bq40z50/bq40z50_fg.c)

    My concern is since it is reading RaTable registers (0x4102) which shows driver is good, I tried reading other non-power registers as well and was able to read those too. But for reading Power Registors is there anything else that needs to be done? Can we read them when they are sealed? Even though I'm doing Full Access, but can they be only read/write in Full Access mode? And is there any way I can verify it's whether device is in Full Access mode? Because I'm not getting any error on i2c when I'm trying to switch to Full Access.

  • Tahir,

    If you can read the DF then the device must be in at least unsealed mode. In unsealed mode you are able to read/write DF and you dont need to be all the way in FA mode. 

    1) One thing that could be blocking you here is the [Valid Update Voltage]. If your SBS.Voltage is below this level DF updates will be blocked. 

    2) If the device is in a state of [Perm Fail] then DF writes would also be disabled.

    You don't need an EVM in order to connect to bqStudio. If you have access to the I2C pins please connected the EV2400 to it. It is the best way to get a clear picture of what might be going one.

    Thanks,

    Eric Vos

  • Ok I see. I just checked OperationStatus() and device had FA. And I read PFStatus() as well and looks like while trying to read some registers I might have written some wrong registers and corrupted DF. PFStatus() returns "0xAFAF0201" with 01 being 1st byte.

    Any way to recover it or flash default FW without BQStudio?

  • Tahir,

    Once your remove the reason for the PF, you can issue a PF clear command. You can then go to Full access mode and reflash with a fresh image. Please refer to the TRM for the correct commands and which PF's might be set. For reference a 01 is CUV meaning low cell voltage. 

    I highly recommend getting the I2C exposed and using the TI tools to get a clear picture of all the status. 

    Thanks,

    Eric Vos