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.

BQ76952: 进入UNSEAL,FULLACCESS模式失败

Part Number: BQ76952
Other Parts Discussed in Thread: BQSTUDIO

写了3个函数,分别是:

void change_to_seal()

{

     CommandSubcommands(SEAL);

}//调用该函数会让BQ76952进入到SEALED模式,测试成功;

void seal_to_unseal()

{

     Subcommands(SECURITY_KEYS, 0X0414, W2);

     delayUS(20000);

     Subcommands(SECURITY_KEYS, 0X3672, W2);

}//调用该函数不能让BQ76952从SEALED模式进入到UNSEAL模式;

void unseal_to_fullaccess()

{

     Subcommands(SECURITY_KEYS, 0Xffff, W2);

     delayUS(20000);

     Subcommands(SECURITY_KEYS, 0Xffff, W2);

}//调用该函数不能让BQ76952从UNSEALED模式进入到FULLACCESS模式;

这块代码调用时,没有任何其它与BQ76952通讯。用BQSTUDIO测试三个模式切换是没问题的。

  • 您好,请参考下面的步骤再试一下。

    • Something that was not explained too well in the TRM, is that in order to go into FULLACCESS, you first have to go into UNSEAL mode.
      • So SEAL>UNSEAL>FULLACCESS.
    • There is no length to be sent with CRC, I believe you are confusing checksum with CRC, they are different. I would recommend you read CRC section of the BQ769x2 Software Development Guide (Rev. B). You have to send the CRC every byte of data.
    • You should be able to write twice to 0x3E without needing to use 0x3F.

    The UNSEAL data sequence (in I2C with CRC), assuming a default unseal key, would go something like:

    • [W]0x10
    • 0x3E
    • 0x14
    • CRC Calculation
    • 0x04
    • CRC Calculation
    • [W]0x10
    • 0x3E
    • 0x72
    • CRC Calculation
    • 0x36
    • CRC Calculation

    You can similarly then reach FULLACCESS mode using the same method and the default FULLACCESS key (0xFFFFFFFF).

    We may revise the TRM in the future to make UNSEAL/FULLACCESS instructions clearer.

  • 该功能只能用带CRC校验方式通信吗?

  • 按照你说明的数据格式,还是不行。有没有该功能的实例代码可以提供下?

  • 您好,官网有提供BQ769x2 软件开发指南,您可以参考一下。

    www.ti.com.cn/.../zhcaai0b.pdf

  • 已经解决,谢谢了。从SEALED模式到UNSEAL模式,向0x3E、0x3F地址发送0x14,0x04,紧接着发送向0x3E、0x3F地址发送0x72,0x36,就可以了。

    从UNSEAL模式到FULLACCESS模式,向0x3E、0x3F地址发送0xFF,0xFF,紧接着发送向0x3E、0x3F地址发送0xFF,0xFF,就可以了。

    需要注意的是0x0035 SECURITY_KEYS寄存器只有在FULLACCESS模式下才有读写的权限。