Skip to content

Commit 11ff1ef

Browse files
committed
Merge remote-tracking branch 'upstream/master'
Conflicts: tools/esptool.py
2 parents a07e1ae + 97e9a12 commit 11ff1ef

File tree

294 files changed

+24799
-6473
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

294 files changed

+24799
-6473
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11

22
tools/xtensa-esp32-elf
33
tools/dist
4+
tools/esptool
5+
tools/esptool.exe

.travis.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
sudo: false
2+
3+
language: python
4+
python:
5+
- "2.7"
6+
7+
os:
8+
- linux
9+
10+
script:
11+
- set -e
12+
- wget -O arduino.tar.xz https://www.arduino.cc/download.php?f=/arduino-nightly-linux64.tar.xz
13+
- tar xf arduino.tar.xz
14+
- mv arduino-nightly $HOME/arduino_ide
15+
- mkdir -p $HOME/Arduino/libraries
16+
- cd $HOME/arduino_ide/hardware
17+
- mkdir espressif
18+
- cd espressif
19+
- ln -s $TRAVIS_BUILD_DIR esp32
20+
- cd esp32/tools
21+
- python get.py
22+
- export PATH="$HOME/arduino_ide:$TRAVIS_BUILD_DIR/tools/xtensa-esp32-elf/bin:$PATH"
23+
- which arduino
24+
- cd $TRAVIS_BUILD_DIR
25+
- source tools/common.sh
26+
- echo -e "travis_fold:end:sketch_test_env_prepare"
27+
- echo -e "travis_fold:start:sketch_test"
28+
- build_sketches $HOME/arduino_ide $TRAVIS_BUILD_DIR/libraries "-l $HOME/Arduino/libraries"
29+
- echo -e "travis_fold:end:sketch_test"
30+
- echo -e "travis_fold:start:size_report"
31+
- cat size.log
32+
- echo -e "travis_fold:end:size_report"
33+
34+
# test library examples with PlatformIO
35+
- pip install -U https://github.com/platformio/platformio/archive/develop.zip
36+
- platformio platform install https://github.com/platformio/platform-espressif32.git#feature/stage
37+
- sed -i 's/https:\/\/github\.com\/espressif\/arduino-esp32\.git/*/' ~/.platformio/platforms/espressif32_stage/platform.json
38+
- ln -s $TRAVIS_BUILD_DIR ~/.platformio/packages/framework-arduinoespressif32
39+
- "python -c \"import glob,subprocess,sys; map(lambda p: (sys.stdout.write('Library example: %s\\n' % p), subprocess.call(['pio', 'ci', p, '--board', 'esp32dev'])), glob.glob('libraries/*/examples/*/'))\""
40+
41+
notifications:
42+
email:
43+
on_success: change
44+
on_failure: change
45+
webhooks:
46+
urls:
47+
- https://webhooks.gitter.im/e/cb057279c430d91a47a8
48+
on_success: change # options: [always|never|change] default: always
49+
on_failure: always # options: [always|never|change] default: always
50+
on_start: false # default: false

Kconfig

Lines changed: 4 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,9 @@
11
menu "Arduino Configuration"
22

3-
choice MONITOR_BAUD
4-
prompt "Monitor baud rate"
5-
default MONITOR_BAUD_115200B
6-
help
7-
Baud rate to use while monitoring the ESP chip.
8-
9-
config MONITOR_BAUD_9600B
10-
bool "9600 bps"
11-
config MONITOR_BAUD_57600B
12-
bool "57600 bps"
13-
config MONITOR_BAUD_115200B
14-
bool "115200 bps"
15-
config MONITOR_BAUD_230400B
16-
bool "230400 bps"
17-
config MONITOR_BAUD_921600B
18-
bool "921600 bps"
19-
config MONITOR_BAUD_2MB
20-
bool "2 Mbps"
21-
config MONITOR_BAUD_OTHER
22-
bool "Custom baud rate"
23-
24-
endchoice
25-
26-
config MONITOR_BAUD_OTHER_VAL
27-
int "Custom baud rate value" if MONITOR_BAUD_OTHER
28-
default 115200
29-
30-
config MONITOR_BAUD
31-
int
32-
default 9600 if MONITOR_BAUD_9600B
33-
default 57600 if MONITOR_BAUD_57600B
34-
default 115200 if MONITOR_BAUD_115200B
35-
default 230400 if MONITOR_BAUD_230400B
36-
default 921600 if MONITOR_BAUD_921600B
37-
default 2000000 if MONITOR_BAUD_2MB
38-
default MONITOR_BAUD_OTHER_VAL if MONITOR_BAUD_OTHER
3+
config ENABLE_ARDUINO_DEPENDS
4+
bool
5+
select LWIP_SO_RCVBUF
6+
default "y"
397

408
config AUTOSTART_ARDUINO
419
bool "Autostart Arduino setup and loop on boot"

Makefile.projbuild

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
#build with "make flash monitor" to upload and open serial monitor
2-
monitor:
3-
$(Q) miniterm.py --rts 0 --dtr 0 --raw $(ESPPORT) $(CONFIG_MONITOR_BAUD)
1+

README.md

Lines changed: 136 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,138 @@
1-
Arduino core for ESP32 WiFi chip
2-
===========================================
3-
4-
### Development Status
5-
Not everything is working yet, you can not get it through package manager, but you can give it a go and help us find bugs in the things that are implemented :)
6-
7-
The framework can also be downloaded as component in an IDF project and be used like that.
8-
9-
Things that "should" work:
10-
- pinMode
11-
- digitalRead/digitalWrite
12-
- attachInterrupt/detachInterrupt
13-
- Serial (global Serial is attached to pins 1 and 3 by default, there are another 2 serials that you can attach to any pin)
14-
- SPI (global SPI is attached to VSPI pins by default and HSPI can be attached to any pins)
15-
- Wire (global Wire is attached to pins 21 and 22 by default and there is another I2C bus that you can attach to any pins)
16-
- WiFi (about 99% the same as ESP8266)
17-
18-
WiFiClient, WiFiServer and WiFiUdp are not quite ready yet because there are still some small hiccups in LwIP to be overcome.
19-
You can try WiFiClient but you need to disconnect the client yourself to be sure that connection is closed.
20-
21-
### Installation
22-
- Install Arduino IDE
23-
- Go to Arduino IDE installation directory
24-
- Clone this repository into hardware/espressif/esp32 directory (or clone it elsewhere and create a symlink)
25-
```bash
26-
cd hardware
27-
mkdir espressif
28-
cd espressif
29-
git clone https://github.com/espressif/arduino-esp32.git esp32
30-
```
31-
- Download binary tools (you need Python 2.7)
32-
```bash
33-
cd esp32/tools
34-
python get.py
35-
```
36-
- Restart Arduino
1+
# Arduino core for ESP32 WiFi chip
2+
3+
[![Build Status](https://travis-ci.org/espressif/arduino-esp32.svg?branch=master)](https://travis-ci.org/espressif/arduino-esp32)
4+
5+
## Need help or have a question? Join the chat at [![https://gitter.im/espressif/arduino-esp32](https://badges.gitter.im/espressif/arduino-esp32.svg)](https://gitter.im/espressif/arduino-esp32?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
6+
7+
- [Development Status](#development-status)
8+
- [Installation Instructions](#installation-instructions):
9+
+ [Using Arduino IDE](#using-through-arduino-ide)
10+
+ [Windows](https://github.com/espressif/arduino-esp32/blob/master/doc/windows.md)
11+
+ [Mac OS](#instructions-for-mac)
12+
+ [Debian/Ubuntu](#instructions-for-debianubuntu-linux)
13+
+ [Decoding Exceptions](#decoding-exceptions)
14+
+ [Using PlatformIO](#using-platformio)
15+
+ [Using as ESP-IDF component](#using-as-esp-idf-component)
16+
- [ESP32Dev Board PINMAP](#esp32dev-board-pinmap)
17+
18+
## Development Status
19+
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:
20+
- 16 channels [LEDC](https://github.com/espressif/arduino-esp32/blob/master/cores/esp32/esp32-hal-ledc.h) which is PWM
21+
- 8 channels [SigmaDelta](https://github.com/espressif/arduino-esp32/blob/master/cores/esp32/esp32-hal-sigmadelta.h) which uses SigmaDelta modulation
22+
- 2 channels [DAC](https://github.com/espressif/arduino-esp32/blob/master/cores/esp32/esp32-hal-dac.h) which gives real analog output
23+
24+
## Installation Instructions
25+
26+
### Using through Arduino IDE
27+
28+
###[Instructions for Windows](doc/windows.md)
29+
30+
#### Instructions for Mac
31+
- Install latest Arduino IDE from [arduino.cc](https://www.arduino.cc/en/Main/Software)
32+
- Open Terminal and execute the following command (copy->paste and hit enter):
33+
34+
```bash
35+
mkdir -p ~/Documents/Arduino/hardware/espressif && \
36+
cd ~/Documents/Arduino/hardware/espressif && \
37+
git clone https://github.com/espressif/arduino-esp32.git esp32 && \
38+
cd esp32/tools/ && \
39+
python get.py
40+
```
41+
- Restart Arduino IDE
42+
43+
#### Instructions for Debian/Ubuntu Linux
44+
- Install latest Arduino IDE from [arduino.cc](https://www.arduino.cc/en/Main/Software)
45+
- Open Terminal and execute the following command (copy->paste and hit enter):
46+
47+
```bash
48+
sudo usermod -a -G dialout $USER && \
49+
sudo apt-get install git && \
50+
mkdir -p ~/Arduino/hardware/espressif && \
51+
cd ~/Arduino/hardware/espressif && \
52+
git clone https://github.com/espressif/arduino-esp32.git esp32 && \
53+
cd esp32/tools/ && \
54+
python get.py
55+
```
56+
- Restart Arduino IDE
57+
58+
#### Decoding exceptions
59+
60+
You can use [EspExceptionDecoder](https://github.com/me-no-dev/EspExceptionDecoder) to get meaningful call trace.
61+
62+
### Using PlatformIO
63+
64+
[PlatformIO](http://platformio.org) is an open source ecosystem for IoT
65+
development with cross platform build system, library manager and full support
66+
for Espressif ESP32 development. It works on the popular host OS: Mac OS X, Windows,
67+
Linux 32/64, Linux ARM (like Raspberry Pi, BeagleBone, CubieBoard).
68+
69+
- [What is PlatformIO?](http://docs.platformio.org/page/what-is-platformio.html)
70+
- [PlatformIO IDE](http://platformio.org/platformio-ide)
71+
- Quick Start with [PlatformIO IDE](http://docs.platformio.org/page/ide/atom.html#quick-start) or [PlatformIO Core](http://docs.platformio.org/page/core.html)
72+
- [Integration with Cloud and Standalone IDEs](http://docs.platformio.org/page/ide.html) -
73+
Cloud9, Codeanywehre, Eclipse Che (Codenvy), Atom, CLion, Eclipse, Emacs, NetBeans, Qt Creator, Sublime Text, VIM and Visual Studio
74+
- [Project Examples](https://github.com/platformio/platform-espressif32/tree/develop/examples)
75+
- [Using "Stage" (Git) version of Arduino Core](http://docs.platformio.org/page/platforms/espressif32.html#using-arduino-framework-with-staging-version)
76+
77+
### Building with make
78+
79+
[makeEspArduino](https://github.com/plerup/makeEspArduino) is a generic makefile for any ESP8266/ESP32 Arduino project.
80+
Using make instead of the Arduino IDE makes it easier to do automated and production builds.
81+
82+
### Using as ESP-IDF component
83+
- Download and install [esp-idf](https://github.com/espressif/esp-idf)
84+
- Create blank idf project (from one of the examples)
85+
- in the project folder, create a folder called components and clone this repository inside
86+
87+
```bash
88+
mkdir -p components && \
89+
cd components && \
90+
git clone https://github.com/espressif/arduino-esp32.git arduino && \
91+
cd .. && \
92+
make menuconfig
93+
```
94+
- ```make menuconfig``` has some Arduino options
95+
- "Autostart Arduino setup and loop on boot"
96+
- If you enable this options, your main.cpp should be formated like any other sketch
97+
98+
```arduino
99+
//file: main.cpp
100+
#include "Arduino.h"
101+
102+
void setup(){
103+
Serial.begin(115200);
104+
}
105+
106+
void loop(){
107+
Serial.println("loop");
108+
delay(1000);
109+
}
110+
```
111+
112+
- Else you need to implement ```app_main()``` and call ```initArduino();``` in it.
113+
114+
Keep in mind that setup() and loop() will not be called in this case.
115+
If you plan to base your code on examples provided in [esp-idf](https://github.com/espressif/esp-idf/tree/master/examples), please make sure move the app_main() function in main.cpp from the files in the example.
116+
117+
```arduino
118+
//file: main.cpp
119+
#include "Arduino.h"
120+
121+
extern "C" void app_main()
122+
{
123+
initArduino();
124+
pinMode(4, OUTPUT);
125+
digitalWrite(4, HIGH);
126+
//do your own thing
127+
}
128+
```
129+
- "Disable mutex locks for HAL"
130+
- If enabled, there will be no protection on the drivers from concurently accessing them from another thread/interrupt/core
131+
- "Autoconnect WiFi on boot"
132+
- If enabled, WiFi will start with the last known configuration
133+
- Else it will wait for WiFi.begin
134+
- ```make flash monitor``` will build, upload and open serial monitor to your board
135+
136+
## ESP32Dev Board PINMAP
37137

38138
![Pin Functions](doc/esp32_pinmap.png)

appveyor.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
build: off
2+
environment:
3+
4+
matrix:
5+
- PLATFORMIO_CI_SRC: "libraries/WiFi/examples/WiFiClient"
6+
- PLATFORMIO_CI_SRC: "libraries/WiFi/examples/WiFiClientBasic"
7+
- PLATFORMIO_CI_SRC: "libraries/WiFi/examples/WiFiClientEvents"
8+
- PLATFORMIO_CI_SRC: "libraries/WiFi/examples/WiFiIPv6"
9+
- PLATFORMIO_CI_SRC: "libraries/WiFi/examples/WiFiScan"
10+
- PLATFORMIO_CI_SRC: "libraries/WiFi/examples/WiFiSmartConfig"
11+
12+
install:
13+
- cmd: git submodule update --init --recursive
14+
- cmd: SET PATH=%PATH%;C:\Python27\Scripts
15+
- cmd: pip install -U https://github.com/platformio/platformio/archive/develop.zip
16+
- cmd: platformio platform install https://github.com/platformio/platform-espressif32.git#feature/stage
17+
18+
test_script:
19+
- cmd: platformio ci -b esp32dev -b nano32 -b node32s

0 commit comments

Comments
 (0)