i2c master aborts write
Posted: Fri May 31, 2019 8:07 pm
Hey,
for some days I am trying to get an i2c connection between two ESP32 running. After having serious issues with reliability in my main project, I wanted to try around with a simple project.
I adapted the example from espressif (https://github.com/espressif/esp-idf/tr ... _self_test), so it is running on two devices, one master, one slave.
However, sometimes the master seems to just abort writing. This happens irregular and after different numbers of successfully sent bytes. The return of i2c_master_cmd_begin is either ESP_FAIL or ESP_ERR_TIMEOUT. The logic analyzer shows, that the byte-stream just stops with NAK. See attached screenshot, it's supposed to count up from 0x0a to 0x89.
My sample program is here.
https://github.com/juri117/esp32_i2c_master
https://github.com/juri117/esp32_i2c_slave
The hardware setup is:
Master ESP GPIO 18 -> Master ESP GPIO 21
Master ESP GPIO 19 -> Master ESP GPIO 22
After running this example for one minute I get at least one master write failure.
Please, any new ideas are appreciated, I don't know what else to try.
for some days I am trying to get an i2c connection between two ESP32 running. After having serious issues with reliability in my main project, I wanted to try around with a simple project.
I adapted the example from espressif (https://github.com/espressif/esp-idf/tr ... _self_test), so it is running on two devices, one master, one slave.
However, sometimes the master seems to just abort writing. This happens irregular and after different numbers of successfully sent bytes. The return of i2c_master_cmd_begin is either ESP_FAIL or ESP_ERR_TIMEOUT. The logic analyzer shows, that the byte-stream just stops with NAK. See attached screenshot, it's supposed to count up from 0x0a to 0x89.
My sample program is here.
https://github.com/juri117/esp32_i2c_master
https://github.com/juri117/esp32_i2c_slave
The hardware setup is:
Master ESP GPIO 18 -> Master ESP GPIO 21
Master ESP GPIO 19 -> Master ESP GPIO 22
After running this example for one minute I get at least one master write failure.
Please, any new ideas are appreciated, I don't know what else to try.