Espressif ESP32

Arduino Development

[REF:] https://github.com/espressif/arduino-esp32/blob/master/README.md

Until a JSON installation file is created, the old way of installing into the Arduino filesystem is required.

SuSE Linux

Install

Make sure your user ID is a member of the dialout group so you can access the serial port devices.

NOTE: is python[3]-pip and python[3]-pyserial installed???

Create an espressif directory within your Arduino environment.
In my case:
mkdir /opt/arduino-1.8.1P/hardware/espressif

cd into the espressif directory.
Use 'git' to install the arduino ESP32 support...
git clone https://github.com/espressif/arduino-esp32.git esp32

cd into esp32 directory.
git submodule update --init --recursive

cd into the esp32/tools directory.
Using python install the ESP32 Development tools...
python get.py

voila

Update

Update to the latest arduino ESP32 support from within the esp32 directory...
git pull origin

Update to the latest ESP-IDF development tools from within the esp32/tools directory using...
python get.py


Bluetooth BLE Support

TBD

WiFi Support

TBD

ESP-IDF Espressif Native Development

[REF:] https://github.com/espressif/arduino-esp32/blob/master/docs/esp-idf_component.md

Compile Native toolchain from source using crosstool-NG

cd /opt/esp32

Install the cross development tools...
git clone -b xtensa-1.22.x https://github.com/espressif/crosstool-NG.git
cd crosstool-NG
./bootstrap
./configure --prefix=$PWD
make install
sudo cp ct-ng.comp /etc/bash_completion.d

More info TBD

Update

cd /opt/esp32/esp-idf
git pull origin

ESP-IDF 2.0 Espressive Native Development

Install with
cd /opt/esp32
git clone https://github.com/espressif/esp-idf.git esp-idf-v2.0
cd esp-idf-v2.0/
git checkout v2.0
git submodule update --init

Update

cd /opt/esp32/esp-idf-v2.0
git pull origin

Misc. Notes using Arduino compatibility

Using Arduino libraries most likely will need rewriting to take advantage of more powerful CPU features that the simplistic AVR ones don't have.

ESP32 has 2 cores and most AVR based libraries don't handle this feature. ESP32 uses mutex locking to access hardware (HAL) features. AVR based libraries would cause mutex locking on byte basis instead of block basis, resulting in a bogged down performance for things like SPI. Thus libraries should be rewritten, or written specifically for the ESP32 to reduce overhead, by implementing multi-byte transfers

Until then, a work around, if it doesn't cause other grief, is to turn off mutex locking by adding the following line in esp32-hal.h
#define CONFIG_DISABLE_HAL_LOCKS 1

includes may need to be wrapped in
extern "C" {}

More info TBD

Other Notes

  • ADC2 pins can not be used with WIFI. ADC1 pins can.