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.

BQ27Z561: Interrupt configuration for RSOC change interrupts (and firmware version mess)

Part Number: BQ27Z561
Other Parts Discussed in Thread: , EV2400,

Hi,

I am developing a driver for BZ27Z561 and I am trying to get interrupts when the RSOC changes. According to sluubo7, I should just set "INT_EN" in "IO Config" and "SOC delta" to a non-0 value. I do both of those things (I"NT_EN" is 1, "SOC delta" is set to 1), but I never get an interrupt, even though RSOC does change (which I verified by reading RelativeStateOfCharge())  At this point, I should explain that I had an issue while trying to read and write the data flash on the IC, the issue can be seen in https://e2e.ti.com/support/power-management-group/power-management/f/power-management-forum/1310382/bq27z561-issue-with-reading-data-flash/4981582. Long story short, I am working with a flash map that is not described in any datasheet that I am aware of (the data flash offsets in sluubo7 do not apply to the particular firmware version on my IC). Furthermore, in this flash map, the "IO Config" location in data flash is shown to have this structure:

GPIO_LEVEL_EN|GPIO_POL|INT_TYPE|INT_PUP|INT_POL|INT_EN|BTP_SRC|BTP_EN
So I think that there are two likely causes for my issue:
1. The flash map that I was provided with is not fully compatible with my firmware version (as hinted in the original topic above)
And/or:
2. The bitfield definition of "IO Config" in this flash map has some fields that are not even mentioned in sluubo7. What are "BTP_EN", "BTP_SRC", "INT_PUP" or "INT_TYPE"? Are they described in some TI document that I failed to find?
At this point, I'm getting quite frustrated with a task that would've been much simpler if the documentation provided by TI was decent. Does TI support only some firmware versions on this IC? If so, which are those? If not, where can I find some more information about the firmware versions that are clearly not covered by sluubo7?
Thanks,
Bogdan
  • Hi Bogdan,

    Below is the flash map for IO Config from the bq27z561-R2 TRM that has the same structure as what you described with bit descriptions:

    I am reading through the past thread and am slightly confused on if you were able to upgrade your bq27z561 to the bq27z561-R2. Were you able to do this?

    Regards,

    Anthony Baldino

  • Hi Anthony,

    I can't download the flash map that you attached, my browser shows a broken link icon instead of a download link.

    Also, no, I didn't even try to upgrade the firmware on the BQ, since I don't have an EV2400 or any similar tool.

    Thanks,
    Bogdan

  • HI Bogdan,

    Sorry for the confusion, the link below is the bq27z561 TRM. The flash map above can be found in Section 6.4 Host Interrupts Configuration.

    https://www.ti.com/lit/pdf/sluuc54 

    Regards,

    Anthony Baldino

  • Hi Anthony,

    Thank you, I was able to advance further using the bitfield definitions in the -R2 RM. Some follow up questions:

    - I am trying to get an interrupt each time RSOC changes by 1%. To do that, I set the data flash locations "SOC delta threshold" to 1 and INT_EN in "IO config" to 1. Now I get an interrupt on the first RSOC change, but no interrupts on further change. In the interrupt handler, I write 1 to SOCDeltaSetThreshold(), but apparently that does not clear the interrupt (as hinted in the -R2 RM) or maybe something else is happening there? The documentation for SOCDeltaSetThreshold() in section 6 ("Host interrupts") of the RM is beyond unclear: "The threshold setting is configurable through SOC Delta for the initial value, and later by writing to the standard command SOCSetDeltaThreshold()." What exactly is this supposed to mean?

    - In my IC, reading "device name" from AltManufacturerAccess() returns "bq27z561", which I took to mean that I have the "original" firmware on the device (not an -R1 or an -R2, at least that's what I understood from sluubo7). However, I am using the bitfields from the -R2 RM (that you posted above), but with data flash offsets that were given to me in a .csv in the previous issue that I opened (https://e2e.ti.com/support/power-management-group/power-management/f/power-management-forum/1310382/bq27z561-issue-with-reading-data-flash/4981582), which are not similar to the ones in either sluubo7 (for the original version) or sluuc54b (for the -R2)! I think you'll agree with me that this is a complete mess. This worries me because I don't know what'll happen going further. What if TI releases a new firmware version for this IC and we won't even know that when we buy the new versions? I assume that the data flash offsets would have changed again in this new firmware, so we'd have to modify the driver again even if we might not need the functionality in this new firmware version? Unless I'm missing something, this looks like a very inefficient way to do things.

    Thanks,
    Bogdan

  • Hi Bogdan,

    I apologize for the inconvenience our documentation is causing, I will bring this up to our team immediately to work towards having clearer documentation.

    Regarding the RSOC interrupt, I believe that setting INT_EN to 1 and SOC delta threshold to 1 is correct. However when clearing the SOC_DELTA at the end of the interrupt, I believe that this bit should clear itself based on the settings in the IO Config. I will receive outside council regarding the clearing of this bit.

    If possible, can you please tell me what you currently have set for the IO configuration bits?

    Regarding the device name, this is typically based on the hardware name of the device, with the bq27z561 and bq27z561-R2 having the same hardware. If possible, would you be able to tell me which firmware version is on the device?

    Regards,

    Anthony Baldino

  • Hi Anthony,

    Thanks for your reply.

    - I set the following bits in "IO Config": INT_EN, INT_PUP and INT_TYPE, the other bits are cleared.
    - In the interrupt handler (which fires once) I read InterrupStatus() (which is 0x10, confirming that the interrupt cause is indeed an RSOC change), then I read SOCSetDeltaThreshold and also set SOCDeltaThreshold to 1 after I read it. This doesn't make the interrupt fire again.
    - Interrogating AltManufacturerAccess() 0x0002 yields this result (byte by byte):

    [0] = 0x15
    [1] = 0x61
    [2] = 0x02
    [3] = 0x01
    [4] = 0x00
    [5] = 0x15
    [6] = 0x02
    [7] = 0x04
    [8] = 0x75
    [9] = 0x02
    [10] = 0x00

    The RM doesn't explain how to interpret these in much defail (for example, I don't know what "Device Number", "Version" or "Firmware Type" are supposed to mean, 

    Thanks,
    Bogdan

  • Hi Bogdan,

    Understood, thank you for clarifying.

    I have began reading through the firmware to understand how this interrupt functions and how SOC_DELTA is set and cleared. I will update you tomorrow on my findings.

    Regarding the 0x0002 read, the data is broken up as below with the most important aspects being device number and version:

        

    For Device Number, this allocates which device this firmware is for. The read above returned 15 61, which is correct. This is the same for both the bq27z561 and bq27z561-R2 since they share the same hardware.

    Version is the firmware version that is on your device. The read above returned 02 01, which is V2.01 of the firmware. This is the most recent version of the firmware for the bq27z561, bq27z561-R1, and bq27z561-R2 devices. This also makes sense why your flash map followed the bq27z561-R2 TRM.

    Regards,

    Anthony Baldino

  • Hi Anthony,

    Thanks again for your help.

    Regarding device identification, I'm still confused. You said:

    > The read above returned 15 61, which is correct. This is the same for both the bq27z561 and bq27z561-R2 since they share the same hardware.

    Which I took to understand that my device is either a bq27z561 or a bq27z561-r2. And then you said:

    > This is the most recent version of the firmware for the bq27z561, bq27z561-R1, and bq27z561-R2 devices

    So, if the firmware number is the same for all 3 revisions, how would I know that my device is actually a bq27z561-R2 and not a bq27z561?

    Thanks,
    Bogdan

  • Hi Bogdan,

    The device can be found by the firmware version. Since you are reading V2.01 as the firmware version, this would mean you are using bq27z561-R2. I apologize for the confusing wording.

    Regarding the RSOC Interrupt, I have reached out to the firmware team to receive clarification on how the SOC_DELTA bit is cleared, to which I believe is causing the issue of the interrupt to not fire again. I will update you with their response.

    Regards,

    Anthony Baldino