Page 1 of 1

ESP32 i2C support

Posted: Wed Feb 19, 2020 3:54 am
by yashdave88
Hi,

Problem statement: I am facing problem while reading registers over I2c, for CY8cmbr3116 cypress capsense controller.

Firmware details:
• ESP32 is configured as I2c master.
• Two devices are connected over I2c bus.
• Both are operating on 100Khz frequency.

ESP-IDF V3.3

I am using same i2c driver for port expander to read and write data over port.
I have verified slave address, for capsense controller and it is correct.

Could you please help me to resolve this.

Re: ESP32 i2C support

Posted: Wed Feb 19, 2020 8:44 am
by ESP_houwenxiang
Hi, yashdave88

Can you provide more information about the I2C problem you are experiencing? Such as providing waveforms during communication.

thanks !!

Re: ESP32 i2C support

Posted: Thu Feb 20, 2020 5:13 am
by yashdave88
Hi

Kindly find attached screenshot of signal. Also find attached code we are using.

Re: ESP32 i2C support

Posted: Fri Feb 21, 2020 2:08 am
by WiFive
I am facing problem
We are supposed to guess? You have to show logs and error codes.

Re: ESP32 i2C support

Posted: Tue Feb 25, 2020 8:34 am
by yashdave88
HI,

We do not receive any error code
But our register read always fail.

Here with my logs
I (232) heap_init: Initializing. RAM available for dynamic allocation:
I (239) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (245) heap_init: At 3FFB2AA0 len 0002D560 (181 KiB): DRAM
I (252) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (258) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (264) heap_init: At 4008ADE4 len 0001521C (84 KiB): IRAM
I (271) cpu_start: Pro cpu start user code
I (288) spi_flash: detected chip: generic
I (289) spi_flash: flash io: dio
I (289) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
----Port expander init done----
----hardware reset init done----
----TASK[0] Task READ ----
f8 ff fd 3f 1f 51 6d fc d3 9c c2 f4 a9 d9 20 bc
ec 2f 23 9a
----TASK[0] Task READ ----
f8 ff fd 3f 1f 51 6d fc d3 9c c2 f4 a9 d9 20 bc
ec 2f 23 9a
----TASK[0] Task READ ----
f8 ff fd 3f 1f 51 6d fc d3 9c c2 f4 a9 d9 20 bc
ec 2f 23 9a
----TASK[0] Task READ ----
f8 ff fd 3f 1f 51 6d fc d3 9c c2 f4 a9 d9 20 bc
ec 2f 23 9a
----TASK[0] Task READ ----
f8 ff fd 3f 1f 51 6d fc d3 9c c2 f4 a9 d9 20 bc
ec 2f 23 9a
----TASK[0] Task READ ----
f8 ff fd 3f 1f 51 6d fc d3 9c c2 f4 a9 d9 20 bc
ec 2f 23 9a
----TASK[0] Task READ ----
f8 ff fd 3f 1f 51 6d fc d3 9c c2 f4 a9 d9 20 bc
ec 2f 23 9a
----TASK[0] Task READ ----
f8 ff fd 3f 1f 51 6d fc d3 9c c2 f4 a9 d9 20 bc
ec 2f 23 9a
----TASK[0] Task READ ----
f8 ff fd 3f 1f 51 6d fc d3 9c c2 f4 a9 d9 20 bc
ec 2f 23 9a
----TASK[0] Task READ ----
f8 ff fd 3f 1f 51 6d fc d3 9c c2 f4 a9 d9 20 bc
ec 2f 23 9a
----TASK[0] Task READ ----
f8 ff fd 3f 1f 51 6d fc d3 9c c2 f4 a9 d9 20 bc
ec 2f 23 9a


kindly suggest.

Re: ESP32 i2C support

Posted: Thu Feb 27, 2020 9:52 am
by ESP_Sprite
How do you get that your register read always fails? From what I can see at a quick glance, that looks like mostly sane data to get from address 0xA0 in that chip.

Re: ESP32 i2C support

Posted: Mon Mar 02, 2020 7:11 am
by yashdave88
Hi,

kindly find attached code we are using.

Also find below log according to this code.

I (190) cpu_start: Project name: i2c-example
I (196) cpu_start: App version: v4.1-dev-1543-g431066f16-dirty
I (203) cpu_start: Compile time: Mar 2 2020 10:54:56
I (209) cpu_start: ELF file SHA256: 2d45717555bc47dc...
I (215) cpu_start: ESP-IDF: v4.1-dev-1543-g431066f16-dirty
I (222) cpu_start: Starting app cpu, entry point is 0x40081074
0x40081074: call_start_cpu1 at C:/msys32/home/vishakhak/esp/esp-idf/components/esp32/cpu_start.c:276

I (0) cpu_start: App cpu up.
I (232) heap_init: Initializing. RAM available for dynamic allocation:
I (239) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (245) heap_init: At 3FFB2AA0 len 0002D560 (181 KiB): DRAM
I (251) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (258) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (264) heap_init: At 4008ADE4 len 0001521C (84 KiB): IRAM
I (270) cpu_start: Pro cpu start user code
I (288) spi_flash: detected chip: generic
I (289) spi_flash: flash io: dio
I (289) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
----Port expander init done----
----hardware reset init done----
----TASK[0] Task READ ----
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00
----TASK[0] Task READ ----
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00
----TASK[0] Task READ ----
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00
----TASK[0] Task READ ----
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00
----TASK[0] Task READ ----
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00
----TASK[0] Task READ ----
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00
----TASK[0] Task READ ----
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00

Let me know any change require in code to get proper data.

Re: ESP32 i2C support

Posted: Tue Mar 03, 2020 2:03 pm
by ESP_Sprite
No, I'm not going to debug your code, especially if it's a hacked together example with remaining stuff commented out. Try some stuff yourself first: for instance, the I2C driver routines can return an error; how about actually checking if they do?