1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-12 01:53:07 +03:00
Commit Graph

4031 Commits

Author SHA1 Message Date
57fbd69a93 Merge branch 'master' into master 2021-04-04 15:43:19 -06:00
d013aadb96 Merge pull request #7953 from dok-net/hwserial
Sanitizing HW serial's uart.cpp just a little more.
2021-04-04 17:17:57 -04:00
eb1966b6a9 Merge branch 'master' into hwserial 2021-04-04 17:06:27 -04:00
0593cbdc00 Merge branch 'master' into master 2021-04-04 23:02:43 +02:00
cd7d137774 Per review. 2021-04-04 19:36:38 +02:00
1c57b3408c fix WiFiClient::write(from flash or iram) (#7951)
* fix WiFiClient::write(flash or iram)

* fix emulation on host
2021-04-04 11:31:45 +02:00
2e214843db Minor code cleanup. 2021-03-31 15:33:57 +02:00
5ac64ffa27 Merge pull request #7949 from dok-net/hwserial
HW Serial swap and pin setting work only on a few pins
2021-03-28 19:48:18 -03:00
8430a09aae Adapt MockUART.cpp 2021-03-28 22:31:52 +02:00
2cf76ba784 HW Serial swap and pin setting work only on a few pins, return false on failure. 2021-03-28 22:31:52 +02:00
eedb009c6d Bug-fix release 6.12.1: a documentation error was reported by a user; dropped bit-patterns that masked the stop-bit fixed. (#7938) 2021-03-28 13:23:37 -07:00
c1118dfce3 Stream::Send fixes: doc + StreamConstPtr byte-by-byte + missing SSL availableForWrite (#7935)
* StreamConstPtr: fix doc + reading flash space byte-by-byte
* add missing availableForWrite wrapper in wificlient-ssl
* WiFiClientSecure-ctx: add missing availableForWrite()
2021-03-25 16:00:41 +01:00
0a4fcdf090 Merge pull request #7940 from mcspr/wifi-evt-ssid
Fix WiFi events with 32byte wide SSIDs
2021-03-24 21:52:54 -03:00
3ff573103b Fix WiFi events with 32byte wide SSIDs 2021-03-25 02:38:25 +03:00
fdc295dfae Fix typo in EEPROM debug message (#7934)
Fix #7933
2021-03-22 08:05:33 -07:00
edcbdbea45 Update Root Certificate (#7932)
The root certificate used in the example to connect to api.github.com has expired.
A new certificate was issued on March 3, 2021 and should be valid for a year.
2021-03-21 13:35:11 -07:00
3b1e8eab20 rename ClientContext::wait_until_sent() to wait_until_acked() (#7896)
* rename ClientContext::wait_until_sent() to wait_until_acked()

While looking at #6348 and #6369, and after checking into lwIP sources, it
appears that the tests in ClientContext::wait_until_sent() effectively wait
for all acks on current output buffer. Comments are added.

* host tests counterpart
2021-03-21 14:56:20 +01:00
0894b514cf WString: direct operator overloads instead of StringSumHelper (#7781)
* wip

* huh, turns out String = 'c' did some weird stuff

* style

* allow "blah" + String, 'c' + String and F("...") + String

also, simplify const char* vs. __FlashStringHelper, and just always use _P functions

* shuffle things into .cpp

* trying to fix arduinojson

based on the implementation, we only need to specify that this symbol is a class

* fix accidental realloc, add test for operator+

basic chaining should work just like with master
comparing std::move() buffers won't work though, because we never allow
anything but `const StringSumHelper&` references

* fixup! fix accidental realloc, add test for operator+

* don't need another branch

* template +=(String / char* / numbers) and +(String, numbers / char*)

* nul after moving (isnt mem always zeroed tho?)

* check if lhs cant keep before switching to rhs

* fix String used to store struct data

`cannot bind bit-field '...' to 'signed char&'
`cannot bind bit-field '...' to 'unssigned char&'

noticed in both tasmota and espeasy, where this generates a webpage
content from some status struct containing bitfields

* style once more

* typo

* recover 444002180b
2021-03-21 14:40:25 +01:00
1b922edad1 Added broadcastIP method to WiFiSTA class (#7899) 2021-03-16 08:01:04 -07:00
2406fe8fb8 Adds the method setSSLVersions() also to WiFiClientSecure in order to use that new feature. (#7925)
Co-authored-by: Manuel Domínguez Dorado <manuel.dominguez@enzinatec.com>
2021-03-15 13:21:53 -07:00
7475ba7ff3 Add setSSLVersion call to SSL object (#7920)
* Add setSSLVersion call to SSL object

Allow users to only allow specific TLS versions for connections with an
additional call in their app, similar to the setCiphers call.

Fixes #7918

* Add SSL level options to WiFiServerSecure
2021-03-15 12:22:06 -07:00
dcdd4313cb Clean up ICACHE_RAM_ATTR in VM PR (#7924) 2021-03-15 03:00:39 -07:00
55cee059fe EspSoftwareSerial minor release 6.12.0 completes adaptation to new Stream::send() (#7923) 2021-03-15 02:24:25 -07:00
48e1ccbff8 Added ESP32 compatible methods for setting/getting sleep mode (#7901) 2021-03-14 20:48:54 -07:00
9d82ebe6f7 Add example for using ESP.rebootIntoUartDownloadMode() (#7897) 2021-03-14 20:36:06 -07:00
47b8947e72 ESP8266WebServer: Add variadic template version of collectHeaders() (#7296)
* More user-friendly, less RODATA usage.

eg. `webServer.collectHeaders(F("Content-Type"), F("Origin"));`

In this example, less about 20 bytes than the traditional way.
2021-03-14 19:55:25 -07:00
8ffe41b7df Enable 128K virtual memory via external SPI SRAM (#6994)
Provides a transparently accessible additional block of RAM of 128K to
8MB by using an external SPI SRAM.  This memory is managed using the UMM
memory manager and can be used by the core as if it were internal RAM
(albeit much slower to read or write).

The use case would be for things which are quite large but not
particularly frequently used or compute intensive.  For example, the SSL
buffers of 16K++ are a good fit for this, as are the contents of Strings
(both to avoid main heap fragmentation as well as allowing Strings of
>30KB).

A fully associative LRU cache is used to limit the SPI bus bottleneck,
and background writeback is supported.

Uses a define in boards.txt to enable.  If this value is not defined,
then the entire VM routines should not be linked in to user apps
so there should be no space penalty w/o it.

UMM `malloc` and `new` are modified to support internal and external
heap regions.  By default, everything comes from the standard heap, but
a call to `ESP.setExternalHeap()` before the allocation (followed by a
call to `ESP.resetHeap()` will make the allocation come from external
RAM.  See the `virtualmem.ino` example for use.

If there is no external RAM installed, the `setExternalHeap` call is a
no-op.

The String and BearSSL libraries have been modified to use this external
RAM automatically.

Theory of Operation:

The Xtensa core generates a hardware exception (unrelated to C++
exceptions) when an address that's defined as invalid for load or store.
The XTOS ROM routines capture the machine state and call a standard C
exception handler routine (or the default one which resets the system).

We hook into this exception callback and decode the EXCVADDR (the
address being accessed) and use the exception PC to read out the
faulting instruction. We decode that instruction and simulate it's
behavior (i.e. either loading or storing some data to a
register/external memory) and then return to the calling application.

We use the hardware SPI interface to talk to an external SRAM/PSRAM,
and implement a simple cache to minimize the amount of times we need
to go out over the (slow) SPI bus. The SPI is set up in a DIO mode
which uses no more pins than normal SPI, but provides for ~2X faster
transfers.  SIO mode is also supported.

NOTE: This works fine for processor accesses, but cannot be used by
any of the peripherals' DMA. For that, we'd need a real MMU.

Hardware Configuration (only use 3.3V compatible SRAMs!):

  SPI byte-addressible SRAM/PSRAM: 23LC1024 or smaller
    CS   -> GPIO15
    SCK  -> GPIO14
    MOSI -> GPIO13
    MISO -> GPIO12
 (note these are GPIO numbers, not the Arduino Dxx pin names.  Refer
  to your ESP8266 board schematic for the mapping of GPIO to pin.)

Higher density PSRAM (ESP-PSRAM64H/etc.) should work as well, but
I'm still waiting on my chips so haven't done any testing.  Biggest
concern is their command set and functionality in DIO mode.  If DIO
mode isn't supported, then a fallback to SIO is possible.

This PR originated with code from @pvvx's esp8266web server at
https://github.com/pvvx/esp8266web (licensed in the public domain)
but doesn't resemble it much any more.  Thanks, @pvvx!

Keep a list of the last 8 lines in RAM (~.5KB of RAM) and use that to
speed up things like memcpys and other operations where the source and
destination addresses are inside VM RAM.

A custom set of SPI routines is used in the VM system for speed and code
size (and because the core cannot be dependent on a library).

Because UMM manages RAM in 8 byte chunks, attempting to manage the
entire 1M available space on a 1M PSRAM causes the block IDs to
overflow, crashing things at some point.  Limit the UMM allocation to
only 256K in this case.  The remaining space can manually be assigned to
buffers/etc. managed by the application, not malloc()/free().
2021-03-14 18:44:02 -07:00
c720c0d9e8 Stream::send() (#6979) 2021-03-14 17:36:20 -07:00
4cc1472821 [BREAKING] base64::encode() compat with esp32: no newlines by default (#7910) 2021-03-14 17:24:33 -07:00
656a33e6f8 BREAKING - Use IRAM_ATTR in place of ICACHE_RAM_ATTR (#7921)
Update the core to use the define that the ESP32 uses, IRAM_ATTR, for
placing code in DRAM.
2021-03-14 16:56:47 -07:00
6743a65987 Minor EspSoftwareSerial release 6.11.7, for deprecated ICACHE_RAM_ATTR in upcoming ESP8266 Arduino core 3.0.0. (#7922) 2021-03-14 16:15:37 -07:00
49a09279eb Merge pull request #6280 from aerlon/wifi_mesh_update_2.2
WiFi Mesh Update 2.2
2021-03-14 18:11:32 -03:00
7fbf620ab6 Merge branch 'master' into wifi_mesh_update_2.2 2021-03-14 16:41:13 -03:00
444002180b OOM debug: warn about String reallocation (#7908)
* OOM debug: warn about String reallocation

* threshold set to 128 bytes, +defines

* warn only when capacity had already reached the threshold
2021-03-14 07:57:23 +01:00
e07542d701 Fix link to ESP8266 NonOS SDK (#7914) 2021-03-11 07:24:24 -08:00
e99df4fe1a Add I2S class support (#7874)
Fixes #427

Adds a basic I2S class based off of the Arduino-SAMD core.  The raw
i2s_xxx functions are still a better  way to use I2S due to their
flexibility, but this will allow basic Arduino sketches to work.
2021-03-07 08:14:07 -08:00
9fc5afd5fd OOM: avoid warn when calling *alloc(0) (#7909) 2021-03-04 13:27:42 -08:00
d3d49d5db4 Update mklittlefs executable (#7906)
Rebuild entire toolchain instead of manually hacking the tools JSON to
ensure repeatability.

New mklittlefs sets the new FS timestamp added in #7873
2021-03-04 11:29:38 +01:00
c90c329a48 Track creation time of LittleFS FS (#7873) 2021-03-02 17:50:00 -08:00
22442f0873 Added ESP32 compatible methods for setting/getting hostname (#7900) 2021-03-02 17:32:34 -08:00
807ed51d0f AP & dhcp-server: fix uninitialized variables (#7905) 2021-03-03 01:12:01 +01:00
e3fe7a5776 EspSoftwareSerial, bump up Arduino library manager related files 6.11.6 (#7891) 2021-02-21 11:04:37 -08:00
f42ab617e9 Update to EspSoftwareSerial 6.11.5 (#7889) 2021-02-21 09:23:20 -08:00
a5308d6ef4 String: add missing long long operator implementations (#7888) 2021-02-19 08:38:43 -08:00
d41b4037cc board manager: + Agrumino lemon v4 (#7883) 2021-02-19 08:21:16 -08:00
83f5f29cfd Support to reboot into UART download mode (#7854)
without any external wiring.

This patch introduces the new method
Esp.rebootIntoUartDownloadMode()

When the user calls this method the ESP8266 reboots into the UART
download mode. In this mode the user can use esptool.py to flash a new
firmware file. The following command was used to test it:
$ esptool.py --before no_reset --after soft_reset --chip esp8266 \
    --port /dev/ttyUSB0 --baud 460800 write_flash 0x0 firmware.bin

The implementation is based on the original implementation in the
boot ROM. Some parts of the original implementation can be found in
[1]. This patch is a squashed and simplified version of [2]. The non
squashed version might be helpful in case of debugging issues.

[1] https://github.com/twischer/xtensa-subjects/blob/master/reversed/bootrom.c
[2] https://github.com/twischer/Arduino/tree/reboot_uart_download_full

Signed-off-by: Timo Wischer <twischer@freenet.de>
2021-02-17 08:25:52 -08:00
bc3daef76d WIFI_RESUME improve speed and example (#7877)
Improve resume speed by passing in last known BSSID
Provide a simpler example for WIFI_SHUTDOWN/WIFI_RESUME
Add documentation for WIFI_SHUTDOWN and WIFI_RESUME.
2021-02-15 13:51:37 -08:00
e4435fa306 Update board-specific defines (#7875)
Fixes #6805

Update the build.board for several boards which were originally added
with a generic type.
2021-02-14 14:42:50 +01:00
483519f852 String: compatibility with 64 bits scalars (#7863)
time_t is now 64 bits. String(time_t) was ambiguous
tests added
2021-02-13 08:47:47 -08:00
a886515ce9 Fix ESP8266SdFat architecture, Windows CI (#7866)
* Fix ESP8266SdFat architecture

Avoid problems reported in
https://forum.arduino.cc/index.php?topic=726897.msg4889319

* Fix Windows CI, python3 now *maybe* exists

Python3 used to be called "python.exe" on earlier VMs, but it looks like
the image has been updated and a "python3.exe" does now exist.  Update
the CI script to first check it "python3" exists, and if not then do the
copy hack, OTW do nothing.
2021-02-08 12:02:49 -08:00