I've been struggling with this problem off and on for months now. I'd been getting intermittent problems when making calls to the I2C library. I've now got it recurring repeatedly. Here's the trace:
0x40122355 (the 3rd element in the backtrace) is my code (the 2nd i2c_master_write_byte() call):Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled.
Core 1 register dump:
PC : 0x4015e46a PS : 0x00060830 A0 : 0x8015f41e A1 : 0x3ffd4e40
A2 : 0x3ffd7324 A3 : 0x3ffd4e7c A4 : 0x3ffe1de8 A5 : 0x3ffbc730
A6 : 0x00000000 A7 : 0x3ffd4140 A8 : 0xfefefefe A9 : 0x3ffd4e20
A10 : 0x3ffe1d7c A11 : 0x00000014 A12 : 0x00000010 A13 : 0x3ffe1df8
A14 : 0x3ffd4eb3 A15 : 0x00000000 SAR : 0x0000000d EXCCAUSE: 0x0000001c
EXCVADDR: 0xfefeff0e LBEG : 0x4000c46c LEND : 0x4000c477 LCOUNT : 0x00000000
ELF file SHA256: 65a72938982fcd6111c3ac5a71607486e7fccfe02025477318cb5d80a8dd1f5d
Backtrace: 0x4015e46a:0x3ffd4e40 0x4015f41b:0x3ffd4e60 0x40122355:0x3ffd4eb0 0x4012288d:0x3ffd4f10 0x401119db:0x3ffd4f40 0x40111f85:0x3ffd5080 0x400926c1:0x3ffd50a0
Code: Select all
m_i2c_cmd = i2c_cmd_link_create();
if (m_i2c_cmd != nullptr)
{
//ESP_LOGI(TAG, "i2cReadReg(): m_i2c_cmd is %x.", (unsigned) m_i2c_cmd);
// build the i2c transfer.
rc = (i2c_master_start(m_i2c_cmd));
rc |= (i2c_master_write_byte(m_i2c_cmd, addrWrite, true));
rc |= (i2c_master_write_byte(m_i2c_cmd, regAddr, true));
rc |= (i2c_master_start(m_i2c_cmd));
rc |= (i2c_master_write_byte(m_i2c_cmd, addrRead, true));
rc |= (i2c_master_read(m_i2c_cmd, (uint8_t *) data, len, I2C_MASTER_LAST_NACK));
rc |= (i2c_master_stop(m_i2c_cmd));
Code: Select all
esp_err_t i2c_master_write_byte(i2c_cmd_handle_t cmd_handle, uint8_t data, bool ack_en)
{
I2C_CHECK(cmd_handle != NULL, I2C_CMD_LINK_INIT_ERR_STR, ESP_ERR_INVALID_ARG);
i2c_cmd_t cmd;
cmd.ack_en = ack_en;
cmd.ack_exp = 0;
cmd.ack_val = 0;
cmd.byte_num = 1;
cmd.op_code = I2C_CMD_WRITE;
cmd.data = NULL;
cmd.byte_cmd = data;
return i2c_cmd_link_append(cmd_handle, &cmd);
}
Code: Select all
esp_err_t i2c_isr_free(intr_handle_t handle)
{
return esp_intr_free(handle);
}
Can someone see into this at all? I know I'm getting low on heap, but I'd expect a different error if that were the cause.
Thanks...