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: Security modes

Part Number: BQ40Z50
Other Parts Discussed in Thread: , BQKEYPACKAGER

Tool/software:

My customer looks for method to prevent using not authorized 3rd party battery on their product.

As a potential solution, he found BQ40Z50 and he is asking some questions.

  1. Is it possible to transition from SEALED mode to UNSEALED or FULL ACCESS mode?
    The datasheet states “Once in SEALED mode, the gauge can never permanently return to UNSEALED or FULL ACCESS modes” in 10.5.1 FULL ACCESS or UNSEALED to SEALED.
    While, according to 10.5.2 SEALED to UNSEALED and 10.5.3 UNSEALED to FULL ACCESS, it seems that transition from SEALD mode to UNSEALD mode and FULL ACCESS is possible.
  2. Is following understanding about UNSEALD mode correct?
    • Cannot read or rewrite the authentication key
    • Migration to FULLACCESS cannot be done unless the full access key is known
    • Firmware copying cannot be done because it cannot switch to ROM mode
  3. The customer considers to operate at UNSEALED mode since accessible information of SEALED mode is limited.
    In systems that perform authentication from the host in UNSEALD mode, is there any risk that workable counterfeit products can be made by 3rd party?

Best regards,

Shota Mago

  • Hello Shota,

    We will continue to work on your question, today is a national holiday, Memorial Day.

    Thank you,
    Alan

  • Hi Shota,

    Is it possible to transition from SEALED mode to UNSEALED or FULL ACCESS mode?
    The datasheet states “Once in SEALED mode, the gauge can never permanently return to UNSEALED or FULL ACCESS modes” in 10.5.1 FULL ACCESS or UNSEALED to SEALED.
    While, according to 10.5.2 SEALED to UNSEALED and 10.5.3 UNSEALED to FULL ACCESS, it seems that transition from SEALD mode to UNSEALD mode and FULL ACCESS is possible.

    Yes, it is possible to go from SEALED to UNSEALED to FULL ACCESS once the device has been sealed. However, once the device has been sealed once, it will revert back to a sealed state if a reset occurs.

    Is following understanding about UNSEALD mode correct?
    • Cannot read or rewrite the authentication key
    • Migration to FULLACCESS cannot be done unless the full access key is known
    • Firmware copying cannot be done because it cannot switch to ROM mode

    These are all correct.

    The customer considers to operate at UNSEALED mode since accessible information of SEALED mode is limited.
    In systems that perform authentication from the host in UNSEALD mode, is there any risk that workable counterfeit products can be made by 3rd party?

    We do not recommend operating in UNSEALED since the data flash will still be accessible at this time, allowing the user to pull and alter information from the gauge. We recommend using SEALED mode in application. Is there specific information the customer is trying to read out at this time?

    Regards,

    Anthony

  • Hi Anthony,

    Thanks for your answer.

    Actually, his question is about BQ40Z50-R2

    The customer is asking below questions.

    1. If the device has NOT been in SEALED mode at all and device has been set to UNSEALED mode, even if the device transitions to FULL ACCESS from UNSEALED mode, the device returns back to UNSEALED mode when a reset occurs?
    2. You mentioned "We do not recommend operating in UNSEALED since the data flash will still be accessible at this time".
      What kind of communication did you mean for "the data flash will still be accessible"?
      He recognizes the following types of SMBus communication. Which category do you mean?
      • Access to extended registers 0xXXXX via Manufacturer (Block) Access using addresses like 0x00 and 0x44
      • Normal access to registers with addresses other than 0x00/44
      • Access for reading and writing firmware in ROM mode
    3. As long as they can use authentication function to distinguish authentic or counterfeit, it's no problem even if authentic battery is customized by access to the data flash. 
      They would like to access like SafetyAlert, OperationStatus etc. which are not accessible in SEALED mode. 
      So they would like to operate the device in UNSEALED mode.
      Is there any concern to use authentication function and degrade its reliability by operating in UNSEALED mode?

    Best regards,

    Shota Mago

  • Hi Shota,

    If the device has NOT been in SEALED mode at all and device has been set to UNSEALED mode, even if the device transitions to FULL ACCESS from UNSEALED mode, the device returns back to UNSEALED mode when a reset occurs?

    I believe it should return to full access mode here.

    You mentioned "We do not recommend operating in UNSEALED since the data flash will still be accessible at this time".
    What kind of communication did you mean for "the data flash will still be accessible"?
    He recognizes the following types of SMBus communication. Which category do you mean?
    • Access to extended registers 0xXXXX via Manufacturer (Block) Access using addresses like 0x00 and 0x44
    • Normal access to registers with addresses other than 0x00/44
    • Access for reading and writing firmware in ROM mode

    All registers using the ManufacturerAccess() command will be available at this time. Regarding the SBS commands, their availability will be dependent on each command. Each command has their availability defined in the TRM:

    As long as they can use authentication function to distinguish authentic or counterfeit, it's no problem even if authentic battery is customized by access to the data flash. 
    They would like to access like SafetyAlert, OperationStatus etc. which are not accessible in SEALED mode. 
    So they would like to operate the device in UNSEALED mode.
    Is there any concern to use authentication function and degrade its reliability by operating in UNSEALED mode?

    Will the gauging functionality be used in this application? Changing the parameters in the data flash can severely effect the performance of the gauge here.

    Regards,

    Anthony

  • Hi Anthony,

    Thanks for your answer.

    Will the gauging functionality be used in this application? Changing the parameters in the data flash can severely effect the performance of the gauge here.

    Yes, the customer will use gauging functionality. The customer is fine as long as the device can work for authentication properly.

    • What is condition of reset which leads to mode change of SEALED/UNSEALED/FULL ACCESS?
      (e.g. when power supply is stopped for BAT/VCC?, when sending reset command?)
    • 0x0035 SecurityKeys of ManufacturerBlockAccess seems that both UNSEALED and FULL ACCESS can read/write.
      Is this command can be executed in UNSEALED mode?
      If so, there is no difference for accessible range between UNSEALED/FULL ACCESS and the device reduces risk for unintended firmware change with additional step to transition to ROM mode. Is this understanding correct?
    • What is command to access data flash?
      ―SBS command = Normal access to registers at addresses other than 0x00/44?
      ―Manufacturer(Block)Access = Access to extended registers at 0xXXXX using addresses 0x00 or 0x44
      ―Access to Data Flash = ????????????????

    Best regards,

    Shota Mago

  • Hi Shota,

    Yes, the customer will use gauging functionality. The customer is fine as long as the device can work for authentication properly

    The data flash contains the parameters used in the gauging functionality. If these get altered within the application, we cannot guarantee the correct performance of the gauge. We recommend for the gauge to be sealed in application for the safety of the data flash values.

    What is condition of reset which leads to mode change of SEALED/UNSEALED/FULL ACCESS?

    Resets will send the gauge back to SEALED.

    0x0035 SecurityKeys of ManufacturerBlockAccess seems that both UNSEALED and FULL ACCESS can read/write.
    Is this command can be executed in UNSEALED mode?

    I believe this should only be accessible in FULL ACCESS, but I will check to confirm.

    If so, there is no difference for accessible range between UNSEALED/FULL ACCESS and the device reduces risk for unintended firmware change with additional step to transition to ROM mode. Is this understanding correct?

    I believe the full firmware (.srec file) can only be programmed in FULL ACCESS.

    What is command to access data flash?
    ―SBS command = Normal access to registers at addresses other than 0x00/44?
    ―Manufacturer(Block)Access = Access to extended registers at 0xXXXX using addresses 0x00 or 0x44
    ―Access to Data Flash = ????????????????

    ManufacturerAccess() allows for access to all of the data flash.

    Regards,

    Anthony

  • Hi Anthony,

    Thank you for your answer.

    Resets will send the gauge back to SEALED

    Sorry for lack of explanation. The customer understands that reset signal transits from FULL ACCESS or UNSEALED to SEALED.

    He would like to know "what triggers resets" which leads to mode transition.

    For example, does reset happen when VCC/BAT pins become unpowered?

    Best regards,

    Shota Mago

  • Hello Shota,

    We have received your update and are working throughs a response.

    Thank you,
    Alan

  • Hi Shota,

    He would like to know "what triggers resets" which leads to mode transition.

    For example, does reset happen when VCC/BAT pins become unpowered?

    Yes, if the device is removed from power, or if it enters shutdown mode and woken back up, a reset will be performed.

    While the gauge is active, there is a reset command that can be sent to reset the device as well.

    Regards,

    Anthony

  • Hi Anthony,

    The customer understands reset occurs at following condition. If there is anything wrong, please point out.

    • ManufacturerAccess command
    • When battery cell voltage decreases (or it's removed)
    • After waking up from shutdown mode

    The customer also would like to clarify conditions to trigger shutdown mode.

    • He understands when battery pack is removed, the device will take following operations.
      Is this understanding correct?
      1. /Press pin is released by removal of battery pack
      2. The device enters BatteryPackRemoved mode because of [NR]=0&[PRES]=0.
        (At the same time, it enters InSystemSleep mode due to [IN_SYSTEM_SLEEP]=1?)
      3. Under this mode, CHG and DSG FETs are turned off
      4. At example schematic of the datasheet, PACK terminal gets decrease
      5. The device enters shutdown mode when PACK terminal voltage becomes lower than threshold
    • If above understanding is correct, connecting PACK pin to cell side of DSG FET(Q3) is able to prevent above behavior?

    Best regards,

    Shota Mago

  • Hi Shota,

    • At example schematic of the datasheet, PACK terminal gets decrease
    • The device enters shutdown mode when PACK terminal voltage becomes lower than threshold

    It is true that the PACK voltage will need to be lower than the threshold, however the Cell Voltage will need to be lower than the Shutdown Voltage at this time to enter shutdown if Voltage Based Shutdown is being used.

    Regards,

    Anthony

  • Hi Anthony,

    Thanks for your comment.

    The customer understands the device has following shutdown modes. If there is any missed item, please let me know.

    • 5.4.2 ManufacturerAccess() MAC Shutdown: Enabled by ManufacturerAccess() Shutdown command

    • 5.4.3 Time Based Shutdown: Disabled when PowerConfig[AUTO_SHIP_EN] =0

    • 5.4.4 Power Save Shutdown: Disabled when PowerConfig [PWR_SAVE_VSHUT]=0

    • 5.6.1 Enter Emergency FET Shutdown Through SHUTDN: Disabled when [NR] =0

    • 5.6.2 Enter Emergency FET Shutdown Through MFC: Enabled by manual FET control is sent to ManufacturerAccess()

    While, do you have update on accessible range of FULL ACESS/UNSEALED?

    I believe this should only be accessible in FULL ACCESS, but I will check to confirm.

    and

    I believe the full firmware (.srec file) can only be programmed in FULL ACCESS.

    Best regards,

    Shota Mago

  • Hello Shota,

    We have received your response and are working on your response.

    Thank you,
    Alan 

  • Hi team,

    Do you have any update on accessible range of FULL ACESS/UNSEALED?

    Best regards,

    Shota Mago

  • Hi Shota,

    Sorry for the delay. After testing, I do not believe the Security keys can be changed in unsealed mode, only unsealed full access.

    Same thing for the programming of the .srec, this was only available in unsealed full access.

    Regards,

    Anthony

  • Hi Anthony,

    Thank you for confirmation.

    The customer is asking other questions.

    1.

    11.5.2 SEALED to UNSEALED

    SEALED to UNSEALED instructs the device to extend access to the SBS and data flash space and clears the [SEC1][SEC0] flags. 

    Q1: At UNSEALED mode, only [SEC0] is cleared. Is above description wrong?

    2.~4.

    11.5.2 SEALED to UNSEALED

    Unsealing is a two-step command performed by writing the first word of the unseal key to ManufacturerAccess()

    11.5.3 UNSEALED to FULL ACCESS

    Changing from UNSEALED to FULL ACCESS is performed by using the ManufacturerAccess() command,

    by writing the first word of the Full Access Key to ManufacturerAccess(), followed by the second word of

    the Full Access Key to ManufacturerAccess().

    Q2: These mode transitions do not have a specific command address (such as 0x0001). Is it correct to understand that a two-word key is written to ManufacturerAccess() as the command address?

    Q3: If Q2 is correct, does this mean that the unseal key and Full Access Key need to set a two-word value that is different from the addresses specified in the ManufacturerAccess() command or DF.

    Q4: The customer understands transition of SEALED to UNSEALED and UNSEALED to FULL ACESS KEY is allowed by above command and UNSEALED/FULL ACCESS to SELAED is possible by SealDevice command.

    Is is possible to transition SEALED to FULL ACESS, FULL ACCESS to UNSEALED directly?

    5.~6.

    14.1.34 ManufacturerAccess() 0x0037 Authentication Key

    The bq40z50-R2 device also includes the capability to store the authentication key in secure memory.

    This is controlled using the SHA1_SECURE data flash bit; however, the authentication key cannot be

    written into the device using AuthenticationKey() as described above. It must be programmed using a

    separate method. Also, when using secure memory, the authentication key can only be written once and

    cannot be changed after it is written.

    Q5: What are the differences in security risks between storing the authentication key in secure memory and not doing so?

    Q6: What is "separate method" described in above?

    7.

    14.34 0x2F Authenticate()

    This read/write block function provides SHA-1 authentication to send the challenge and read the response

    in the default mode. It is also used to input a new authentication key when the MAC AuthenticationKey() is

    used.

    Q7:It seems that Authenticate() is used for writing the authentication key (128 bits), writing the challenge message (160 bits), and reading the challenge response. However, it's not sure how the switching of the write operation works. Does this mean that after sending the AuthenticationKey() command, the authentication key can only be written once

    Best regards,

    Shota Mago

  • Hello,

    We have received your request and are looking into the issue. We will provide an update soon.

    Regards,

    Anthony

  • Hi,

    I understand I posted many questions and it takes time for preparing answer.

    Could you please provide answer for some of them? It doesn't need to be answered all at once.

    Best regards,

    Shota Mago

  • Hi Anthony,

    Would it be possible to answer for the questions?

    Best regards,

    Shota Mago

  • Hi,

    10 days past since last questions was posted and the customer complains no answer for the duration.

    Best regards,

    Shota Mago

  • Hi team,

    More than 2 weeks past since las question was posted. The customer seriously complains support.

    Could you answer questions ASAP? 

    Best regards,

    Shota Mago

  • Hi Shota,

    Q1: At UNSEALED mode, only [SEC0] is cleared. Is above description wrong?

    You are correct, the UNSEALED mode should only have the SEC0 cleared, where the FULL ACCESS should have the SEC1 cleared.

    Q2: These mode transitions do not have a specific command address (such as 0x0001). Is it correct to understand that a two-word key is written to ManufacturerAccess() as the command address?

    Correct.

    Q3: If Q2 is correct, does this mean that the unseal key and Full Access Key need to set a two-word value that is different from the addresses specified in the ManufacturerAccess() command or DF.

    No, the gauge is observing to see if the two commands are sent within 4 seconds of each other for the unseal. Since there will be no payload information and the commands are separated, there should be no effect to the data flash.

    Q4: The customer understands transition of SEALED to UNSEALED and UNSEALED to FULL ACESS KEY is allowed by above command and UNSEALED/FULL ACCESS to SELAED is possible by SealDevice command.

    Is is possible to transition SEALED to FULL ACESS, FULL ACCESS to UNSEALED directly?

    No, the only process is to go from sealed to unsealed to full access, and back to sealed.

    Q5: What are the differences in security risks between storing the authentication key in secure memory and not doing so?

    Q6: What is "separate method" described in above?

    When programming to secure memory, it cannot be read back. If it is programmed to the data flash, it can be read back.

    I believe the https://www.ti.com/tool/BQKEYPACKAGER would need to be used.

    Q7:It seems that Authenticate() is used for writing the authentication key (128 bits), writing the challenge message (160 bits), and reading the challenge response. However, it's not sure how the switching of the write operation works. Does this mean that after sending the AuthenticationKey() command, the authentication key can only be written once

    Correct.

    Regards,

    Anthony

  • Hi Anthony,

    Thank you so much for your answer!

    The customer is asking other quesions.

    Q1

    Does writing the authentication key to the data flash mean that it is written using the AuthenticationKey (0x0037) or Authenticate() (0x2F) command?

    (In this case, the authentication key can be read, but if it is written from BQKEYPACKAGER, it cannot be read?

    Q2

    Regarding the Unsealed key (or Full Access key), for example, if it is set to 0x0010 and 0x0011, the customer thinks that when transitioning from Sealed to Unsealed, ManufacturerAccess() will be performed as follows.

    At this time, does the device unintentionally enter Shutdown Mode or Sleep Mode?

    Command = 0x00. Data = 00 10 (0x0010: same as ShutdownMode

    Command = 0x00. Data = 00 11 (0x0011: same as SleepMode

    Best regards,

    Shota Mago

  • Hi team,

    Could you please answer for latest questions?

    Best regards,

    Shota Mago

  • Hi team,

    Could you answer latest questions?

    Best regards,

    Shota Mago

  • Hi team,

    Almost 2 weeks passed since latest question was posted. Could you please answer?

    Best regards,

    Shota Mago

  • Hi Shota,

    Q1

    Does writing the authentication key to the data flash mean that it is written using the AuthenticationKey (0x0037) or Authenticate() (0x2F) command?

    (In this case, the authentication key can be read, but if it is written from BQKEYPACKAGER, it cannot be read?

    Writing to the data flash can be found below. Your second statement is correct:

    Q2

    Regarding the Unsealed key (or Full Access key), for example, if it is set to 0x0010 and 0x0011, the customer thinks that when transitioning from Sealed to Unsealed, ManufacturerAccess() will be performed as follows.

    At this time, does the device unintentionally enter Shutdown Mode or Sleep Mode?

    Command = 0x00. Data = 00 10 (0x0010: same as ShutdownMode

    Command = 0x00. Data = 00 11 (0x0011: same as SleepMode

    I believe these commands can only be used in FULL Access, so if the gauge is in either of the other states I believe it should use these for security.

    Regards,

    Anthony

  • Hi Anthony,

    Let me ask Q1 and Q2 from another perspective.

    Q1. 

    Previously, you mentioned below.

    When programming to secure memory, it cannot be read back. If it is programmed to the data flash, it can be read back.

    I believe the https://www.ti.com/tool/BQKEYPACKAGER would need to be used.

    When authentication key is written to data flash using AuthenticationKey(0x0037) or Authenticate()(0x2F) command, authentication key can be read.

    While, if authentication key is written using BQKEYPACKAGER, it cannot be read. 

    Is this understanding correct?

    16.1.35 in Technical Reference Manual states "There is no direct read access to the authentication key".

    Could you elaborate what method can/cannot prevent read of authentication key? 

     

    Q2.

    I believe these commands can only be used in FULL Access

    0x0010(ShutdownMode) command can be used in SEALED mode as well according to Table 14-1. ManufacturerAccess() Command List.

    Regarding two-words of Unsealed Key/Full Access Key, is it necessary to use different value from ManufactureAccess() Command?

    Best regards,

    Shota Mago

  • Hi, 

    Could you please answer latest questions?

    Best regards,

    Shota Mago

  • Hi, 

    2 weeks passed since last question posted. Could you please answer?

    Best regards,

    Shota Mago

  • Hi Shota,

    When authentication key is written to data flash using AuthenticationKey(0x0037) or Authenticate()(0x2F) command, authentication key can be read.

    While, if authentication key is written using BQKEYPACKAGER, it cannot be read. 

    Is this understanding correct?

    16.1.35 in Technical Reference Manual states "There is no direct read access to the authentication key".

    Could you elaborate what method can/cannot prevent read of authentication key?

    The main difference between writing the key via BQKEYPACKAGER and AuthenticationKey() is the amount of times it can be programmed. With AuthenticationKey() this can be done multiple times since it is stored in the data flash. With BQKEYPACKAGER, this can only be written once. 

    For both, it cannot be read back out, however the Response can be used to verify the value of it.

    Regarding two-words of Unsealed Key/Full Access Key, is it necessary to use different value from ManufactureAccess() Command?

    Please avoid setting these as the same values as the other commands.

    Regards,

    Anthony