Skip to content

Commit 16396e8

Browse files
authored
Merge pull request #1 from espressif/master
Get updates
2 parents 47babd2 + 668c381 commit 16396e8

File tree

190 files changed

+13838
-5160
lines changed

Some content is hidden

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

190 files changed

+13838
-5160
lines changed

Kconfig

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
menu "Arduino Configuration"
2+
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
39+
40+
config AUTOSTART_ARDUINO
41+
bool "Autostart Arduino setup and loop on boot"
42+
default "n"
43+
help
44+
Enabling this option will implement app_main and start Arduino.
45+
All you need to implement in your main.cpp is setup() and loop()
46+
and include Arduino.h
47+
If disabled, you can call initArduino() to run any preparations
48+
required by the framework
49+
50+
config DISABLE_HAL_LOCKS
51+
bool "Disable mutex locks for HAL"
52+
default "n"
53+
help
54+
Enabling this option will run all hardware abstraction without locks.
55+
While communication with external hardware will be faster, you need to
56+
make sure that there is no option to use the same bus from another thread
57+
or interrupt at the same time. Option is best used with Arduino enabled
58+
and code implemented only in setup/loop and Arduino callbacks
59+
60+
menu "Debug Log Configuration"
61+
choice ARDUHAL_LOG_DEFAULT_LEVEL
62+
bool "Default log level"
63+
default ARDUHAL_LOG_DEFAULT_LEVEL_ERROR
64+
help
65+
Specify how much output to see in logs by default.
66+
67+
config ARDUHAL_LOG_DEFAULT_LEVEL_NONE
68+
bool "No output"
69+
config ARDUHAL_LOG_DEFAULT_LEVEL_ERROR
70+
bool "Error"
71+
config ARDUHAL_LOG_DEFAULT_LEVEL_WARN
72+
bool "Warning"
73+
config ARDUHAL_LOG_DEFAULT_LEVEL_INFO
74+
bool "Info"
75+
config ARDUHAL_LOG_DEFAULT_LEVEL_DEBUG
76+
bool "Debug"
77+
config ARDUHAL_LOG_DEFAULT_LEVEL_VERBOSE
78+
bool "Verbose"
79+
endchoice
80+
81+
config ARDUHAL_LOG_DEFAULT_LEVEL
82+
int
83+
default 0 if ARDUHAL_LOG_DEFAULT_LEVEL_NONE
84+
default 1 if ARDUHAL_LOG_DEFAULT_LEVEL_ERROR
85+
default 2 if ARDUHAL_LOG_DEFAULT_LEVEL_WARN
86+
default 3 if ARDUHAL_LOG_DEFAULT_LEVEL_INFO
87+
default 4 if ARDUHAL_LOG_DEFAULT_LEVEL_DEBUG
88+
default 5 if ARDUHAL_LOG_DEFAULT_LEVEL_VERBOSE
89+
90+
config ARDUHAL_LOG_COLORS
91+
bool "Use ANSI terminal colors in log output"
92+
default "n"
93+
help
94+
Enable ANSI terminal color codes in bootloader output.
95+
In order to view these, your terminal program must support ANSI color codes.
96+
97+
endmenu
98+
99+
config AUTOCONNECT_WIFI
100+
bool "Autoconnect WiFi on boot"
101+
default "n"
102+
depends on AUTOSTART_ARDUINO
103+
help
104+
If enabled, WiFi will connect to the last used SSID (if station was enabled),
105+
else connection will be started only after calling WiFi.begin(ssid, password)
106+
107+
endmenu

Makefile.projbuild

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
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)

README.md

Lines changed: 120 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,26 @@
1-
Arduino core for ESP32 WiFi chip
2-
===========================================
1+
# Arduino core for ESP32 WiFi chip
32

4-
### Development Status
3+
## 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)
4+
5+
- [Development Status](#development-status)
6+
- Installing options:
7+
+ [Using Arduino IDE](#using-arduino-ide)
8+
+ [Using PlatformIO](#using-platformio)
9+
+ [Using as ESP-IDF component](#using-as-esp-idf-component)
10+
- [ESP32Dev Board PINMAP](#esp32dev-board-pinmap)
11+
12+
## Development Status
513
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 :)
614

715
The framework can also be downloaded as component in an IDF project and be used like that.
816

9-
Things that "should" work:
17+
Things that work:
18+
1019
- pinMode
1120
- digitalRead/digitalWrite
1221
- attachInterrupt/detachInterrupt
22+
- analogRead/touchRead/touchAttachInterrupt
23+
- ledcWrite/sdWrite/dacWrite
1324
- Serial (global Serial is attached to pins 1 and 3 by default, there are another 2 serials that you can attach to any pin)
1425
- SPI (global SPI is attached to VSPI pins by default and HSPI can be attached to any pins)
1526
- 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)
@@ -18,21 +29,110 @@ Things that "should" work:
1829
WiFiClient, WiFiServer and WiFiUdp are not quite ready yet because there are still some small hiccups in LwIP to be overcome.
1930
You can try WiFiClient but you need to disconnect the client yourself to be sure that connection is closed.
2031

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
32+
## Using Arduino IDE
33+
34+
###[Instructions for Windows](doc/windows.md)
35+
36+
### Instructions for Mac
37+
- Install latest Arduino IDE from [arduino.cc](https://www.arduino.cc/en/Main/Software)
38+
- Open Terminal and execute the following command (copy->paste and hit enter):
39+
40+
```bash
41+
curl -o get-pip.py https://bootstrap.pypa.io/get-pip.py && \
42+
sudo python get-pip.py && \
43+
sudo pip install pyserial && \
44+
mkdir -p ~/Documents/Arduino/hardware/espressif && \
45+
cd ~/Documents/Arduino/hardware/espressif && \
46+
git clone https://github.com/espressif/arduino-esp32.git esp32 && \
47+
cd esp32/tools/ && \
48+
python get.py
49+
```
50+
- Restart Arduino IDE
51+
52+
### Instructions for Debian/Ubuntu Linux
53+
- Install latest Arduino IDE from [arduino.cc](https://www.arduino.cc/en/Main/Software)
54+
- Open Terminal and execute the following command (copy->paste and hit enter):
55+
56+
```bash
57+
sudo usermod -a -G dialout $USER && \
58+
sudo apt-get install git && \
59+
wget https://bootstrap.pypa.io/get-pip.py && \
60+
sudo python get-pip.py && \
61+
sudo pip install pyserial && \
62+
mkdir -p ~/Arduino/hardware/espressif && \
63+
cd ~/Arduino/hardware/espressif && \
64+
git clone https://github.com/espressif/arduino-esp32.git esp32 && \
65+
cd esp32/tools/ && \
66+
python get.py
67+
```
68+
- Restart Arduino IDE
69+
70+
## Using PlatformIO
71+
72+
[PlatformIO](http://platformio.org) is an open source ecosystem for IoT
73+
development with cross platform build system, library manager and full support
74+
for Espressif ESP32 development. It works on the popular host OS: Mac OS X, Windows,
75+
Linux 32/64, Linux ARM (like Raspberry Pi, BeagleBone, CubieBoard).
76+
77+
- [What is PlatformIO?](http://docs.platformio.org/page/what-is-platformio.html)
78+
- [PlatformIO IDE](http://platformio.org/platformio-ide)
79+
- 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)
80+
- [Integration with Cloud and Standalone IDEs](http://docs.platformio.org/page/ide.html) -
81+
Cloud9, Codeanywehre, Eclipse Che (Codenvy), Atom, CLion, Eclipse, Emacs, NetBeans, Qt Creator, Sublime Text, VIM and Visual Studio
82+
- [Project Examples](https://github.com/platformio/platform-espressif32/tree/develop/examples)
83+
84+
## Using as ESP-IDF component
85+
- Download and install [esp-idf](https://github.com/espressif/esp-idf)
86+
- Create blank idf project (from one of the examples)
87+
- in the project folder, create a folder called components and clone this repository inside
88+
89+
```bash
90+
mkdir -p components && \
91+
cd components && \
92+
git clone https://github.com/espressif/arduino-esp32.git arduino && \
93+
cd .. && \
94+
make menuconfig
95+
```
96+
- ```make menuconfig``` has some Arduino options
97+
- "Autostart Arduino setup and loop on boot"
98+
- If you enable this options, your main.cpp should be formated like any other sketch
99+
100+
```arduino
101+
//file: main.cpp
102+
#include "Arduino.h"
103+
104+
void setup(){
105+
Serial.begin(115200);
106+
}
107+
108+
void loop(){
109+
Serial.println("loop");
110+
delay(1000);
111+
}
112+
```
113+
- Else you need to implement ```app_main()``` and call ```initArduino();``` in it.
114+
115+
Keep in mind that setup() and loop() will not be called in this case
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)

boards.txt

Lines changed: 46 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ esp32.build.core=esp32
1717
esp32.build.variant=esp32
1818
esp32.build.board=ESP32_DEV
1919

20-
esp32.build.f_cpu=160000000L
20+
esp32.build.f_cpu=240000000L
2121
esp32.build.flash_mode=dio
2222
esp32.build.flash_size=4MB
2323

@@ -57,7 +57,7 @@ esp320.build.core=esp32
5757
esp320.build.variant=esp320
5858
esp320.build.board=ESP320
5959

60-
esp320.build.f_cpu=160000000L
60+
esp320.build.f_cpu=240000000L
6161
esp320.build.flash_mode=qio
6262
esp320.build.flash_size=4MB
6363

@@ -97,7 +97,7 @@ nano32.build.core=esp32
9797
nano32.build.variant=nano32
9898
nano32.build.board=NANO32
9999

100-
nano32.build.f_cpu=160000000L
100+
nano32.build.f_cpu=240000000L
101101
nano32.build.flash_mode=dio
102102
nano32.build.flash_size=4MB
103103

@@ -137,7 +137,7 @@ lolin32.build.core=esp32
137137
lolin32.build.variant=lolin32
138138
lolin32.build.board=LoLin32
139139

140-
lolin32.build.f_cpu=160000000L
140+
lolin32.build.f_cpu=240000000L
141141
lolin32.build.flash_mode=dio
142142
lolin32.build.flash_size=4MB
143143

@@ -177,7 +177,7 @@ espea32.build.core=esp32
177177
espea32.build.variant=espea32
178178
espea32.build.board=ESPea32
179179

180-
espea32.build.f_cpu=160000000L
180+
espea32.build.f_cpu=240000000L
181181
espea32.build.flash_mode=dio
182182
espea32.build.flash_size=4MB
183183

@@ -217,7 +217,7 @@ quantum.build.core=esp32
217217
quantum.build.variant=quantum
218218
quantum.build.board=QUANTUM
219219

220-
quantum.build.f_cpu=160000000L
220+
quantum.build.f_cpu=240000000L
221221
quantum.build.flash_mode=qio
222222
quantum.build.flash_size=16MB
223223

@@ -240,3 +240,43 @@ quantum.menu.UploadSpeed.460800.macosx=460800
240240
quantum.menu.UploadSpeed.460800.upload.speed=460800
241241
quantum.menu.UploadSpeed.512000.windows=512000
242242
quantum.menu.UploadSpeed.512000.upload.speed=512000
243+
244+
##############################################################
245+
node32s.name=Node32s
246+
247+
node32s.upload.tool=esptool
248+
node32s.upload.maximum_size=1044464
249+
node32s.upload.maximum_data_size=294912
250+
node32s.upload.wait_for_upload_port=true
251+
252+
node32s.serial.disableDTR=true
253+
node32s.serial.disableRTS=true
254+
255+
node32s.build.mcu=esp32
256+
node32s.build.core=esp32
257+
node32s.build.variant=node32s
258+
node32s.build.board=Node32s
259+
260+
node32s.build.f_cpu=240000000L
261+
node32s.build.flash_mode=dio
262+
node32s.build.flash_size=4MB
263+
264+
node32s.menu.FlashFreq.80=80MHz
265+
node32s.menu.FlashFreq.80.build.flash_freq=80m
266+
node32s.menu.FlashFreq.40=40MHz
267+
node32s.menu.FlashFreq.40.build.flash_freq=40m
268+
269+
node32s.menu.UploadSpeed.921600=921600
270+
node32s.menu.UploadSpeed.921600.upload.speed=921600
271+
node32s.menu.UploadSpeed.115200=115200
272+
node32s.menu.UploadSpeed.115200.upload.speed=115200
273+
node32s.menu.UploadSpeed.256000.windows=256000
274+
node32s.menu.UploadSpeed.256000.upload.speed=256000
275+
node32s.menu.UploadSpeed.230400.windows.upload.speed=256000
276+
node32s.menu.UploadSpeed.230400=230400
277+
node32s.menu.UploadSpeed.230400.upload.speed=230400
278+
node32s.menu.UploadSpeed.460800.linux=460800
279+
node32s.menu.UploadSpeed.460800.macosx=460800
280+
node32s.menu.UploadSpeed.460800.upload.speed=460800
281+
node32s.menu.UploadSpeed.512000.windows=512000
282+
node32s.menu.UploadSpeed.512000.upload.speed=512000

component.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
COMPONENT_ADD_INCLUDEDIRS := cores/esp32 variants/esp32 libraries/WiFi/src libraries/SPI/src libraries/Wire/src
22
COMPONENT_PRIV_INCLUDEDIRS := cores/esp32/libb64
33
COMPONENT_SRCDIRS := cores/esp32/libb64 cores/esp32 variants/esp32 libraries/WiFi/src libraries/SPI/src libraries/Wire/src
4-
include $(IDF_PATH)/make/component_common.mk
54
CXXFLAGS += -fno-rtti

0 commit comments

Comments
 (0)