您好!
我正在尝试向 TPS25750写入补丁、但在将 PMM 写入状态为!CMD 的器件后、它将失败。
在!CMD 之前,Data1中的状态为 BMSD,我在文档中找不到有关该状态的任何信息。
我按照《主机接口技术参考手册》第53页的执行流程进行操作、并执行以下步骤:
1.检查 INT_Event1.ReadyForPatch (状态= True)
2. TPS25750的读取模式(状态= PTCH)
3.将数据写入 Data1寄存器。
如果我正确理解《主机接口技术参考手册》、数据缓冲区应如下所示:
data_buffer[0] = 0x00; // used for output data from chip
data_buffer[1] = bundle_size;
data_buffer[2] = bundle_size >> 8;
data_buffer[3] = bundle_size >> 16;
data_buffer[4] = bundle_size >> 24;
data_buffer[5] = m_patch_mode_address; // according to datasheet, address set by ADC (and 0x00) is not valid addresses
// Here address 0x10 is chosen for update
data_buffer[6] = 0x32; //Recommended from datasheet
然后、这些字节通过由 ADCIN1和 ADCIN2定义的唯一地址传输到 TPS25750。
4.将"PBM"写入寄存器 CMD1
5.读取 CMD1寄存器(状态= BMSD 恰好在写入 PMM 后、然后在10ms 后报告!CMD)
我还尝试仅传输6个字节(如表3-9中所列、忽略填充输出 DataX 的第一个空字节)。
编辑:
根据此帖子、 应省略接口文档中表3-9的输出部分、因此应发送代码
// Data structure:
// Byte 0: Byte 1 of bundle size
// Byte 1: Byte 2 of bundle size
// Byte 2: Byte 3 of bundle size
// Byte 3: Byte 4 of bundle size
// Byte 4: I2C slave address
// Byte 5: Burst Mode Timeout (recommended to be set to 0x32 (5 seconds))
static volatile uint32_t bundle_size = sizeof(tps25750x_lowRegion_i2c_array);
data_buffer[0] = bundle_size;
data_buffer[1] = bundle_size >> 8;
data_buffer[2] = bundle_size >> 16;
data_buffer[3] = bundle_size >> 24;
data_buffer[4] = m_patch_mode_address >> 1; // according to datasheet, address set by ADC (and 0x00) is not valid addresses
// Here address 0x10 is chosen for update
data_buffer[5] = 0x32; //Recommended from datasheet
我在写数据1寄存 器后尝试读回它、它返回我读回的7个字节的所有零(第一个字节表示寄存器中40字节可用数据除外)。
对失败的事情有什么想法?