Skip to content

Commit 3f5495b

Browse files
authored
Merge branch 'master' into wifi_mesh_update_2.2
2 parents d01e639 + ed8add5 commit 3f5495b

File tree

101 files changed

+4949
-1652
lines changed

Some content is hidden

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

101 files changed

+4949
-1652
lines changed

README.md

Lines changed: 5 additions & 5 deletions
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.6.3/)
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.6.3/](https://arduino-esp8266.readthedocs.io/en/2.6.3/)
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <string.h>
1313
#include "flash.h"
1414
#include "eboot_command.h"
15+
#include "spi_vendors.h"
1516
#include <uzlib.h>
1617

1718
extern unsigned char _gzip_dict;
@@ -189,6 +190,28 @@ int copy_raw(const uint32_t src_addr,
189190
return 0;
190191
}
191192

193+
//#define XMC_SUPPORT
194+
#ifdef XMC_SUPPORT
195+
// Define a few SPI0 registers we need access to
196+
#define ESP8266_REG(addr) *((volatile uint32_t *)(0x60000000+(addr)))
197+
#define SPI0CMD ESP8266_REG(0x200)
198+
#define SPI0CLK ESP8266_REG(0x218)
199+
#define SPI0C ESP8266_REG(0x208)
200+
#define SPI0W0 ESP8266_REG(0x240)
201+
202+
#define SPICMDRDID (1 << 28)
203+
204+
/* spi_flash_get_id()
205+
Returns the flash chip ID - same as the SDK function.
206+
We need our own version as the SDK isn't available here.
207+
*/
208+
uint32_t __attribute__((noinline)) spi_flash_get_id() {
209+
SPI0W0=0;
210+
SPI0CMD=SPICMDRDID;
211+
while (SPI0CMD) {}
212+
return SPI0W0;
213+
}
214+
#endif // XMC_SUPPORT
192215

193216
int main()
194217
{
@@ -211,9 +234,48 @@ int main()
211234

212235
if (cmd.action == ACTION_COPY_RAW) {
213236
ets_putc('c'); ets_putc('p'); ets_putc(':');
237+
238+
#ifdef XMC_SUPPORT
239+
// save the flash access speed registers
240+
uint32_t spi0clk = SPI0CLK;
241+
uint32_t spi0c = SPI0C;
242+
243+
uint32_t vendor = spi_flash_get_id() & 0x000000ff;
244+
if (vendor == SPI_FLASH_VENDOR_XMC) {
245+
uint32_t flashinfo=0;
246+
if (SPIRead(0, &flashinfo, 4)) {
247+
// failed to read the configured flash speed.
248+
// Do not change anything,
249+
} else {
250+
// select an appropriate flash speed
251+
// Register values are those used by ROM
252+
switch ((flashinfo >> 24) & 0x0f) {
253+
case 0x0: // 40MHz, slow to 20
254+
case 0x1: // 26MHz, slow to 20
255+
SPI0CLK = 0x00003043;
256+
SPI0C = 0x00EAA313;
257+
break;
258+
case 0x2: // 20MHz, no change
259+
break;
260+
case 0xf: // 80MHz, slow to 26
261+
SPI0CLK = 0x00002002;
262+
SPI0C = 0x00EAA202;
263+
break;
264+
default:
265+
break;
266+
}
267+
}
268+
}
269+
#endif // XMC_SUPPORT
214270
ets_wdt_disable();
215271
res = copy_raw(cmd.args[0], cmd.args[1], cmd.args[2]);
216272
ets_wdt_enable();
273+
274+
#ifdef XMC_SUPPORT
275+
// restore the saved flash access speed registers
276+
SPI0CLK = spi0clk;
277+
SPI0C = spi0c;
278+
#endif
217279
ets_putc('0'+res); ets_putc('\n');
218280
if (res == 0) {
219281
cmd.action = ACTION_LOAD_APP;

bootloaders/eboot/eboot.elf

-176 Bytes
Binary file not shown.

bootloaders/eboot/spi_vendors.h

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/*
2+
spi_vendors.h - Vendor IDs for SPI chips
3+
Copyright (c) 2019 Mike Nix. All rights reserved.
4+
This file is part of the esp8266 core for Arduino environment.
5+
6+
This library is free software; you can redistribute it and/or
7+
modify it under the terms of the GNU Lesser General Public
8+
License as published by the Free Software Foundation; either
9+
version 2.1 of the License, or (at your option) any later version.
10+
11+
This library is distributed in the hope that it will be useful,
12+
but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14+
Lesser General Public License for more details.
15+
16+
You should have received a copy of the GNU Lesser General Public
17+
License along with this library; if not, write to the Free Software
18+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19+
*/
20+
21+
#ifndef __SPI_VENDORS_H__
22+
#define __SPI_VENDORS_H__
23+
24+
// Vendor IDs taken from Flashrom project
25+
// https://review.coreboot.org/cgit/flashrom.git/tree/flashchips.h?h=1.0.x
26+
// Moved here from ../../cores/esp8266/Esp.h
27+
typedef enum {
28+
SPI_FLASH_VENDOR_ALLIANCE = 0x52, /* Alliance Semiconductor */
29+
SPI_FLASH_VENDOR_AMD = 0x01, /* AMD */
30+
SPI_FLASH_VENDOR_AMIC = 0x37, /* AMIC */
31+
SPI_FLASH_VENDOR_ATMEL = 0x1F, /* Atmel (now used by Adesto) */
32+
SPI_FLASH_VENDOR_BRIGHT = 0xAD, /* Bright Microelectronics */
33+
SPI_FLASH_VENDOR_CATALYST = 0x31, /* Catalyst */
34+
SPI_FLASH_VENDOR_EON = 0x1C, /* EON Silicon Devices, missing 0x7F prefix */
35+
SPI_FLASH_VENDOR_ESMT = 0x8C, /* Elite Semiconductor Memory Technology (ESMT) / EFST Elite Flash Storage */
36+
SPI_FLASH_VENDOR_EXCEL = 0x4A, /* ESI, missing 0x7F prefix */
37+
SPI_FLASH_VENDOR_FIDELIX = 0xF8, /* Fidelix */
38+
SPI_FLASH_VENDOR_FUJITSU = 0x04, /* Fujitsu */
39+
SPI_FLASH_VENDOR_GIGADEVICE = 0xC8, /* GigaDevice */
40+
SPI_FLASH_VENDOR_HYUNDAI = 0xAD, /* Hyundai */
41+
SPI_FLASH_VENDOR_INTEL = 0x89, /* Intel */
42+
SPI_FLASH_VENDOR_ISSI = 0xD5, /* ISSI Integrated Silicon Solutions, see also PMC. */
43+
SPI_FLASH_VENDOR_MACRONIX = 0xC2, /* Macronix (MX) */
44+
SPI_FLASH_VENDOR_NANTRONICS = 0xD5, /* Nantronics, missing prefix */
45+
SPI_FLASH_VENDOR_PMC = 0x9D, /* PMC, missing 0x7F prefix */
46+
SPI_FLASH_VENDOR_PUYA = 0x85, /* Puya semiconductor (shanghai) co. ltd */
47+
SPI_FLASH_VENDOR_SANYO = 0x62, /* Sanyo */
48+
SPI_FLASH_VENDOR_SHARP = 0xB0, /* Sharp */
49+
SPI_FLASH_VENDOR_SPANSION = 0x01, /* Spansion, same ID as AMD */
50+
SPI_FLASH_VENDOR_SST = 0xBF, /* SST */
51+
SPI_FLASH_VENDOR_ST = 0x20, /* ST / SGS/Thomson / Numonyx (later acquired by Micron) */
52+
SPI_FLASH_VENDOR_SYNCMOS_MVC = 0x40, /* SyncMOS (SM) and Mosel Vitelic Corporation (MVC) */
53+
SPI_FLASH_VENDOR_TENX = 0x5E, /* Tenx Technologies */
54+
SPI_FLASH_VENDOR_TI = 0x97, /* Texas Instruments */
55+
SPI_FLASH_VENDOR_TI_OLD = 0x01, /* TI chips from last century */
56+
SPI_FLASH_VENDOR_WINBOND = 0xDA, /* Winbond */
57+
SPI_FLASH_VENDOR_WINBOND_NEX = 0xEF, /* Winbond (ex Nexcom) serial flashes */
58+
SPI_FLASH_VENDOR_XMC = 0x20, /* Wuhan Xinxin Semiconductor Manufacturing Corp */
59+
60+
SPI_FLASH_VENDOR_UNKNOWN = 0xFF
61+
} SPI_FLASH_VENDOR_t;
62+
63+
#endif // __SPI_VENDORS_H__

cores/esp8266/Arduino.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,8 @@ long secureRandom(long);
276276
long secureRandom(long, long);
277277
long map(long, long, long, long, long);
278278

279+
void setTZ(const char* tz);
280+
279281
void configTime(int timezone, int daylightOffset_sec, const char* server1,
280282
const char* server2 = nullptr, const char* server3 = nullptr);
281283

0 commit comments

Comments
 (0)