ESP32 I2C

Moderator: ESP_Bob

YONGWONG
Posts: 12
Joined: Mon Aug 09, 2021 9:47 am

ESP32 I2C

Postby YONGWONG » Thu Sep 02, 2021 7:33 am

使用ESP32的I2C做主机,单独测试从机时正常,但是并入主程序后(跑的任务多了),i2c不正常,初始化时提示如下
E (630) i2c: i2c_param_config(645): i2c clock choice is invalid, please check flag and frequency
读写数据时提示如下
E (4830) i2c: i2c_set_pin(826): scl and sda gpio numbers are the same

在i2c任务函数前增加IRAM_ATTR 也是出现这样的报错,请问是什么原因呢?应该怎么改?

YONGWONG
Posts: 12
Joined: Mon Aug 09, 2021 9:47 am

Re: ESP32 I2C

Postby YONGWONG » Sat Sep 04, 2021 2:27 am

运行几分钟后就重启,log如下:
Re-enable cpu cache.
Guru Meditation Error: Core 1 panic'ed (IllegalInstruction). Exception was unhandled.
Memory dump at 0x401506ec: 00f01da9 1d004136 000000f0
0x401506ec: i2c_ll_slave_enable_rx_it at E:/ESP32V43/components/hal/esp32/include/hal/i2c_ll.h:691
(inlined by) i2c_hal_enable_slave_rx_it at E:/ESP32V43/components/hal/i2c_hal.c:169

Core 1 register dump:
PC : 0x401506f2 PS : 0x00060031 A0 : 0x80085b1d A1 : 0x3ffb0dc0
0x401506f2: i2c_hal_update_config at E:/ESP32V43/components/hal/i2c_hal.c:223

A2 : 0x00000000 A3 : 0x00000000 A4 : 0x3ffb11d0 A5 : 0x00000000
A6 : 0x3ffbffd8 A7 : 0xffffffff A8 : 0x80085a50 A9 : 0x00000000
A10 : 0x00001000 A11 : 0x00001000 A12 : 0x00000001 A13 : 0x00000004
A14 : 0x0000abab A15 : 0x00000000 SAR : 0x00000000 EXCCAUSE: 0x00000000
EXCVADDR: 0x00000000 LBEG : 0x00000000 LEND : 0x00000000 LCOUNT : 0x00000000

Backtrace:0x401506ef:0x3ffb0dc0 0x40085b1a:0x3ffb0df0 0x400831e5:0x3ffb0e20 0x400841e6:0x3ffafe80 0x400840c9:0x3ffafea0 0x4008e559:0x3ffafec0
0x401506ef: i2c_hal_enable_slave_rx_it at ??:?

0x40085b1a: i2c_isr_handler_default at E:/ESP32V43/components/driver/i2c.c:487

0x400831e5: _xt_lowint1 at E:/ESP32V43/components/freertos/port/xtensa/xtensa_vectors.S:1105

0x400841e6: spi_flash_op_block_func at E:/ESP32V43/components/spi_flash/cache_utils.c:115 (discriminator 1)

0x400840c9: ipc_task at E:/ESP32V43/components/esp_ipc/ipc.c:62

0x4008e559: vPortTaskWrapper at E:/ESP32V43/components/freertos/port/xtensa/port.c:168

ESP_Yake
Posts: 109
Joined: Mon Mar 06, 2017 12:23 pm

Re: ESP32 I2C

Postby ESP_Yake » Thu Oct 14, 2021 7:21 am

请问你使用的IDF版本是哪个,我搜索了 master 和 release/v4.3 都没有找到错误log

Who is online

Users browsing this forum: No registered users and 13 guests