附件参考文件,厂商电池数据烧录在BlockB
使用的bq27542电源管理ic,现在需要读取电池BLOCK数据块中序列号及生产日期,之前两块电池都是读不到
现在其中一块读到了,但是忽然发现代码回退这块电池还是能读到,另一个还是不行,通过读取BlockA和B数据块获取
预设一些值如下
116 enum bq27xxx_reg_index {
117 BQ27XXX_REG_CTRL = 0, /* Control */
118 BQ27XXX_REG_TEMP, /* Temperature */
119 BQ27XXX_REG_INT_TEMP, /* Internal Temperature */
120 BQ27XXX_REG_VOLT, /* Voltage */
121 BQ27XXX_REG_AI, /* Average Current */
122 BQ27XXX_REG_FLAGS, /* Flags */
123 BQ27XXX_REG_TTE, /* Time-to-Empty */
124 BQ27XXX_REG_TTF, /* Time-to-Full */
125 BQ27XXX_REG_TTES, /* Time-to-Empty Standby */
126 BQ27XXX_REG_TTECP, /* Time-to-Empty at Constant Power */
127 BQ27XXX_REG_NAC, /* Nominal Available Capacity */
128 BQ27XXX_REG_FCC, /* Full Charge Capacity */
129 BQ27XXX_REG_CYCT, /* Cycle Count */
130 BQ27XXX_REG_AE, /* Available Energy */
131 BQ27XXX_REG_SOC, /* State-of-Charge */
132 BQ27XXX_REG_DCAP, /* Design Capacity */
133 BQ27XXX_REG_AP, /* Average Power */
134 BQ27XXX_DM_CTRL, /* Block Data Control */
135 BQ27XXX_DM_CLASS, /* Data Class */
136 BQ27XXX_DM_BLOCK, /* Data Block */
137 BQ27XXX_DM_DATA, /* Block Data */
138 BQ27XXX_DM_CKSUM, /* Block Data Checksum */
139 BQ27XXX_REG_SOH, /* State of Health *//*John add*/
140 BQ27XXX_REG_MAX, /* sentinel */
141 };
142
143 #define BQ27XXX_DM_REG_ROWS \
144 [BQ27XXX_DM_CTRL] = 0x61, \
145 [BQ27XXX_DM_CLASS] = 0x3e, \
146 [BQ27XXX_DM_BLOCK] = 0x3f, \
147 [BQ27XXX_DM_DATA] = 0x40, \
148 [BQ27XXX_DM_CKSUM] = 0x60
之前电池通过bqstudio软件链接重写数据,不点击软件上的read all直接拿下来可以读到数据
点击read all后不行,,,,,,在bq27542的spec里面我看了下感觉是不是电池访问模式有区别
里面提到的两种模式我怎么感觉没啥用呢?
9.5.1 Sealed to Unsealed
This register contains the security code to transition the device from SEALED mode to UNSEALED mode.
The default code is set to 0x36720414.
9.5.2 Unsealed to Full Access
This register contains the security code to transition the device from UNSEALED mode to FULL ACCESS
mode. The default code is set to 0xFFFFFFFF.
有没有遇到这种问题的大佬帮忙看看,或者给点方法,谢谢6254.s.pdf