Skip to content

Commit b801c8c

Browse files
authored
Merge pull request #27 from espressif/master
i2c clock stretch fix
2 parents 4337295 + c9916c4 commit b801c8c

File tree

6 files changed

+25
-7
lines changed

6 files changed

+25
-7
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ You can use [Arduino-ESP32 Online Documentation](https://docs.espressif.com/proj
2727
* [FAQ](https://docs.espressif.com/projects/arduino-esp32/en/latest/faq.html)
2828
* [Troubleshooting](https://docs.espressif.com/projects/arduino-esp32/en/latest/troubleshooting.html)
2929

30+
### Supported Chips
31+
32+
Visit the [supported chips](https://docs.espressif.com/projects/arduino-esp32/en/latest/getting_started.html#supported-soc-s) documentation to see the list of current supported ESP32 SoCs.
33+
3034
### Decoding exceptions
3135

3236
You can use [EspExceptionDecoder](https://github.com/me-no-dev/EspExceptionDecoder) to get meaningful call trace.

boards.txt

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9690,10 +9690,20 @@ deneyapmini.build.boot=qio
96909690
deneyapmini.build.partitions=default
96919691
deneyapmini.build.defines=
96929692

9693-
deneyapmini.menu.CDCOnBoot.default=Disabled
9694-
deneyapmini.menu.CDCOnBoot.default.build.cdc_on_boot=0
9695-
deneyapmini.menu.CDCOnBoot.cdc=Enabled
9696-
deneyapmini.menu.CDCOnBoot.cdc.build.cdc_on_boot=1
9693+
deneyapmini.menu.CDCOnBoot.default=Enabled
9694+
deneyapmini.menu.CDCOnBoot.default.build.cdc_on_boot=1
9695+
deneyapmini.menu.CDCOnBoot.cdc=Disabled
9696+
deneyapmini.menu.CDCOnBoot.cdc.build.cdc_on_boot=0
9697+
9698+
deneyapmini.menu.MSCOnBoot.default=Disabled
9699+
deneyapmini.menu.MSCOnBoot.default.build.msc_on_boot=0
9700+
deneyapmini.menu.MSCOnBoot.msc=Enabled
9701+
deneyapmini.menu.MSCOnBoot.msc.build.msc_on_boot=1
9702+
9703+
deneyapmini.menu.DFUOnBoot.default=Disabled
9704+
deneyapmini.menu.DFUOnBoot.default.build.dfu_on_boot=0
9705+
deneyapmini.menu.DFUOnBoot.dfu=Enabled
9706+
deneyapmini.menu.DFUOnBoot.dfu.build.dfu_on_boot=1
96979707

96989708
deneyapmini.menu.PSRAM.disabled=Disabled
96999709
deneyapmini.menu.PSRAM.disabled.build.defines=

cores/esp32/cbuf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class cbuf
6262

6363
cbuf *next;
6464

65-
private:
65+
protected:
6666
inline char* wrap_if_bufend(char* ptr) const
6767
{
6868
return (ptr == _bufend) ? _buf : ptr;

cores/esp32/esp32-hal-i2c-slave.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ esp_err_t i2cSlaveInit(uint8_t num, int sda, int scl, uint16_t slaveID, uint32_t
302302
i2c_ll_slave_init(i2c->dev);
303303
i2c_ll_set_fifo_mode(i2c->dev, true);
304304
i2c_ll_set_slave_addr(i2c->dev, slaveID, false);
305-
i2c_ll_set_tout(i2c->dev, 32000);
305+
i2c_ll_set_tout(i2c->dev, I2C_LL_MAX_TIMEOUT);
306306
i2c_slave_set_frequency(i2c, frequency);
307307

308308
if (!i2c_slave_check_line_state(sda, scl)) {

cores/esp32/esp32-hal-i2c.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "soc/soc_caps.h"
2525
#include "soc/i2c_periph.h"
2626
#include "hal/i2c_hal.h"
27+
#include "hal/i2c_ll.h"
2728
#include "driver/i2c.h"
2829

2930
typedef volatile struct {
@@ -91,6 +92,8 @@ esp_err_t i2cInit(uint8_t i2c_num, int8_t sda, int8_t scl, uint32_t frequency){
9192
} else {
9293
bus[i2c_num].initialized = true;
9394
bus[i2c_num].frequency = frequency;
95+
//Clock Stretching Timeout: 20b:esp32, 5b:esp32-c3, 24b:esp32-s2
96+
i2c_set_timeout((i2c_port_t)i2c_num, I2C_LL_MAX_TIMEOUT);
9497
}
9598
}
9699
#if !CONFIG_DISABLE_HAL_LOCKS

docs/source/getting_started.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ SoC Stable Development Datasheet
3737
ESP32 Yes Yes `ESP32 Datasheet`_
3838
ESP32-S2 Yes Yes `ESP32-S2 Datasheet`_
3939
ESP32-C3 Yes Yes `ESP32-C3 Datasheet`_
40-
ESP32-S3 No No Not Available Yet
40+
ESP32-S3 No No `ESP32-S3 Datasheet`_
4141
======== ====== =========== ===================================
4242

4343
See `Boards <boards/boards.html>`_ for more details about ESP32 development boards.
@@ -122,6 +122,7 @@ Resources
122122
.. _ESP32 Datasheet: https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_en.pdf
123123
.. _ESP32-S2 Datasheet: https://www.espressif.com/sites/default/files/documentation/esp32-s2_datasheet_en.pdf
124124
.. _ESP32-C3 Datasheet: https://www.espressif.com/sites/default/files/documentation/esp32-c3_datasheet_en.pdf
125+
.. _ESP32-S3 Datasheet: https://www.espressif.com/sites/default/files/documentation/esp32-s3_datasheet_en.pdf
125126
.. _Arduino.cc: https://www.arduino.cc/en/Main/Software
126127
.. _Arduino Reference: https://www.arduino.cc/reference/en/
127128
.. _ESP32 Forum: https://esp32.com

0 commit comments

Comments
 (0)