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

4405 Commits

Author SHA1 Message Date
Earle F. Philhower, III
adbd23b6e2
Add stub for analogReference (#7809)
Fixes #6410

We actually provide a function prototype for `analogReference()` in
`Arduino.h`, but no implementation.  Add a dummy one that only supports
DEFAULT (like other Arduino boards).
2021-01-07 21:14:14 -08:00
M Hightower
67e1dfc5a4
Extended ASM got fussy when using different optimizations. ie. HWDT (#7816)
resets. It seems you should not use input registers for scratch registers.
Add an extra output register instead. No code size increase.

Light refactoring for readability

Added "C" reference code for Extended ASM

Save two cycles by loading a0 early in exc-c-wrapper-handler.S

Use optimization O2
Net change in size, 0 bytes with optimization. Save 4 bytes w/o Optimization.
With changes and "O2" save 3 cycles on write and 6 cycles on read.
2021-01-07 21:05:24 -08:00
M Hightower
2f5979f1f0
Verify IRAM sum results using DRAM as reference. (#7812)
Make verify fail more visible.

Updated example irammem.info to show performance and test int16 handling
when IRAM is used.

Removed 4K performance test. It didn't show any new information over the 1K test.
2021-01-07 20:45:15 -08:00
Dirk O. Kaar
f959cb321b
EspSoftwareSerial 6.11.2: Delegate<> assign operators added. (#7815)
Addresses compilation errors with pending PRs due to commit 95fb104562
2021-01-07 20:36:58 -08:00
david gauchard
43f44e4b13
emulation on host: millis()/micros() now start at 0 (#7810)
emulation on host: millis()/micros() now start at 0
2021-01-05 12:21:16 +01:00
Earle F. Philhower, III
100a8df33f
Reduce BearSSL code size by not -O2 FSMs (#7807)
The FSMs that drive the encryption logic are not performance critical,
but they are very large.  Build BearSSL using -Os on them, leaving -O2
everywhere else (i.e. encryption) for speed.

Saves 1-2KB of flash for SSL applications.
2021-01-03 22:47:39 +01:00
Earle F. Philhower, III
da138456a6
Fix header FSM in webserver, fix Windows uploads (#7805)
When a file upload ends in \r\n (i.e. a Windows formatted text file) the
sequence of bytes on the wire is `\r\n\r\n----...boundary-marker...`.

When the FSM in Webserver was evaluating the stream, that 2nd `\r` would
be written as valid data and the FSM parser would be reset and see `\n`
as the 1st character, which wouldn't match.  This would a) add an extra
`\r` to uploaded files, and b) cause uploads to hang.

Fix by checking on a header FSM mismatch if the next character input
could possibly match our marker, and if so handle it properly.

Fixes #7803
2021-01-01 13:07:59 -08:00
david gauchard
5b42e73baa
upgrade arduino in CI (#7716)
Thanks to @matthijskooijman, @per1234 and @earlephilhower
2020-12-31 23:19:58 +01:00
Dirk O. Kaar
a25895a764
Minor EspSoftwareSerial release 6.11.1 (#7804)
* Minor EspSoftwareSerial release 6.11.0: more GPIOs for ESP32

* EspSoftwareSerial: Fix unused parameter warning.

* Revert "Minor EspSoftwareSerial release 6.11.0 (#7802)"

This reverts commit 229903a24d508288b237afd20de7baf3ff29b74d.
2020-12-31 12:56:44 -08:00
Dirk O. Kaar
229903a24d
Minor EspSoftwareSerial release 6.11.0 (#7802)
* Minor EspSoftwareSerial release 6.11.0: more GPIOs for ESP32

* EspSoftwareSerial: Fix unused parameter warning.
2020-12-31 10:54:12 -08:00
Dirk O. Kaar
84260dcb44
Write loop could lead to wdt with low bitrates or large buffers. Fixes #7746 (#7799) 2020-12-30 16:05:20 -08:00
David Luna
a3a7a23a92
Typo error in ESP8266WiFiGeneric.h (#7797)
Error in copyright text about Arduino Wifi library
2020-12-27 22:15:26 +01:00
david gauchard
5c29517d11
lwip2: use pvPortXalloc/vPortFree and "-free -fipa-pta" (#7793)
lwip2: use pvPortXalloc/vPortFree instead of malloc/free and add gcc's '-free -fipa-pta' options
2020-12-24 10:56:21 -08:00
Earle F. Philhower, III
5356c87b5b
Use smarter cache key, cache Arduino IDE (#7791)
Thanks to @mcspr.  Make sure the cached toolchain is only valid when the
package.json file is identical.  Also, add the Arduino IDE to the cache
to avoid re-downloads.
2020-12-23 15:00:04 -08:00
Earle F. Philhower, III
c487ca5233
Update to SdFat 2.0.2, speed SD access (#7779)
* Update to upstream SdFat 2.0.2

Increases the read/write performance for SD card accesses
by a significant amount, up to 5x (3+MB/s) in testing.

Fixes #7772 

* Add SDFS::availableForWrite handler

Peek into the sector cache to determine the maximum number of
bytes that can be written w/o needing a (slow) SD operation.

Fixes #7650
2020-12-23 11:39:12 -08:00
Earle F. Philhower, III
9de8373f1b
BREAKING - Upgrade to upstream newlib 4.0.0 release (#7708)
* Upgrade to upstream newlib 4.0.0 release

Includes 64 bit time_t and 5 years of updates.

Binary incompatible with libraries which use time_t (due to the size
difference).  Recompiling with the new newlib should be sufficient for
most libraries, assuming source is available.

* Remove tools/sdk/libc directory, it isn't used anywhere

Somewhere along the line the copy of libc in tools/sdl/libc was taken
out of the build process.  Files in there are not used, take add'l time
to build and install on a toolchain release, and just cause confusion.
Remove them.

* Fix 64-bit time for LittleFS

The core was setting 64-bit times automatically on new file creation or
updates, but would fail when attempting to read them back due to 64/32b
confusion.

Now attempt to read 64b time, and if that fails fallback to reading 32b
time to allow both old and new FS to preserve timestamps.

* Update to jjsuwa-sys3175 additions to GCC and newlib

@jjsuwa-sys3175 contributed multiple patches to GCC, included in
the toolchain, as well as a slightly faster pgm_read_byte() macro.

* Rebuild w/addl GCC patches, new BearSSL flags

* Remove copied libgcc.a file, is contained in toolchain
2020-12-23 11:21:38 -08:00
david gauchard
e25ad86c91
mock: +hexdump() from debug.cpp (#7789) 2020-12-22 22:50:53 +01:00
david gauchard
51c2a1437b
more lwIP physical interfaces (#6680)
This commit adds W5500 W5100 and ENC28j60 drivers from @njh with credits
They are available in libraries/
An example is added in W5500 examples directory

plus:
* Extract dhcp server from lwip2 and add it to the core as a class.
  It must always be present, it is linked and can be called by fw on boot.
  So it cannot be stored in a library.
* ethernet: static or dhcp works
* PPPServer: example
* bring WiFi.config() to the lwIP generic interface (argument reorder common function)
* move hostname() from WiFI-STA to generic interface
* remove non readable characters from dhcp-server comments
* dhcp-server: magic_cookie is part of bootp rfc
* fixes from https://github.com/d-a-v/W5500lwIP/issues/17
* enable lwip_hook_dhcp_parse_option()
* +ethernet tcp client example in w5500 library examples
2020-12-22 22:36:21 +01:00
Earle F. Philhower, III
35d22edeec
Rationalize File timestamp callback (#7785)
Fixes #7775

Clean up the passing/setting of custom File time callbacks and add a
host test verifying they work.  Existing core was not passing custom
timeCallbacks set at the FS level down to open()ed files, resulting in
them calling the default time(nullptr) and reporting wrong file modify
times.
2020-12-22 10:41:11 +01:00
Earle F. Philhower, III
f1dc6e90ee
Update to LittleFS v2.3 (#7787)
Minor performance improvement and LFS_READONLY added, enabling smaller
code for things like eboot should we want to us it in a bootloader/etc.
2020-12-21 21:21:42 -08:00
Zakary Kamal Ismail
032db6fc81
WiFiServerSecure: Cache SSL sessions (#7774)
* WiFiServerSecure: Cache the SSL sessions

* Add SSL session caching to HTTPS server examples

* Document server SSL session caching

* Fix an incomplete sentence in the documentation

* Document BearSSL::Session

* Use the number of sessions instead of the buffer size in ServerSessions' constructors
2020-12-21 21:13:43 -08:00
Takayuki 'January June' Suwa
8add1fd2d9
platform.txt: instruct GCC to perform more aggressive optimization (#7770)
Add `-free -fipa-pta` to GCC options (generates a bit smaller binary)
2020-12-21 21:06:19 -08:00
david gauchard
7dbef42ada
LEAmDNS fixes (#7786)
* LEAmDNS2 removed
* LEAmDNSv1: fix macro name
2020-12-22 01:29:00 +01:00
Earle F. Philhower, III
f3521da173
Move uzlib to master branch (#7782)
Merged uzlib with master instead of referencing a branch.  Makes it
saner for future updates (will be off master instead of off "newstuff"
branch).
2020-12-19 10:31:52 -08:00
Earle F. Philhower, III
a9c46d07d5
Update to latest uzlib upstream (#7776) 2020-12-17 14:03:41 -08:00
Dirk O. Kaar
dbe7eb89b9
EspSoftwareSerial bug fix release 6.10.1: preciseDelay() could delay() for extremely long time, if period duration was exceeded on entry. (#7771) 2020-12-15 12:22:57 -08:00
M Hightower
dd8c2e6b8b
Fixed OOM double count in umm_realloc. (#7768) 2020-12-14 12:47:11 -08:00
M Hightower
9eb618e3af
Added missing check for failure on umm_push_heap calls in Esp.cpp (#7767)
Added lost comments for Esp.h
2020-12-14 11:37:41 -08:00
Takayuki 'January June' Suwa
fd69945abc
Fix: cannot build after #7060 on Win64 (#7754)
* Fix: cannot build after #7060 on Win64

* add double-quotes to `compiler.S.flags`

* fix windows-specific processes (`recipe.hooks.linking.prelink.[12].pattern.windows`)

* rewrite processing of "mkdir" and "cp" in python because of platform-independence

* make consistent with the use of quotation marks in other *.py files
2020-12-14 11:09:24 -08:00
Costin Stroie
9a36cfdee9
Add the missing 'rename' method wrapper in SD library. (#7766) 2020-12-14 07:14:50 -08:00
david gauchard
1e016a4237
i2s: adds i2s_rxtxdrive_begin(enableRx, enableTx, driveRxClocks, driveTxClocks) (#7748)
Two parameters are added to allow using only i2s-in/out-data pin.
This is necessary when i2so-bck and i2so-ws are repurposed
especially because they overlap with SPI GPIO.
2020-12-11 16:41:30 -08:00
M Hightower
e76a98d335
Removed obsolete debug code (#7757) 2020-12-11 09:24:03 -08:00
Takayuki 'January June' Suwa
0f58a9009c
WiFiServer.cpp: Fix warning (#7755)
* fix warning as below:

...\libraries\ESP8266WiFi\src\WiFiServer.cpp: In member function 'WiFiClient WiFiServer::available(byte*)':
...\libraries\ESP8266WiFi\src\WiFiServer.cpp:120:55: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
  120 |             tcp_backlog_accepted(_unclaimed->getPCB());
      |                                                       ^
2020-12-11 10:54:23 +01:00
Manuel Reimer
456640012c
makecorever.py: Hide GIT error messages. Fixes #7744 (#7745)
* makecorever.py: Hide GIT error messages. Fixes #7744
2020-12-10 18:11:26 +01:00
Earle F. Philhower, III
eaaa1dbcc8
Normalize platform.txt pattern numbers (#7752)
Some tools have issues with pattern.XX numbers above 9 in platform.txt.
Adjust all pattern.XX numbering to start at 1 and remove the numbering
when there is only one step.
2020-12-10 17:39:58 +01:00
M Hightower
d4254e03f5
Fixes https://github.com/esp8266/Arduino/issues/7749#issue-760585820 (#7750)
Corrected recipe.hooks.prebuild.1x.pattern.windows in platform.txt and placed in proper order.
2020-12-10 13:47:22 +01:00
M Hightower
8b662ed3b3
PoC cache configuration control (#7060)
* PoC cache configuration control

Expaned boards.txt.py to allow new MMU options and create revised .ld's
Updated eboot to pass 48K IRAM segments.
Added Cache_Read_Enable intercept to modify call for 16K ICACHE
Update platform.txt to pass new mmu options through to compiler and linker preprocessor.
Added quick example: esp8266/MMU48K

* Style corrections
Added MMU_ qualifier to new defines.
Moved changes into their own file.
Don't know how to fix platformio issue.

* Added detailed description for Cache_Read_Enable.
Updated tools/sizes.py to report correct IRAM size and indicate ICACHE size.
Merged in earlephilhower's work on unaligned exception. Refactored and added
support for store operations and changed the name to be more closely aligned
with its function. Improved crash reporting path.

* Style and MMU_SEC_HEAP corrections.

* Improved asm register usage.
Added some inline functions to aid in byte and short access to iRAM.
 * only byte read has been tested
Updated .ld file to work better with platform.io; however, I am still
missing some steps, so platformio will still fail.

* Interesting glitch in boards.txt after github merge. A new board in
master was missing new additions added by boards.txt.py in the PR.
Which the CI flags when it rebuilds boards.txt.

* Support for 2nd Heap, excess IRAM, through umm_malloc.

Adapted changes to umm_malloc, Esp.cpp, StackThunk.cpp,
WiFiClientSecureBearSSL.cpp, and virtualmem.ino to irammem.ino from
@earlephilhower PR #6994.

Reworked umm_malloc to use context pointers instead of copy context.
umm_malloc now supports allocations from IRAM. Added class
HeapSelectIram, ... to aid in selecting alternate heaps,
modeled after class InterruptLock.
Restrict alloc request from ISRs to DRAM.

Never ending improvements to debug printing.

Sec Heap option now pulls in free IRAM left over in the 1st 32K block.
Managed through umm_malloc with HeapSelectIram.

Updated examples.

* Post push CI cleanup.

* Cleanup part II

* Cleanup part III

* Updates to support platformio, maybe.

* Added exception C wrapper replacement.

* CI Cleanup

* CI Cleanup II

Don't know what to do with platformio it doesn't like my .S file.
ifdef out USE_ISR_SAFE_EXC_WRAPPER to block the new assemlby module
from building on platformio only.

* Changes to exc-c-wrapper-handler.S to assemble under platformio.

* For platformio, Correction to toolchain-xtensa include path.
@mcspr, Thankyou!

* Temporarily added --print-memory-usage to ld parameters for cross-checking IRAM size.

* undo change to platform.txt

* correct merge conflict. take 1

* Fixed #if... for building umm_get_oom_count. It was not building when UMM_STATS_FULL was used.

* Commented out XMC support. Compatibility issues with PoC when using 16K ICACHE.

* Corrected size.py, DRAM bracketing changed to not include ICACHE with DRAM total.

* Added additional _context for support of use of UMM_INLINE_METRICS.
Corrected some UMM_POSION missed edits.

* Changes to clear errors and warnings from toolchain 10.1

Several fixes and improvements to example MMU48K.

With the improved optimization in toolchain 10.1 The example divide by 0
exception was failing with a HWDT event instead of its exception handler.
The compiler saw the obscured divide by 0 and replaced it with a break point.

* Isolated incompatable definitions related to _xtos_set_exception_handler.
GDBSTUB definitions are different from the BootROM's.

* Update tools/platformio-build.py

Co-authored-by: Max Prokhorov <prokhorov.max@outlook.com>

* Requested changes

Changed mmu related usages of ETS_... defines to DBG_MMU_...

Cleanup in example MMU48K.ino. Removed stale memory reference macro
and mmu_status print statement. Cleanup printf '\n' to be '\r\n'.

Improved issolation of development debug prints from the rest of the debug prints.

* Corrected comment. And added missing include.

* Improve comment.

* style and comment correction

* Added draft mmu.rst file and updated index.
Updated example HeapMetric.ino to also illustrate use of IRAM
Improved comments in exc-c-wrapper-handler.S. Added insurance IRQ disable.

* Updated mmu.rst

Improved function name uniqueness for is_iram, is_dram, and is_icache by
adding prefix mmu_. Also, made them available outside of a debug build.
Made pointer precision width more specific.

Made some of the static inline functions in mmu_irm.h safe for ISRs by
setting then for always inline.

* Add a default MMU_IRAM_SIZE value for a new CI test to pass.

Extended use 'umm_heap_context_t *_context' argument in ..._core functions
and expanded its usage to reduce unnecessary repeated calls to
umm_info(NULL, false), also removed recursion from umm_info(NULL, true).

Fixed stack buffer length in umm_info_safe_printf_P and heap.cpp.

Added example for creating an IRAM reserve section.

Updated mmu.rst. Grammar and spelling corrections.

* CI appeasement

* CI appeasement with comment correction.

* Ensure SYS always runs with DRAM Heap selected.

* Add/move heap stack overflow/underflow check to Esp.cpp where the event was discarded.

* Improved comment clarity of purpose for IramReserve.ino. Clean up MMU48K.ino

* Added missing #include

* Corrected usage of warning

* CI appeasement and use #message not #pragma message

* Updated git version of eboot.elf to match build version.
Good test catch.

* Remove conditional build option USE_ISR_SAFE_EXC_WRAPPER, always install.

Use the replacement wrapper on non32xfer_exception_handler install.

Added comments to code describing some exception handling issues.

* Updated mmu.rst

* Expanded and clarified comments.

Limited access to some detailed typdefs/prototypes to .cpp
modules, to avoid future build conflicts.

Completed TODO for verifing that the "C" structure struct __exception_frame
matches the ASM version.

Fixed some typo's, code rot, and added some more cases in examaple irammem.ino.
Refactored a little and reordered printing to ease comparison between methods.

Corrected `#ifdef __cplusplus` coverage area. Cleaned up `extern "C" ...` usage.
Fixes issues with including mmu_iram.h or esp8266_undocumented.h in .c files.

* Style fixes and more cleanup

* Style fix

* Remove unnessasary IRAM_ATTR from install_non32xfer_exception_handler

Some comment tuning.

In the context of _xtos_set_exception_handler and the functions it registers,
changed to type int for exception cause type. This is also the type used by gdbstub
and some other Xtensa files I found.
2020-12-06 14:15:42 +01:00
david gauchard
47e7b2db6c
emulation on host: various minor fixes (#7741)
* emulation on host: makefile minor fixes
* fix including debug.cpp, fix ranlib log
2020-12-04 02:36:44 +01:00
david gauchard
594831d605
WiFiClientSecure: use context (#7680)
* move WiFiClientSecure to WiFiClientSecureCtx and add WiFiClientSecure wrapper to handle the context
* explicitely disable context copy constructor (similar to operator=)
* move (static) probeMaxFragmentLength back from ctx to WiFiClientSecure
* route sslclient::status() to context's ::status()
2020-12-03 10:35:24 +01:00
david gauchard
35a5a7026c
emulation on host: fix make clean (#7740) 2020-12-02 22:27:24 +01:00
Martin Berka
5631051378
Update a02-my-esp-crashes.rst (#7739)
Fixes formatting of bulleted list in Stack section, and misc typos/wording.
2020-12-02 10:14:14 +01:00
david gauchard
2c178235c2
emulation on host: makefile rework (#7738)
Rework emualtion on host's Makefile: Avoid to spread object files everywhere by generating them into a single directory
* everything is now in bin/ or bin32/ directories, coverage in lcov/
* optional running exec with valgrind + gdb
2020-12-02 10:01:56 +01:00
Earle F. Philhower, III
8565ac8fbc
Update to pyserial 3.5, esptool 3.0 (#7737)
Recent releases may work better with some newer MacOS releases
according to their commit logs.

Ensure esptool detects the flash size and doesn't use the one hardcoded
in the bootloader.  Thanks to @d-a-v for noticing the esptool change.
2020-12-01 17:41:23 -08:00
Davy Landman
11519dd1a0
Clarified implementation of the signed OTA implementation (#7736)
* Clarified implementation of the signed OTA implementation

* Minor missing word

Co-authored-by: Earle F. Philhower, III <earlephilhower@yahoo.com>
2020-12-01 17:33:13 -08:00
Luca Passarella
7a368747e0
ETag support for WebServer (#7709)
* implemented with native md5
* testing locals variables
* less memory used, partil refactoring
* reworked serveStatic logic, different handler for File and Directory
2020-12-01 09:52:58 +01:00
Earle F. Philhower, III
2e4563c76b
Receiving no data in Updater is an error (#7729)
Fixes #7721 by adding a new error code for when Update::end is called
without any progress at all being made (i.e. no data actually ::write()
to the Update object.
2020-12-01 09:42:36 +01:00
Jannik
cfd9a34c49
Specify where Additional Boards Manager URLs is (#7733)
As a newcomer to Arduino IDE, it is not obvious where the "Additional Boards Manager URLs" field is
2020-12-01 09:29:32 +01:00
Earle F. Philhower, III
0e4c838a00
Update to latest BearSSL as of Nov 2020 (#7732) 2020-11-30 09:11:45 -08:00
Earle F. Philhower, III
92175d7090
Rewrite multipart boundary detection (#7728)
Use a simpler, cleaner implementation of multipart form detection as
defined in https://tools.ietf.org/html/rfc7578 .

Implements a simple state machine that detects the `\r\n--<boundary>`
stream in input a character at a time, instead of buffering and
comparing in chunks which can miss things due to alignment issues and
which also had a problem with replacing characters in a binary stream.

Adjust the private _uploadReadByte function to return -1 on error (like
a read()), and the main file upload handler to use that return value
instead of duplicating logic.

Fixes #7723
2020-11-28 17:22:34 -08:00
Drzony
04b0c270e4
Added GZipped OTA support in elf2bin and PlatformIO (#7727) 2020-11-28 17:09:25 -08:00