Skip to content

Commit 98e2fbc

Browse files
authored
Merge pull request #1 from esp8266/master
Update
2 parents 9845deb + 3e4d7c7 commit 98e2fbc

File tree

53 files changed

+610
-222
lines changed

Some content is hidden

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

53 files changed

+610
-222
lines changed

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Arduino core for ESP8266 WiFi chip
33

44
# Quick links
55

6-
- [Latest release documentation](https://arduino-esp8266.readthedocs.io/en/2.7.0/)
6+
- [Latest release documentation](https://arduino-esp8266.readthedocs.io/en/2.7.1/)
77
- [Current "git version" documentation](https://arduino-esp8266.readthedocs.io/en/latest/)
88
- [Install git version](https://arduino-esp8266.readthedocs.io/en/latest/installing.html#using-git-version) ([sources](doc/installing.rst#using-git-version))
99

@@ -28,15 +28,15 @@ ESP8266 Arduino core comes with libraries to communicate over WiFi using TCP and
2828

2929
Starting with 1.6.4, Arduino allows installation of third-party platform packages using Boards Manager. We have packages available for Windows, Mac OS, and Linux (32 and 64 bit).
3030

31-
- Install the current upstream Arduino IDE at the 1.8.7 level or later. The current version is on the [Arduino website](https://www.arduino.cc/en/main/software).
31+
- Install the current upstream Arduino IDE at the 1.8.9 level or later. The current version is on the [Arduino website](https://www.arduino.cc/en/main/software).
3232
- Start Arduino and open the Preferences window.
3333
- Enter ```https://arduino.esp8266.com/stable/package_esp8266com_index.json``` into the *Additional Board Manager URLs* field. You can add multiple URLs, separating them with commas.
3434
- Open Boards Manager from Tools > Board menu and install *esp8266* platform (and don't forget to select your ESP8266 board from Tools > Board menu after installation).
3535

3636
#### Latest release [![Latest release](https://img.shields.io/github/release/esp8266/Arduino.svg)](https://github.com/esp8266/Arduino/releases/latest/)
3737
Boards manager link: `https://arduino.esp8266.com/stable/package_esp8266com_index.json`
3838

39-
Documentation: [https://arduino-esp8266.readthedocs.io/en/2.7.0/](https://arduino-esp8266.readthedocs.io/en/2.7.0/)
39+
Documentation: [https://arduino-esp8266.readthedocs.io/en/2.7.1/](https://arduino-esp8266.readthedocs.io/en/2.7.1/)
4040

4141
### Using git version
4242
[![Linux build status](https://travis-ci.org/esp8266/Arduino.svg)](https://travis-ci.org/esp8266/Arduino)
@@ -73,7 +73,7 @@ Documentation for latest development version: https://arduino-esp8266.readthedoc
7373

7474
### Issues and support ###
7575

76-
[ESP8266 Community Forum](https://www.esp8266.com/u/arduinoanswers) is a well-established community for questions and answers about Arduino for ESP8266. If you need help, have a "How do I..." type question, have a problem with a 3rd party library not hosted in this repo, or just want to discuss how to approach a problem, please ask there.
76+
[ESP8266 Community Forum](https://www.esp8266.com/u/arduinoanswers) is a well-established community for questions and answers about Arduino for ESP8266. Stackoverflow is also an alternative. If you need help, have a "How do I..." type question, have a problem with a 3rd party library not hosted in this repo, or just want to discuss how to approach a problem, please ask there.
7777

7878
If you find the forum useful, please consider supporting it with a donation. <br />
7979
[![Donate](https://img.shields.io/badge/paypal-donate-yellow.svg)](https://www.paypal.com/webscr?cmd=_s-xclick&hosted_button_id=4M56YCWV6PX66)
@@ -96,7 +96,7 @@ For minor fixes of code and documentation, please go ahead and submit a pull req
9696

9797
Check out the list of issues that are easy to fix — [easy issues pending](https://github.com/esp8266/Arduino/issues?q=is%3Aopen+is%3Aissue+label%3A%22level%3A+easy%22). Working on them is a great way to move the project forward.
9898

99-
Larger changes (rewriting parts of existing code from scratch, adding new functions to the core, adding new libraries) should generally be discussed by opening an issue first.
99+
Larger changes (rewriting parts of existing code from scratch, adding new functions to the core, adding new libraries) should generally be discussed by opening an issue first. PRs with such changes require testing and approval.
100100

101101
Feature branches with lots of small commits (especially titled "oops", "fix typo", "forgot to add file", etc.) should be squashed before opening a pull request. At the same time, please refrain from putting multiple unrelated changes into a single pull request.
102102

boards.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -4960,15 +4960,15 @@ espinotee.menu.baud.3000000.upload.speed=3000000
49604960
wifinfo.name=WifInfo
49614961
wifinfo.build.board=WIFINFO
49624962
wifinfo.build.variant=wifinfo
4963-
wifinfo.menu.ESPModule.ESP07192=ESP07 (1M/192K SPIFFS)
4963+
wifinfo.menu.ESPModule.ESP07192=ESP07 (1M/192K FS)
49644964
wifinfo.menu.ESPModule.ESP07192.build.board=ESP8266_ESP07
49654965
wifinfo.menu.ESPModule.ESP07192.build.flash_ld=eagle.flash.1m192.ld
49664966
wifinfo.menu.ESPModule.ESP07192.build.flash_size=1M
49674967
wifinfo.menu.ESPModule.ESP07192.build.spiffs_blocksize=4096
49684968
wifinfo.menu.ESPModule.ESP07192.build.spiffs_end=0xFB000
49694969
wifinfo.menu.ESPModule.ESP07192.build.spiffs_start=0xCB000
49704970
wifinfo.menu.ESPModule.ESP07192.upload.maximum_size=827376
4971-
wifinfo.menu.ESPModule.ESP12=ESP12 (4M/1M SPIFFS)
4971+
wifinfo.menu.ESPModule.ESP12=ESP12 (4M/1M FS)
49724972
wifinfo.menu.ESPModule.ESP12.build.board=ESP8266_ESP12
49734973
wifinfo.menu.ESPModule.ESP12.build.flash_ld=eagle.flash.4m1m.ld
49744974
wifinfo.menu.ESPModule.ESP12.build.flash_size=4M

bootloaders/eboot/eboot.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ int copy_raw(const uint32_t src_addr,
190190
return 0;
191191
}
192192

193-
#define XMC_SUPPORT
193+
//#define XMC_SUPPORT
194194
#ifdef XMC_SUPPORT
195195
// Define a few SPI0 registers we need access to
196196
#define ESP8266_REG(addr) *((volatile uint32_t *)(0x60000000+(addr)))

bootloaders/eboot/eboot.elf

-1.82 KB
Binary file not shown.

cores/esp8266/Crypto.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@
2323
THE SOFTWARE.
2424
*/
2525

26-
#include <bearssl/bearssl.h>
2726
#include "Crypto.h"
2827
#include <TypeConversion.h>
29-
28+
#include <bearssl/bearssl.h>
3029
#include <assert.h>
3130

3231
namespace TypeCast = experimental::TypeConversion;

cores/esp8266/Crypto.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#define __ESP8266_ARDUINO_CRYPTO_H__
2828

2929
#include <Arduino.h>
30+
#include <bearssl/bearssl_kdf.h>
3031

3132
namespace experimental
3233
{
@@ -745,8 +746,7 @@ struct HKDF
745746

746747
private:
747748

748-
// Use an opaque type to avoid #include <bearssl/bearssl.h> which drags the lib declarations into userland. The global scope prefix is required for compilation to succeed, it seems.
749-
::br_hkdf_context hkdfContext;
749+
br_hkdf_context hkdfContext;
750750
};
751751

752752

cores/esp8266/FS.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ using fs::SPIFFSConfig;
266266
#endif //FS_NO_GLOBALS
267267

268268
#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_SPIFFS)
269-
extern fs::FS SPIFFS;
269+
extern fs::FS SPIFFS __attribute__((deprecated("SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems.")));
270270
#endif
271271

272272
#endif //FS_H

cores/esp8266/TZ.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
// autogenerated from https://raw.githubusercontent.com/nayarsystems/posix_tz_db/master/zones.csv
33
// by script <esp8266 arduino core>/tools/TZupdate.sh
4-
// Fri May 1 20:39:05 UTC 2020
4+
// Thu May 7 19:02:21 UTC 2020
55
//
66
// This database is autogenerated from IANA timezone database
77
// https://www.iana.org/time-zones

cores/esp8266/spiffs_api.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ int32_t spiffs_hal_read(uint32_t addr, uint32_t size, uint8_t *dst) {
3737
return flash_hal_read(addr, size, dst);
3838
}
3939

40-
41-
40+
#pragma GCC diagnostic push
41+
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
4242

4343
namespace spiffs_impl {
4444

@@ -149,6 +149,8 @@ extern "C" void spiffs_request_end(void)
149149
SPIFFS.end();
150150
}
151151

152+
#pragma GCC diagnostic pop
153+
152154
#endif // ARDUINO
153155
#endif // !CORE_MOCK
154156

cores/esp8266/spiffs_api.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ class SPIFFSImpl : public FSImpl
171171
return false;
172172
}
173173
_cfg = *static_cast<const SPIFFSConfig *>(&cfg);
174-
return true;
174+
return true;
175175
}
176176

177177
bool begin() override

cores/esp8266/umm_malloc/umm_local.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ void ICACHE_FLASH_ATTR print_stats(int force);
4848

4949

5050
int ICACHE_FLASH_ATTR umm_info_safe_printf_P(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
51-
#define UMM_INFO_PRINTF(fmt, ...) umm_info_safe_printf_P(PSTR(fmt), ##__VA_ARGS__)
51+
#define UMM_INFO_PRINTF(fmt, ...) umm_info_safe_printf_P(PSTR4(fmt), ##__VA_ARGS__)
52+
// use PSTR4() instead of PSTR() to ensure 4-bytes alignment in Flash, whatever the default alignment of PSTR_ALIGN
5253

5354

5455
#endif

doc/boards.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ Parameters in Arduino IDE:
344344
~~~~~~~~~~~~~~~~~~~~~~~~~~
345345

346346
- Card: "WEMOS D1 Mini Lite"
347-
- Flash Size: "1M (512K SPIFFS)"
347+
- Flash Size: "1M (512K FS)"
348348
- CPU Frequency: "80 Mhz"
349349

350350
Power:

doc/esp8266wifi/bearssl-client-secure-class.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ The web browser you're using to read this document keeps a list of 100s of certi
102102

103103
In many cases your application will know the specific CA it needs to validate web or MQTT servers against (often just a single, self-signing CA private to your institution). Simply load your private CA in a `BearSSL::X509List` and use that as your trust anchor.
104104

105-
However, there are cases where you will not know beforehand which CA you will need (i.e. a user enters a website through a keypad), and you need to keep the list of CAs just like your web browser. In those cases, you need to generate a certificate bundle on the PC while compiling your application, upload the `certs.ar` bundle to SPIFFS or SD when uploading your application binary, and pass it to a `BearSSL::CertStore()` in order to validate TLS peers.
105+
However, there are cases where you will not know beforehand which CA you will need (i.e. a user enters a website through a keypad), and you need to keep the list of CAs just like your web browser. In those cases, you need to generate a certificate bundle on the PC while compiling your application, upload the `certs.ar` bundle to LittleFS or SD when uploading your application binary, and pass it to a `BearSSL::CertStore()` in order to validate TLS peers.
106106

107-
See the `BearSSL_CertStore` example for full details as the `BearSSL::CertStore` requires the creation of a cookie-cutter object for filesystem access (because the SD and SPIFFS filesystems are presently incompatible with each other). At a high level in your `setup()` you will call `BearSSL::initCertStore()` on a global object, and then pass this global certificate store to `client.setCertStore(&gCA)` before every connection attempt to enable it as a validation option.
107+
See the `BearSSL_CertStore` example for full details.
108108

109109
Supported Crypto
110110
~~~~~~~~~~~~~~~~

doc/esp8266wifi/client-secure-class.rst

+6-5
Original file line numberDiff line numberDiff line change
@@ -42,31 +42,32 @@ Load client certificate from file system.
4242
.. code:: cpp
4343
4444
#include <FS.h>
45+
#include <LittleFS.h>
4546
#include <ESP8266WiFi.h>
4647
#include <WiFiClientSecure.h>
4748
48-
const char* certyficateFile = "/client.cer";
49+
const char* certificateFile = "/client.cer";
4950
5051
*setup() or loop()*
5152

5253
.. code:: cpp
5354
54-
if (!SPIFFS.begin())
55+
if (!LittleFS.begin())
5556
{
5657
Serial.println("Failed to mount the file system");
5758
return;
5859
}
5960
60-
Serial.printf("Opening %s", certyficateFile);
61-
File crtFile = SPIFFS.open(certyficateFile, "r");
61+
Serial.printf("Opening %s", certificateFile);
62+
File crtFile = LittleFS.open(certificateFile, "r");
6263
if (!crtFile)
6364
{
6465
Serial.println(" Failed!");
6566
}
6667
6768
WiFiClientSecure client;
6869
69-
Serial.print("Loading %s", certyficateFile);
70+
Serial.print("Loading %s", certificateFile);
7071
if (!client.loadCertificate(crtFile))
7172
{
7273
Serial.println(" Failed!");

doc/faq/readme.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ perform. It is not listed among libraries verified to work with ESP8266.
7979

8080
`Read more <a03-library-does-not-work.rst>`__.
8181

82-
In the IDE, for ESP-12E that has 4M flash, I can choose 4M (1M SPIFFS) or 4M (3M SPIFFS). No matter what I select, the IDE tells me the maximum code space is about 1M. Where does my flash go?
82+
In the IDE, for ESP-12E that has 4M flash, I can choose 4M (1M FS) or 4M (3M FS). No matter what I select, the IDE tells me the maximum code space is about 1M. Where does my flash go?
8383
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8484

8585
The reason we cannot have more than 1MB of code in flash has to do with
@@ -90,7 +90,7 @@ total, but switching such "banks" on the fly is not easy and efficient,
9090
so we don't bother doing that. Besides, no one has so far complained
9191
about 1MB of code space being insufficient for practical purposes.
9292

93-
The option to choose 3M or 1M SPIFFS is to optimize the upload time.
93+
The option to choose 3M or 1M filesystem is to optimize the upload time.
9494
Uploading 3MB takes a long time so sometimes you can just use 1MB. Other
9595
2MB of flash can still be used with ``ESP.flashRead`` and
9696
``ESP.flashWrite`` APIs if necessary.

doc/filesystem.rst

+10
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,16 @@ following include to the sketch:
6363
6464
#include "FS.h"
6565
66+
SPIFFS Deprecation Warning
67+
--------------------------
68+
69+
SPIFFS is currently deprecated and may be removed in future releases of
70+
the core. Please consider moving your code to LittleFS. SPIFFS is not
71+
actively supported anymore by the upstream developer, while LittleFS is
72+
under active development, supports real directories, and is many times
73+
faster for most operations.
74+
75+
6676
SPIFFS and LittleFS
6777
-------------------
6878

doc/installing.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,6 @@ BeagleBone, CubieBoard).
244244
- `What is PlatformIO? <https://docs.platformio.org/en/latest/what-is-platformio.html?utm_source=arduino-esp8266>`__
245245
- `PlatformIO IDE <https://platformio.org/platformio-ide?utm_source=arduino-esp8266>`__
246246
- `PlatformIO Core <https://docs.platformio.org/en/latest/core.html?utm_source=arduino-esp8266>`__ (command line tool)
247-
- `Advanced usage <https://docs.platformio.org/en/latest/platforms/espressif8266.html?utm_source=arduino-esp8266>`__ - custom settings, uploading to SPIFFS, Over-the-Air (OTA), staging version
247+
- `Advanced usage <https://docs.platformio.org/en/latest/platforms/espressif8266.html?utm_source=arduino-esp8266>`__ - custom settings, uploading to LittleFS, Over-the-Air (OTA), staging version
248248
- `Integration with Cloud and Standalone IDEs <https://docs.platformio.org/en/latest/ide.html?utm_source=arduino-esp8266>`__ - Cloud9, Codeanywhere, Eclipse Che (Codenvy), Atom, CLion, Eclipse, Emacs, NetBeans, Qt Creator, Sublime Text, VIM, Visual Studio, and VSCode
249249
- `Project Examples <https://docs.platformio.org/en/latest/platforms/espressif8266.html?utm_source=arduino-esp8266#examples>`__

doc/libraries.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ This is a bit different from standard EEPROM class. You need to call ``EEPROM.be
2525

2626
``EEPROM.write`` does not write to flash immediately, instead you must call ``EEPROM.commit()`` whenever you wish to save changes to flash. ``EEPROM.end()`` will also commit, and will release the RAM copy of EEPROM contents.
2727

28-
EEPROM library uses one sector of flash located just after the SPIFFS.
28+
EEPROM library uses one sector of flash located just after the embedded filesystem.
2929

3030
`Three examples <https://github.com/esp8266/Arduino/tree/master/libraries/EEPROM>`__ included.
3131

doc/ota_updates/readme.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ If this is the case, then most likely ESP module has not been reset after initia
360360
The most common causes of OTA failure are as follows:
361361

362362
- not enough physical memory on the chip (e.g. ESP01 with 512K flash memory is not enough for OTA).
363-
- too much memory declared for SPIFFS so new sketch will not fit between existing sketch and SPIFFS – see `Update process - memory view <#update-process-memory-view>`__.
363+
- too much memory declared for the filesystem so new sketch will not fit between existing sketch and the filesystem – see `Update process - memory view <#update-process-memory-view>`__.
364364
- too little memory declared in Arduino IDE for your selected board (i.e. less than physical size).
365365
- not resetting the ESP module after initial upload using serial port.
366366

libraries/DNSServer/examples/CaptivePortalAdvanced/CaptivePortalAdvanced.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ unsigned int status = WL_IDLE_STATUS;
5656

5757
void setup() {
5858
delay(1000);
59-
Serial.begin(9600);
59+
Serial.begin(115200);
6060
Serial.println();
6161
Serial.println("Configuring access point...");
6262
/* You can remove the password parameter if you want the AP to be open. */

libraries/EEPROM/examples/eeprom_read/eeprom_read.ino

-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ byte value;
1515
void setup() {
1616
// initialize serial and wait for port to open:
1717
Serial.begin(115200);
18-
while (!Serial) {
19-
; // wait for serial port to connect. Needed for Leonardo only
20-
}
2118
EEPROM.begin(512);
2219
}
2320

libraries/ESP8266HTTPClient/examples/PostHttpClient/PostHttpClient.ino

+15-17
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
#include <ESP8266WiFi.h>
99
#include <ESP8266HTTPClient.h>
1010

11-
#define USE_SERIAL Serial
12-
1311
/* this can be run with an emulated server on host:
1412
cd esp8266-core-root-dir
1513
cd tests/host
@@ -27,21 +25,21 @@
2725

2826
void setup() {
2927

30-
USE_SERIAL.begin(115200);
28+
Serial.begin(115200);
3129

32-
USE_SERIAL.println();
33-
USE_SERIAL.println();
34-
USE_SERIAL.println();
30+
Serial.println();
31+
Serial.println();
32+
Serial.println();
3533

3634
WiFi.begin(STASSID, STAPSK);
3735

3836
while (WiFi.status() != WL_CONNECTED) {
3937
delay(500);
40-
USE_SERIAL.print(".");
38+
Serial.print(".");
4139
}
42-
USE_SERIAL.println("");
43-
USE_SERIAL.print("Connected! IP address: ");
44-
USE_SERIAL.println(WiFi.localIP());
40+
Serial.println("");
41+
Serial.print("Connected! IP address: ");
42+
Serial.println(WiFi.localIP());
4543

4644
}
4745

@@ -52,29 +50,29 @@ void loop() {
5250
WiFiClient client;
5351
HTTPClient http;
5452

55-
USE_SERIAL.print("[HTTP] begin...\n");
53+
Serial.print("[HTTP] begin...\n");
5654
// configure traged server and url
5755
http.begin(client, "http://" SERVER_IP "/postplain/"); //HTTP
5856
http.addHeader("Content-Type", "application/json");
5957

60-
USE_SERIAL.print("[HTTP] POST...\n");
58+
Serial.print("[HTTP] POST...\n");
6159
// start connection and send HTTP header and body
6260
int httpCode = http.POST("{\"hello\":\"world\"}");
6361

6462
// httpCode will be negative on error
6563
if (httpCode > 0) {
6664
// HTTP header has been send and Server response header has been handled
67-
USE_SERIAL.printf("[HTTP] POST... code: %d\n", httpCode);
65+
Serial.printf("[HTTP] POST... code: %d\n", httpCode);
6866

6967
// file found at server
7068
if (httpCode == HTTP_CODE_OK) {
7169
const String& payload = http.getString();
72-
USE_SERIAL.println("received payload:\n<<");
73-
USE_SERIAL.println(payload);
74-
USE_SERIAL.println(">>");
70+
Serial.println("received payload:\n<<");
71+
Serial.println(payload);
72+
Serial.println(">>");
7573
}
7674
} else {
77-
USE_SERIAL.printf("[HTTP] POST... failed, error: %s\n", http.errorToString(httpCode).c_str());
75+
Serial.printf("[HTTP] POST... failed, error: %s\n", http.errorToString(httpCode).c_str());
7876
}
7977

8078
http.end();

0 commit comments

Comments
 (0)