|
2 | 2 |
|
3 | 3 | [](https://travis-ci.org/espressif/arduino-esp32) |
4 | 4 |
|
5 | | -## Need help or have a question? Join the chat at [](https://gitter.im/espressif/arduino-esp32?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) |
| 5 | +### Need help or have a question? Join the chat at [](https://gitter.im/espressif/arduino-esp32?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) |
6 | 6 |
|
| 7 | +## Contents |
7 | 8 | - [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) |
| 9 | +- [Installation Instructions](#installation-instructions) |
| 10 | +- [Decoding Exceptions](#decoding-exceptions) |
| 11 | +- [Issue/Bug report template](#issuebug-report-template) |
16 | 12 | - [ESP32Dev Board PINMAP](#esp32dev-board-pinmap) |
17 | 13 |
|
18 | 14 | ## Development Status |
19 | 15 | 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 |
| 16 | +- 16 channels [LEDC](cores/esp32/esp32-hal-ledc.h) which is PWM |
| 17 | +- 8 channels [SigmaDelta](cores/esp32/esp32-hal-sigmadelta.h) which uses SigmaDelta modulation |
| 18 | +- 2 channels [DAC](cores/esp32/esp32-hal-dac.h) which gives real analog output |
23 | 19 |
|
24 | 20 | ## Installation Instructions |
25 | 21 |
|
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 | | - wget https://bootstrap.pypa.io/get-pip.py && \ |
51 | | - sudo python get-pip.py && \ |
52 | | - sudo pip install pyserial && \ |
53 | | - mkdir -p ~/Arduino/hardware/espressif && \ |
54 | | - cd ~/Arduino/hardware/espressif && \ |
55 | | - git clone https://github.com/espressif/arduino-esp32.git esp32 && \ |
56 | | - cd esp32/tools/ && \ |
57 | | - python get.py |
58 | | - ``` |
59 | | -- Restart Arduino IDE |
60 | | - |
61 | | -#### Instructions for Fedora |
62 | | -- Install the latest Arduino IDE from [arduino.cc](https://www.arduino.cc/en/Main/Software). `$ sudo dnf -y install arduino` will most likely install an older release. |
63 | | -- Open Terminal and execute the following command (copy->paste and hit enter): |
64 | | - |
65 | | - ```bash |
66 | | - sudo usermod -a -G dialout $USER && \ |
67 | | - sudo dnf install git python3-pip python3-pyserial && \ |
68 | | - mkdir -p ~/Arduino/hardware/espressif && \ |
69 | | - cd ~/Arduino/hardware/espressif && \ |
70 | | - git clone https://github.com/espressif/arduino-esp32.git esp32 && \ |
71 | | - cd esp32/tools/ && \ |
72 | | - python get.py |
73 | | - ``` |
74 | | -- Restart Arduino IDE |
| 22 | +- Using Arduino IDE |
| 23 | + + [Instructions for Windows](docs/arduino-ide/windows.md) |
| 24 | + + [Instructions for Mac](docs/arduino-ide/mac.md) |
| 25 | + + [Instructions for Debian/Ubuntu Linux](docs/arduino-ide/debian_ubuntu.md) |
| 26 | + + [Instructions for Fedora](docs/arduino-ide/fedora.md) |
| 27 | +- [Using PlatformIO](docs/platformio.md) |
| 28 | +- [Building with make](docs/make.md) |
| 29 | +- [Using as ESP-IDF component](docs/esp-idf_component.md) |
75 | 30 |
|
76 | 31 | #### Decoding exceptions |
77 | 32 |
|
78 | 33 | You can use [EspExceptionDecoder](https://github.com/me-no-dev/EspExceptionDecoder) to get meaningful call trace. |
79 | 34 |
|
80 | | -### Using PlatformIO |
81 | | - |
82 | | -[PlatformIO](http://platformio.org) is an open source ecosystem for IoT |
83 | | -development with cross platform build system, library manager and full support |
84 | | -for Espressif ESP32 development. It works on the popular host OS: Mac OS X, Windows, |
85 | | -Linux 32/64, Linux ARM (like Raspberry Pi, BeagleBone, CubieBoard). |
86 | | - |
87 | | -- [What is PlatformIO?](http://docs.platformio.org/page/what-is-platformio.html) |
88 | | -- [PlatformIO IDE](http://platformio.org/platformio-ide) |
89 | | -- 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) |
90 | | -- [Integration with Cloud and Standalone IDEs](http://docs.platformio.org/page/ide.html) - |
91 | | - Cloud9, Codeanywehre, Eclipse Che (Codenvy), Atom, CLion, Eclipse, Emacs, NetBeans, Qt Creator, Sublime Text, VIM and Visual Studio |
92 | | -- [Project Examples](https://github.com/platformio/platform-espressif32/tree/develop/examples) |
93 | | -- [Using "Stage" (Git) version of Arduino Core](http://docs.platformio.org/page/platforms/espressif32.html#using-arduino-framework-with-staging-version) |
94 | | - |
95 | | -### Building with make |
| 35 | +#### Issue/Bug report template |
| 36 | +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](https://github.com/espressif/arduino-esp32/issues?utf8=%E2%9C%93&q=is%3Aissue%20label%3A%22for%20reference%22%20). |
96 | 37 |
|
97 | | -[makeEspArduino](https://github.com/plerup/makeEspArduino) is a generic makefile for any ESP8266/ESP32 Arduino project. |
98 | | -Using make instead of the Arduino IDE makes it easier to do automated and production builds. |
| 38 | +Finally, if you're sure no one else had the issue, follow the [ISSUE_TEMPLATE](docs/ISSUE_TEMPLATE.md) while reporting any issue. |
99 | 39 |
|
100 | | -### Using as ESP-IDF component |
101 | | -- Download and install [esp-idf](https://github.com/espressif/esp-idf) |
102 | | -- Create blank idf project (from one of the examples) |
103 | | -- in the project folder, create a folder called components and clone this repository inside |
104 | | - |
105 | | - ```bash |
106 | | - mkdir -p components && \ |
107 | | - cd components && \ |
108 | | - git clone https://github.com/espressif/arduino-esp32.git arduino && \ |
109 | | - cd .. && \ |
110 | | - make menuconfig |
111 | | - ``` |
112 | | -- ```make menuconfig``` has some Arduino options |
113 | | - - "Autostart Arduino setup and loop on boot" |
114 | | - - If you enable this options, your main.cpp should be formated like any other sketch |
115 | | - |
116 | | - ```arduino |
117 | | - //file: main.cpp |
118 | | - #include "Arduino.h" |
119 | | - |
120 | | - void setup(){ |
121 | | - Serial.begin(115200); |
122 | | - } |
123 | | - |
124 | | - void loop(){ |
125 | | - Serial.println("loop"); |
126 | | - delay(1000); |
127 | | - } |
128 | | - ``` |
129 | | - |
130 | | - - Else you need to implement ```app_main()``` and call ```initArduino();``` in it. |
131 | | - |
132 | | - Keep in mind that setup() and loop() will not be called in this case. |
133 | | - 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. |
134 | | - |
135 | | - ```arduino |
136 | | - //file: main.cpp |
137 | | - #include "Arduino.h" |
138 | | - |
139 | | - extern "C" void app_main() |
140 | | - { |
141 | | - initArduino(); |
142 | | - pinMode(4, OUTPUT); |
143 | | - digitalWrite(4, HIGH); |
144 | | - //do your own thing |
145 | | - } |
146 | | - ``` |
147 | | - - "Disable mutex locks for HAL" |
148 | | - - If enabled, there will be no protection on the drivers from concurently accessing them from another thread/interrupt/core |
149 | | - - "Autoconnect WiFi on boot" |
150 | | - - If enabled, WiFi will start with the last known configuration |
151 | | - - Else it will wait for WiFi.begin |
152 | | -- ```make flash monitor``` will build, upload and open serial monitor to your board |
153 | 40 |
|
154 | 41 | ## ESP32Dev Board PINMAP |
155 | 42 |
|
156 | | - |
| 43 | + |
157 | 44 |
|
158 | 45 | ## Hint |
159 | 46 |
|
160 | 47 | Sometimes to program ESP32 via serial you must keep GPIO0 LOW during the programming process |
161 | | - |
0 commit comments