Go to file
chuck todd b05430cfd9 Wire ReSTART fix, with others (#1717)
* ReSTART fix, Sequencing fix

pr #1665 introduce a problem with ReSTART, when solving this problem I found an interaction between the TxFifo refill, RxFifo empty and CMD[] fill.  during certain sequences a dataqueue command would be skipped, this skipping resulted in a mismatch between the contents of the TxFifo and the i2c command sequence.  The problem manifested as an ACK error. 
In addition to this required bug fix I propose:
* `Wire.begin()` be changed from a `void` to a `bool` this will allow the reset functionality of `Wire.begin()` to be reported.  Currently `Wire.begin()` attempts to reset the i2c Peripheral, but cannot report success/failure.
* `Wire.busy()` be added. this `bool` function returns the hardware status of the bus. This status can be use in multi-master environments for application level interleaving of commands, also in single master environment, it can be used to detect a 'hung' bus.  With the functional change to `Wire.begin()` this allows app level recover of a hung bus.
* `Wire.lastError()` value updated for all errors, previously when interleaving `Wire.endTransmission(false)` and `Wire.readTransmission(false)`, the 128 byte `Wire.write()` buffer was exhausted without generating and error(very exotic). I discovered this error when I created a sequence of directed reads to a EEPROM. Each directed read used 2 bytes of the 128 byte `write()` buffer, so after 64 consecutive ReSTART writes with ReSTART reads, `Wire()`  had no room to record the directed address bytes.  It generated just a NAK check without setting the EEPROMs internal register address.  The succeeding ReSTART read succeeded at incorrect address.
* Changes to the HAL layer:
** added `i2cGetStatus()` which returns the i2c peripheral status word, used to detect bus_busy currently
** added `i2cDebug()` programmatic control of debug buffer output
** changed `i2cAddQueue()` to allow data_only queue element this will allow a i2c transaction to use multiple data pointers.
** removed direct access to DumpInts(), DumpI2c() from app, use i2cDebug() to set trigger points 
 
*

* Update esp32-hal-i2c.c

* Update Wire.cpp

* ReSTART, Sequencing

pr #1665 introduce a problem with ReSTART, when solving this problem I found an interaction between the TxFifo refill, RxFifo empty and CMD[] fill.  during certain sequences a dataqueue command would be skipped, this skipping resulted in a mismatch between the contents of the TxFifo and the i2c command sequence.  The problem manifested as an ACK error. 
In addition to this required bug fix I propose:
* `Wire.begin()` be changed from a `void` to a `bool` this will allow the reset functionality of `Wire.begin()` to be reported.  Currently `Wire.begin()` attempts to reset the i2c Peripheral, but cannot report success/failure.
* `Wire.busy()` be added. this `bool` function returns the hardware status of the bus. This status can be use in multi-master environments for application level interleaving of commands, also in single master environment, it can be used to detect a 'hung' bus.  With the functional change to `Wire.begin()` this allows app level recover of a hung bus.
* `Wire.lastError()` value updated for all errors, previously when interleaving `Wire.endTransmission(false)` and `Wire.readTransmission(false)`, the 128 byte `Wire.write()` buffer was exhausted without generating and error(very exotic). I discovered this error when I created a sequence of directed reads to a EEPROM. Each directed read used 2 bytes of the 128 byte `write()` buffer, so after 64 consecutive ReSTART writes with ReSTART reads, `Wire()`  had no room to record the directed address bytes.  It generated just a NAK check without setting the EEPROMs internal register address.  The succeeding ReSTART read succeeded at incorrect address.
* Changes to the HAL layer:
** added `i2cGetStatus()` which returns the i2c peripheral status word, used to detect bus_busy currently
** added `i2cDebug()` programmatic control of debug buffer output
** changed `i2cAddQueue()` to allow data_only queue element this will allow a i2c transaction to use multiple data pointers.
** removed direct access to DumpInts(), DumpI2c() from app, use i2cDebug() to set trigger points 
 
*

* Forgot DebugFlags Return

@andriyadi found this, total brain fade on my part.
2018-08-14 11:51:15 +02:00
cores/esp32 Wire ReSTART fix, with others (#1717) 2018-08-14 11:51:15 +02:00
docs Cleanup on README and boards_manager (#1693) 2018-07-30 10:21:03 +03:00
libraries Wire ReSTART fix, with others (#1717) 2018-08-14 11:51:15 +02:00
package Change esptool version notation 2018-07-03 14:50:14 +02:00
tools [OTA] Fix "Error response from device" if OK response comes to early (#1695) 2018-07-30 10:22:01 +03:00
variants add LOLIN D32 & D32 PRO Board support (#1688) 2018-07-28 10:27:26 +03:00
.gitignore Convert the few remaining cr/lf files to use lf for eol. (#1316) 2018-04-16 16:34:39 +02:00
.gitmodules Add submodule of Azure IoT library (#1448) 2018-05-31 14:52:02 +02:00
.travis.yml Update IDF to aaf1239 (#1539) 2018-06-27 09:01:06 +02:00
appveyor.yml Initial version of build script for @PlatformIO; CI integration for Linux, macOS and Windows (#153) 2017-01-28 14:19:56 +02:00
boards.txt add LOLIN D32 & D32 PRO Board support (#1688) 2018-07-28 10:27:26 +03:00
CMakeLists.txt Fix io16 io17 and PSRAM support (#1564) 2018-06-30 23:06:50 +02:00
component.mk fix compilation errors in idf 2018-07-25 22:39:32 +02:00
Kconfig.projbuild Feature/selective compilation (#1671) 2018-07-25 13:02:37 +02:00
Makefile.projbuild Enable PSRAM builds when used as IDF component 2018-07-15 10:20:01 +02:00
package.json Initial version of build script for @PlatformIO; CI integration for Linux, macOS and Windows (#153) 2017-01-28 14:19:56 +02:00
platform.txt Add Wrover Support and Option to enable SPIRAM 2018-07-03 23:03:50 +02:00
programmers.txt initial import 2016-10-06 07:09:44 -06:00
README.md Cleanup on README and boards_manager (#1693) 2018-07-30 10:21:03 +03:00

Arduino core for ESP32 WiFi chip Build Status

Need help or have a question? Join the chat at https://gitter.im/espressif/arduino-esp32

Contents

Development Status

Latest stable release Release Version Release Date

Latest development release Development Version Development Date

Most of the framework is implemented. Most noticable is the missing analogWrite. While analogWrite is on it's way, there are a few other options that you can use:

  • 16 channels LEDC which is PWM
  • 8 channels SigmaDelta which uses SigmaDelta modulation
  • 2 channels DAC which gives real analog output

Installation Instructions

Decoding exceptions

You can use EspExceptionDecoder to get meaningful call trace.

Issue/Bug report template

Before reporting an issue, make sure you've searched for similar one that was already created. Also make sure to go through all the issues labelled as for reference.

Finally, if you're sure no one else had the issue, follow the ISSUE_TEMPLATE while reporting any issue.

ESP32Dev Board PINMAP

Pin Functions

Hint

Sometimes to program ESP32 via serial you must keep GPIO0 LOW during the programming process