1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-21 10:26:06 +03:00

3392 Commits

Author SHA1 Message Date
david gauchard
fbcc69b989 fake library directory: prevent building an archive (#6671)
On some cases, this library archive is used but is non existent
because there is no source file.
disabling archive building fixes this issue.
2019-10-26 15:06:24 -07:00
Earle F. Philhower, III
41ba21613d
Fix Python3 errors for device tests (#6670)
* Fix Python3 errors for device tests

The Python3 migration didn't include fixes for local scripts in the
device test tree.

Fatal build and run Python errors fixed.

The last update to xunitmerge is ~5 years ago, so it looks to be
unsupported now.

Use a local copy of the two components to allow patching to work with
Python3.

The serial test seems to send garbage chars (non-ASCII/etc.), so use a
codepage 437 which supports all 255 chars.

Fixes: #6660

* Run tests at 160MHz (req'd for some SSL connections)

* Fix debuglevel options for builder

* Fix Python3 interpreter path in xunitmerge

* Remove virtualenv on "make clean"

* Add appropriate attribution, license to xunitmerge

Add like to the original sources with the author's license to the
copied/fixed xunitmerge files.
2019-10-26 13:58:54 -07:00
Dirk Mueller
1e17dddd89 Fix inconsistent CRLF/LF combinations (#6653)
These files had either CRLF, LFCR or LF or a mixture of it.
Consistently format them as git text files (unix style) with
trailing whitespace removed.
2019-10-19 13:10:41 -03:00
Dirk O. Kaar
855b91ea69 EspSoftwareSerial bug fix update 5.3.4 (#6651) 2019-10-18 08:59:26 -07:00
Robin Richtsfeld
45d71ae4bd Support FS update in two steps (#6505)
* Support FS update in two steps
2019-10-16 10:11:15 +02:00
Earle F. Philhower, III
40f456aca3
Dynamically find the Python3 dir on Windows (#6646)
Windows installers place each version of Python in their own, uniquely
named directory.  Can't programatically override w/free Chocolatey, so
use the shell and figure it where it installed it dynamically.
2019-10-15 09:21:18 -07:00
Earle F. Philhower, III
2a5d215977
Reduce the IRAM usage of I2C code by 600-1500 bytes (#6326)
* Reduce the IRAM (and heap) usage of I2C code

The I2C code takes a large chunk of IRAM space.  Attempt to reduce the
size of the routines without impacting functionality.

First, remove the `static` classifier on the sda/scl variables in the
event handlers.  The first instructions in the routines overwrite the
last value stored in them, anyway, and their addresses are never taken.

* Make most variables ints, not uint8_ts

Where it doesn't make a functional difference, make global variables
ints and not unit8_t.  Bytewide updates and extracts require multiple
instructions and hence increase IRAM usage as well as runtime.

* Make local flag vars int

Sketch uses 270855 bytes (25%) of program storage space. Maximum is 1044464 bytes.
Global variables use 27940 bytes (34%) of dynamic memory, leaving 53980 bytes for local variables. Maximum is 81920 bytes.
./xtensa-lx106-elf/bin/xtensa-lx106-elf-objdump -t  -j .text1 /tmp/arduino_build_9615/*elf | sort -k1 | head -20
401000cc l     F .text1	00000014 twi_delay
401000ec l     F .text1	00000020 twi_reply$part$1
4010010c g     F .text1	00000035 twi_reply
4010014c g     F .text1	00000052 twi_stop
401001a0 g     F .text1	0000003b twi_releaseBus
40100204 g     F .text1	000001e6 twi_onTwipEvent
40100404 l     F .text1	000001f7 onSdaChange
40100608 l     F .text1	000002fd onSclChange
40100908 l     F .text1	0000003b onTimer

* Factor out !scl in onSdaChange

If SCL is low then all branches of the case are no-ops, so factor that
portion outo to remove some redundant logic in each case.

Sketch uses 270843 bytes (25%) of program storage space. Maximum is 1044464 bytes.
Global variables use 27944 bytes (34%) of dynamic memory, leaving 53976 bytes for local variables. Maximum is 81920 bytes.

401000cc l     F .text1	00000014 twi_delay
401000ec l     F .text1	00000020 twi_reply$part$1
4010010c g     F .text1	00000035 twi_reply
4010014c g     F .text1	00000052 twi_stop
401001a0 g     F .text1	0000003b twi_releaseBus
40100204 g     F .text1	000001e6 twi_onTwipEvent
40100404 l     F .text1	000001e7 onSdaChange
401005f8 l     F .text1	000002fd onSclChange
401008f8 l     F .text1	0000003b onTimer

0x0000000040107468                _text_end = ABSOLUTE (.)

* Make tiny twi_reply inline

twi_reply is a chunk of code that can be inlined and actually save IRAM
space because certain conditions acan be statically evaluated by gcc.

Sketch uses 270823 bytes (25%) of program storage space. Maximum is 1044464 bytes.
Global variables use 27944 bytes (34%) of dynamic memory, leaving 53976 bytes for local variables. Maximum is 81920 bytes.

401000cc l     F .text1	00000014 twi_delay
401000f4 g     F .text1	00000052 twi_stop
40100148 g     F .text1	0000003b twi_releaseBus
401001b0 g     F .text1	00000206 twi_onTwipEvent
401003d0 l     F .text1	000001e7 onSdaChange
401005c4 l     F .text1	000002fd onSclChange
401008c4 l     F .text1	0000003b onTimer
40100918 g     F .text1	00000085 millis
401009a0 g     F .text1	0000000f micros
401009b0 g     F .text1	00000022 micros64
401009d8 g     F .text1	00000013 delayMicroseconds
401009f0 g     F .text1	00000034 __digitalRead
401009f0  w    F .text1	00000034 digitalRead
40100a3c g     F .text1	000000e4 interrupt_handler
40100b20 g     F .text1	0000000f vPortFree

0x0000000040107434                _text_end = ABSOLUTE (.)

* Inline additional twi_** helper functions

Sketch uses 270799 bytes (25%) of program storage space. Maximum is 1044464 bytes.
Global variables use 27944 bytes (34%) of dynamic memory, leaving 53976 bytes for local variables. Maximum is 81920 bytes.

401000cc l     F .text1	00000014 twi_delay
401000f4  w    F .text1	0000003b twi_releaseBus
4010015c g     F .text1	00000246 twi_onTwipEvent
401003bc l     F .text1	000001e7 onSdaChange
401005b0 l     F .text1	000002f9 onSclChange
401008ac l     F .text1	0000003b onTimer

0x000000004010741c                _text_end = ABSOLUTE (.)

* Convert state machine to 1-hot for faster lookup

GCC won't use a lookup table for the TWI state machine, so it ends up
using a series of straight line compare-jump, compare-jumps to figure
out which branch of code to execute for each state.  For branches that
have multiple states that call them, this can expand to a lot of code.

Short-circuit the whole thing by converting the FSM to a 1-hot encoding
while executing it, and then just and-ing the 1-hot state with the
bitmask of states with the same code.

Sketch uses 270719 bytes (25%) of program storage space. Maximum is 1044464 bytes.
Global variables use 27944 bytes (34%) of dynamic memory, leaving 53976 bytes for local variables. Maximum is 81920 bytes.

401000cc l     F .text1	00000014 twi_delay
401000f4  w    F .text1	0000003b twi_releaseBus
4010015c g     F .text1	00000246 twi_onTwipEvent
401003c0 l     F .text1	000001b1 onSdaChange
40100580 l     F .text1	000002da onSclChange
4010085c l     F .text1	0000003b onTimer

0x00000000401073cc                _text_end = ABSOLUTE (.)

Saves 228 bytes of IRAM vs. master, uses 32 additional bytes of heap.

* Factor out twi_status setting

twi_status is set immediately before  an event handler is called,
resulting in lots of duplicated code.  Set the twi_status flag inside
the handler itself.

Saves an add'l ~100 bytes of IRAM from prior changes, for a total of
~340 bytes.

earle@server:~/Arduino/hardware/esp8266com/esp8266/tools$ ./xtensa-lx106-elf/bin/xtensa-lx106-elf-objdump -t  -j .text1 /tmp/arduino_build_849115/*elf | sort -k1 | head -20

401000cc l     F .text1	00000014 twi_delay
401000f4  w    F .text1	0000003b twi_releaseBus
40100160 g     F .text1	0000024e twi_onTwipEvent
401003c8 l     F .text1	00000181 onSdaChange
40100558 l     F .text1	00000297 onSclChange

* Use a struct to hold globals for TWI

Thanks to the suggestion from @mhightower83, move all global objects
into a struct.  This lets a single base pointer register to be used in
place of constantly reloading the address of each individual variable.

This might be better expressed by moving this to a real C++
implementaion based on a class object (the twi.xxxx would go back to the
old xxx-only naming for vars), but there would then need to be API
wrappers since the functionality is exposed through a plain C API.

Saves 168 additional code bytes, for a grand total of 550 bytes IRAM.

earle@server:~/Arduino/hardware/esp8266com/esp8266/tools$ ./xtensa-lx106-elf/bin/xtensa-lx106-elf-objdump -t  -j .text1 /tmp/arduino_build_849115/*elf | sort -k1 | head -20

401000cc l     F .text1	00000014 twi_delay
401000e8  w    F .text1	00000032 twi_releaseBus
40100128 g     F .text1	00000217 twi_onTwipEvent
4010034c l     F .text1	00000149 onSdaChange
4010049c l     F .text1	00000267 onSclChange
40100704 l     F .text1	00000028 onTimer

* Use enums for states, move one more var to twi struct

Make the TWI states enums and not #defines, in the hope that it will
allow GCC to more easily flag problems and general good code
organization.

401000cc l     F .text1	00000014 twi_delay
401000e8  w    F .text1	00000032 twi_releaseBus
40100128 g     F .text1	00000217 twi_onTwipEvent
4010034c l     F .text1	00000149 onSdaChange
4010049c l     F .text1	00000257 onSclChange
401006f4 l     F .text1	00000028 onTimer

Looks like another 16 bytes IRAM saved from the prior push.

Sketch uses 267079 bytes (25%) of program storage space. Maximum is 1044464 bytes.
Global variables use 27696 bytes (33%) of dynamic memory, leaving 54224 bytes for local variables. Maximum is 81920 bytes.

* Save 4 heap bytes by reprdering struct

* Convert to C++ class, clean up code

Convert the entire file into a C++ class (with C wrappers to preserve
the ABI).  This allows for setting individual values of the global
struct(class) in-situ instead of a cryptic list at the end of the struct
definition.  It also removes a lot of redundant `twi.`s from most class
members.

Clean up the code by converting from `#defines` to inline functions, get
rid of ternarys-as-ifs, use real enums, etc.

For slave_receiver.ino, the numbers are:
GIT Master IRAM: 0x723c
This push IRAM: 0x6fc0

For a savings of 636 total IRAM bytes (note, there may be a slight flash
text increase, but we have 1MB of flash to work with and only 32K of IRAM
so the tradeoff makes sense.

* Run astyle core.conf, clean up space/tab/etc.

Since the C++ version has significant text differences anyway, now is a
good time to clean up the mess of spaces, tabs, and differing cuddles.

* Add enum use comment, rename twi::delay, fix SDA/SCL_READ bool usage

Per review comments

* Replace clock stretch repeated code w/inline loop

There were multiple places where the code was waiting for a slave to
finish stretching the clock.  Factor them out to an *inline* function
to reduce code smell.

* Remove slave code when not using slave mode

Add a new twi_setSlaveMode call which actually attached the interrupts
to the slave pin change code onSdaChenge/onSclChange.  Don't attach
interrupts in the main twi_begin.

Because slave mode is only useful should a onoReceive or onRequest
callback, call twi_setSlaveMode and attach interrupts on the Wire
setters.

This allows GCC to not link in slave code unless slave mode is used,
saving over 1,000 bytes of IRAM in the common, master-only case.
2019-10-14 14:32:41 -07:00
david gauchard
122e87019f
fix because of SoftwareSerial API change (#6635) 2019-10-13 00:32:07 +02:00
david gauchard
405f945d7e
esptool-2.7 (#6634) 2019-10-12 23:12:49 +02:00
Allman-astyler
9bdcd4f36a Allman astyle: mDNS (#6629)
* allmanize mDNS
2019-10-10 23:30:06 +02:00
Develo
52bc1df424
Update installing.rst (#6625)
Add uninstalling of previous core versions into prerequisites for latest git instructions
Added prior step for uninstalling to Other OS
2019-10-10 13:30:01 -03:00
david gauchard
8e0aac92c0 CI: trusty (u14.04) -> bionic (u18.04) (#6627)
* no-op test

* no-op test

* bionic

* missing python package for doc building with bionic

* fix previous commit

* remove external repo for gcc7 (causing issues), it is default under bionic
fix python3-setuptools install

* tryfix git submodule recursive (git 2.21/2.22 ?)
2019-10-10 12:30:59 -03:00
Develo
5af402e4dc
Update README.md (#6624)
Replace latest git instructions in the README with a pointer to the instructions in readthedocs
2019-10-09 00:05:21 -03:00
David J. Fiddes
d3debb64c9 Expand NTP-TZ-DST example to list SNTP servers (#6611)
This change expands the NTP-TZ-DST example to list the active
SNTP servers. It lists the IP address server name (if used) and
reachability in ntpq style octal format.

Tests:
 - Build against all LwIP stack configurations and correct
   operation with a single SNTP server
 - Vary connectivity to an SNTP server and check reachability
   updates
 - Configure 3 SNTP servers by name
 - With a patched LwIP stack that supports simultaneous DHCP
   and DHCPv6 SNTP servers check that all server details are
   listed and update correctly during operation
2019-10-08 08:41:42 -07:00
dsv19
8c3f1be63f Serial.flush modification (#5293)
* Modify Serial.flush

* Add function to uart tests
2019-10-08 05:36:39 -07:00
Dirk Mueller
8b16d9c1d1 Fix build with -DHTTPCLIENT_1_1_COMPATIBLE=0 (#6597)
We need to disable HTTPUPDATE_1_2 support when HTTPCLIENT_1_1
compatibility is not desired to avoid using methods that are
disabled.
2019-10-07 16:57:18 -07:00
david gauchard
fabd169abc Puyafix (#6619)
* PUYA was not correctly enabled

* remove duplicate
2019-10-07 19:31:30 -03:00
Earle F. Philhower, III
75c3834c8f Move cont_run/cont_yield out of IRAM (#6617)
cont_run is only called by loop_task(), which is not going to execute
during an IRQ and is stored, itself, in flash.

cont_yield cannot be called from an IRQ (since it's illegal to yield
inside IRQs), so move it out of IRAM, too.

Saves ~71 bytes of IRAM
2019-10-07 18:37:59 -03:00
Max Prokhorov
d62fb9ffeb MDNS: fix legacy unicast responses (#6613)
* mdns: use ID from parameter struct when constructing response message

* print id for legacy requests
2019-10-07 14:25:51 +02:00
David J. Fiddes
d7abafea2f Remove duplication and incompatible declarations in sntp.h (#6610)
This removes definitions relating to the built-in SNTP client that
are LwIP v1 specific. Instead of duplicating these pull in the
LwIP header that correspond to the required functions depending on
the version of the stack being used.

Without this fix calls to sntp_getserver() work but return invalid
data and can lead to stack exhaustion.

Update the NTP-TZ-DST example to use the Arduino sntp.h header
rather than duplicate the conditional checks to use the LwIP header.

Tests:
 - Build against a simple SNTP API demonstratin app and all
   LwIP configurations. Verify that the app runs for an extended
   period and that the expected results are obtained.
2019-10-06 15:25:34 -07:00
david gauchard
c55f49bd61
use a scheduled function for settimeofday_cb (#6600)
* use a scheduled function for settimeofday_cb

* per review

* use a generic and clear name for trivial functional variable type name used for callbacks
2019-10-06 22:50:57 +02:00
Develo
d1b70dfc1d
Minor cleanups in ESPClass (#6608)
* Minor cleanups in ESPClass

Related to #6599

Fix inverted conditions

Remove useless comments
2019-10-06 00:07:26 -03:00
Develo
a00a4744d0
Update EEPROM.cpp (#6599)
use InterruptLock class for scoped interrupts instead of blindly disabling/enabling interrupts, which doesn't support nesting nor restore previous state.

Add forgotten include

Remove locks, simplify code

Fix typo

Drop needless include
2019-10-05 22:21:41 -03:00
david gauchard
08a0414ee0
remove esptool.py --trace option (#6606)
fixes #6605
2019-10-05 22:27:42 +02:00
c0degeek
d4897cd216 Added Chip ID into HTTP header (#3877) 2019-10-05 11:28:33 -07:00
Kristian Sloth Lauszus
5d20137339 Set SPI_HAS_TRANSACTION to 1 (#6591)
See #2639
2019-10-04 17:25:54 -07:00
Dirk Mueller
bab2880f01 Base64::encode : const correctness / String by reference passing (#6581)
This is another instance in the core library where we pass in read-only
parameters as pass-by-value, where in the case of String() that
is inefficient as it involves copy-constructor/temp string creations.
2019-10-04 15:36:39 -07:00
Dirk Mueller
3890e1af1e Put longer string literals into PROGMEM (#6588)
* Put longer string literals into PROGMEM

* Use Flash Strings for Debug output

This is hopefully very infrequently used, so it shouldn't
be in main memory.
2019-10-03 23:17:36 -03:00
Earle F. Philhower, III
fb2cbe36a1
Fix pgm_read_float_unaligned macro (#6593)
Fixes #6590

The ASM block that implements the read-uint32-unaligned returns a
uint32_t.  The old code was doing a cast like `(float)(uint32_t ret)
which actually goes and creates a new float of the positive uint value
(approx, of course due to exponent and sign bits) which is not correct.

C and C++ don't have a concise way to convert the bits in a register
from int to float interpretation, so avoid the whole issue by making a
new function which uses the same ASM block as the read-uint32-unaligned,
just make the destination and return values as floats.
2019-10-03 08:21:07 -07:00
Dirk O. Kaar
899893294c Align to latest EspSoftwareSerial release (#6584)
* Align to latest EspSoftwareSerial release - nothing ESP8266 specific, but drifting versions otherwise makes life hard for users.

* ghostl array compatibility: aggregate initialization, no implicit cast to T*.
2019-10-02 10:26:47 -07:00
david gauchard
9388d08a1d prepare alpha channel release builder (#6512) 2019-10-02 08:54:03 -07:00
Earle F. Philhower, III
215459fda4
Replace ASM block w/C macro for PSTR (#6577)
* Replace ASM block w/C marco for PSTR

GAS doesn't support the C language idiom of catenating two strings
together with quotes (i.e. "x" "y" === "xy").

Specify the section attribute fully in the section attribute, instead,
to allow this.

* Fix WString optimization

PR #6573 introduced a corner case where a blind String() without any
initialization was in an in invalid state because the buffer and len
would not be updated properly.  Concatenating to the empty string could
cause a failure.

Now, set the default state in ::init() to SSO (which is what happened
before when we were using String(char *s="")) and fix the crash.
2019-10-01 13:02:02 -07:00
Earle F. Philhower, III
1aeea124b3 Speed up empty String creation slightly (#6573)
As @dirkmuller found out in #6568, there is a difference in code
executed between `String str(nullptr)` and `String str("")`, but in the
end the actual object is identical.  It's a few bytes of code, but every
little bit counts.

Update the default `String()` constructor to use `nullptr` and not `""`.
This will remove a constant literal load and the execution of the
String::copy method and strlen().
2019-10-01 02:35:23 -03:00
Dirk Mueller
1d26b28225 Remove duplicated sha1 implementation (Fixes #6568) (#6569)
* Remove duplicated sha1 implementation (Fixes #6568)

The Hash library had its own copy of a loop-unrolled sha1 implementation
adding a large code footprint for no good reason, as there are several
sha1 implementations already in tree (one in NONOS-SDK as well as one
in bearssl). Switching to the bearssl one is straightforward and removes
about 3kb of code size overhead.

Also cleanup some obvious inefficiencies (copy by value, string
summing, no reservation causing repeated reallocations) in the
implementation.

* Remove overload variants for sha1(...) that accept nonconst data

The data is always remaining unmodified, so non-const overloads
are confusing and redundant. Also optimize the hexify variant
a bit more.
2019-09-30 20:58:09 -07:00
Dirk Mueller
2a83adb0fd Fix setURL() handling of path-only parameters (#6570)
The function accidentally compared the current location instead
of the passed in (new) location, which didn't match intended
logic and the code comment.
2019-09-30 20:23:25 -07:00
Earle F. Philhower, III
97c926ea91 Move all PSTRs to own section, allow string dedup (#6565)
* Move all PSTRs to own section, allow string dedup

GNU ld can deduplicate strings, and does so for most normal char *s
automatically.  However, for PSTRs we were using a unique section per
string *and* the section was not flagges as containing dedupable
0-terminated strings.

Modify the PSTR macro to emit assembly, which lets us set the section
flags required (SM) for the variables, and use inline assembly to get
the asm-block defined address.

Should result in smaller compiled binaries if any strings are
duplicated.

* Give each PSTR its own segment

* Allow disposing of unused strings before merging

Add the "a" section flag to allow the linker to throw away unneeded
strings.  Without this flag, the linker will not discard unreferenced
strings and ROMs will increase in size, possibly dramatically.
2019-10-01 01:27:10 +02:00
david gauchard
d4757542e4
use arduino IDE stable in CI (#6572)
* fix CI by using a stable arduino/builder version
* get rid of --allow-unauthenticated issue
2019-10-01 00:42:46 +02:00
david gauchard
ffe5476fc4 time: import IANA timezone definitions, expose SNTP API (#6373)
* time: import IANA timezone definitions
- `configTime("timezone", "ntp servers...")` added
- timezone definitions by country/cities (TZ.h)
- script to update timezone definitions
- updated example

* fix former configTime non-matching signature

* +include

* example: add scheduled function in callback

* crlf fix

* +missing license for napt

* SNTP: expose configuration helpers

* update submodule

* update precompiled libraries

* optional: change SNTP startup delay

* makes SNTP_UPDATE_DELAY a weak function
update example
fix for lwip1.4

* on the proper use of polledTimeout api... thanks @mcspr :]

* improve update script (per review)

* update lwIP submodule

* update submodule

* hide harmless shell message

* update the release process by asking first to update TZ.h
[ci skip]

* minor update in release documentation

* update in release documentation

* update in release documentation

* clarify release documentation

* fix release documentation - sorry for the noise :(

* fixes per review

* example style

* useless variable in example

* update lwip2 submodule reference, to include espressif missing declaration fixes
2019-09-29 00:25:01 -03:00
Earle F. Philhower, III
4489e239bb
Add interrupt section to docs (#6560)
* Add info about installing python3 on Mac, Linux

The Mac requires special handholding to allow SSL connections for
get.py, so document those for end users.

* Add interrupt section to docs

Adds a section on interrupts to the docs and lists the restrictions
and warnings about running long tasks.

Fixes #6428

* Update per review comments
2019-09-28 15:03:28 -07:00
Earle F. Philhower, III
c755771098
Minor FS documentation change from #2904 (#6563)
* Minor FS documentation change from #2904

Trivial addition to filesystem upload documentation.

Supercedes #2904 which cannot merge due to file renames and massive
changes to the filesystem.rst file since it was pushed.

* Fix periods on the steps, they are complete sentences
2019-09-28 12:44:03 -07:00
Dirk O. Kaar
4f2cc1ccfc Latest (5.3.1) EspSoftwareSerial tries to give better guidance about matching working versions. (#6561) 2019-09-27 17:10:44 -07:00
M Hightower
831d6431bc Add typedef for putc1, fn_putc1_t. (#6550)
* Add typedef for putc1, fn_putc1_t.
Replaced relevant usage of `(void *)` with `fn_putc1_t`.
Correct usage of `ets_putc()`, returning 0, in libc_replacement.cpp
This PR assumes PR https://github.com/esp8266/Arduino/pull/6489#issue-315018841 has merged and removes `uart_buff_switch` from `umm_performance.cpp`
Updated method of defining `_rom_putc1` to be more acceptable (I hope) to the new compiler.

* Use PROVIDE to expose ROM function entry point, ets_uart_putc1.
Added comments to ets_putc() and ets_uart_putc1() to explain their
differences. Change prototype of ets_putc() to conform with fp_putc_t.
Updated _isr_safe_printf_P to use new definition, ets_uart_putc1.
2019-09-27 14:23:16 -07:00
Earle F. Philhower, III
ff1e8e92d1
Add info about installing python3 on Mac, Linux (#6558)
The Mac requires special handholding to allow SSL connections for
get.py, so document those for end users.
2019-09-27 13:49:26 -07:00
Earle F. Philhower, III
418b00f7c0 Re-add deprecated _SPIFFS_xxx linker symbols (#6543)
In order to give user libs a change to update to the new symbols, re-add
the _SPIFFS_XX symbols to the linker file with a comment that they are
deprecated.

Also add back spiffs_hal_xxx functions, also marked as deprecated.

Fixes #6542
2019-09-26 21:28:07 +02:00
Earle F. Philhower, III
2b9fcdb568 Add EEPROM debug printouts, error check to example (#6556)
* Add EEPROM debug printouts, error check to example

Add debug printouts when EEPROM calls fail, even if the API doesn't
allow returning a success/failure code.

Adds error checking to the example to make it explicit that when you
call EEPROM::commit(), you need to look at the result code in your code.

Fixes #6551 , or would fix it if there was error checking in the MCVE.

* Clarify example error message
2019-09-26 14:48:04 -03:00
Mike Nix
244dbd7713 Add 20/26MHz Flash frequencies for slow/cheap flash chips on the Generic ESP board (#6552)
A number of non-genuine boards exist mainly from flea-bay sellers that
use under-sized and/or low quality flash chips which can not handle
a 40MHz FlashFreq properly.

This patch adds slower flash frequencies to the menu for generic ESP boards
so that these cheap knock-offs can be run in a stable manner, hopefully saving
some people a few headaches and keeping these boards out of landfill.
2019-09-24 10:32:11 -03:00
M Hightower
f3ca09006d Update UART selection for Boot ROM ets_putc, when debug port is selected. (#6489)
* Add code to select the UART for Boot ROM ets_putc which is used by
::printf, ets_printf_P in core_esp_postmortem.cpp and others.

ets_putc is a wrapper for uart_tx_one_char. uart_tx_one_char uses
the element buff_uart_no in UartDev (A structure in data area of the
Boot ROM) to select UART0 or UART1. uart_buff_switch is used to set
that entry.

The structure for UartDev can be found in uart.h from the
ESP8266_NONOS_SDK. As best I can tell the Boot ROM always
defaults to UART0.

* Fixes debug UART selection for ets_putc

This addresses an issue of UART selection for ROM function ets_putc,
which is used by ::printf, ets_printf_P in core_esp_postmortem.cpp
and others. Currently ets_putc stays on UART0 after
Serial1.setDebugOutput(true) is called.

ets_putc() is not affected by calls to ets_install_putc1.
Its UART selection is controlled by the ROM function uart_buff_switch.

Updated uart_set_debug() to call uart_buff_switch whenever debug is
enabled on an UART. For the case of disabling, a call to select UART0
is made, because there is no disable option for this print method.

* Removed fp_putc_t typedef, save for a later PR
2019-09-23 14:05:27 -07:00
Max Prokhorov
308e131dee Update EEPROM library documentation (#6548)
Update EEPROM description with mention of current implementation limitations
Move ESP_EEPROM to Other Libraries, update description from upstream README
Add https://github.com/xoseperez/eeprom_rotate to Other Libraries as an alternative
2019-09-23 07:30:02 -07:00
Earle F. Philhower, III
69f3e81fb9
Restore EEPROM address to prior released location (#6537)
When the FS_END was adjusted to end on a full block (i.e. rounded down)
to avoid filesystem issues, but _FS_end was changed.  The EEPROM library
used _FS_end to implicitly calculate the start of the EEPROM data, so
this means after the _FS_end fix, EEPROM data written with prior
releases would "disappear."

Avoid the issue by explicitly calculating the EEPROM start location in
the linker, using the same formula as prior release.

Fixes #6531
2019-09-20 08:24:10 -07:00
Carlos Alberto Nunes
3733ece7e8 Allow Filesystem update via ESP8266HTTPUpdateServer (#3732)
* Allow SPIFFS update via ESP8266HTTPUpdateServer

This adds capability to update the SPIFFS image via
the same mechansism as firmware in the 
ESP8266HTTPUpdateServer.

It does not provide any dependency or linkage between
firmware and spiffs image updating; they are each taken
on their own, each followed by a reboot.

(I wrote this before seeing the other PR for similar
functionality; I like this a bit better, becaue it uses
the available SPIFFS size, and does not hide magic numbers
(U_SPIFFS) in the html...)

(It also cleans up a stray \n from commit ace0622)

* A simple filter

* Review https://github.com/esp8266/Arduino/pull/3234#pullrequestreview-37773153

* Including suggestions for mobile first #3961

* SPIFFS rennamed to FS

* including comments from @earlephihower

* button renaming

* missing #include for LittleFS

* generic names as suggested by @d-a-v
2019-09-20 09:44:48 +02:00