* Disable WiFi at boot by default
* +define WIFI_IS_OFF_AT_BOOT
* remove now useless example
* mv enableWiFiAtBootTime() to core_esp8266_features.h
* sync with master
* per @earlephilhower review: a file was missing
* doc
* WiFi persistence is now false by default
* fix doc
* ditto
* doc: remove sphinx warnings (fix links and formatting)
* fix link name
* fix doc
* legacy: restore persistence
* undeprecate preinit()
* move force modem up to when mode has changed (per @mcspr review)
* do not wake up from sleep when mode if OFF
* fix doc per review
* Hardware WDT Stack Dump
This Sketch demonstrates the use of a tool to print a stack dump
at reboot after a Hardware WDT event.
The module hwdt_app_entry.cpp writes a stack dump to the serial interface
after a Hardware Watchdog Timer has struck and a new boot cycle has begun.
The sketch must properly initialized the Serial port before the crash.
hwdt_app_entry.cpp is the core file that does the work.
* Corrected Style. Improved HWDT reset detectionat boot.
* Style and typos
* Update comments.
* Improvements to reset reason determination.
Improved comments.
Added option to match the UART speed used by the sketch.
Added option to print greeting at the start to indicate the HWDT stack dump code is active.
Isolated logic for handling strings: one assuming they are not inited at
the time the code is running and one that does. The later appears to be the case.
* Style plus
Fix issue with HWDT reason detection when sketch crashes too fast.
Added sample sketch menu option for crashing with a function defined
with a weak attribute via prototype, but never actually defined in
full function form. eg. `void trouble(void){return;}`
* Moved all configuration options to the top.
Adjusted configuration option order for most likely to be used to the top.
Tried to improve comments.
Replace numbers with enum values.
* Removed clutter of having an alternate printing method.
Regular global strings have worked reliably.
Tweaked reset reason detection.
Reordered elements in global structure.
Improve #if test for debug option
Always improving comments.
* Added delays around uart_div_modify. This appeara to resolve the lost
data problem that occurs when printing after a flash upload using esptool.
Curiously, esptool stub also uses similar delays.
Word choices and description improvements.
* Finished TODO looked at assembly of app_entry_redefinable to confirm
no mixed up stack frame was created. Also removed no longer needed
extra level of function calling.
Use existing macros from uart_register,h to handle getting current
UART speed. Added some missing `const`.
* Comment changes.
Added a few newlines to printing.
Decreased the settling delay after the uart_div_modify call.
* Improved comments.
Print caution message when stack integrity checks failed.
* Several corrections to set_uart_speed
Comment improvements
Added missing ";"
* Removed unused include.
Code cleanup.
Comments.
* Now runs from flash before SDK is started.
Cache_Read_Enable working. Free 1K of IRAM and 200 bytes of DRAM.
* Changed ICACHE size from 32K to 16K to avoid conflict with
SDK or core selecting smaller 16K ICACHE.
The Issue: Cache_Read_Enable does not clear the bit field when mapping IRAM to
ICACHE on register 0x3FF00024. Thus, no problem upgrading from 16K to 32K;
however, you cannot downgrade from 32K to 16K. These bits are cleared at boot.
Improved uart data rate change handling.
Update comments.
* Added support to print ThunkStack.
Adjustments to inline asm. Added "memory" when callx0 is used.
* comment cleanup. added missing additional #if defined()
Made structure name unique. Changed HWDT_INFO to HWDR_INFO_S.
* Update style used for structure and typedef to match that used in core
when snake case is used. Moved a constexpr block up a scope so that
some #ifdef debug code compiles again.
* Updated comments
* Corrected new errors from upgrade to GCC 10.1 toolchain related to
constexpr and casting integers to pointers.
Cleared warning for asm.
* Work around divide by 0 HWDT event under toolchain 10.1.
* Changes to move feature into core.
Making ready for selection via tools menu, updated defines to DEBUG_ESP_,,, format.
Added HWDT and HWDT_NO4KEXTRA options to boards.txt.py. These options are selectable
from Arduino IDE 'Tools->Debug Level'
Converted macro names that use to be constexprs to uppercase.
Update comments. Added comments to maintainers anotated by '//C'
Revised example.
* Fix stack character buffer length.
* Updated comment to reflect support via Arduino IDE Tools menu.
* Improve meshing of HWDT and NOEXTRA4K
* Made compatible with `disable_extra4k_at_link_time()` usage.
Changed to strings containing "no4kextra" to "noextra4k" to be consistant with
original usage.
Updated example to provide indications of which build options were used or resulted.
Some comment cleanup.
* CI style
* Adjusted down the ROM Stack space for the extra 4K Heap option.
If too large, a really bad crashes occurs.
Updated the example to start WiFi. This helps double check ROM
Stack space size is not too small at start.
Removed stale comment.
Changed cont stack check functions to make globally available.
* Add replacement aes_unwrap for the debug HWDT option.
Improves the SYS stack space available when using the extra 4K Heap
option in conjunction with HWDT. Replaces the ROM AES buffer at
0x3FFFEA80 with one provided by malloc().
* Update umm_info_safe_printf_P to support default of unaligned PROGMEM strings.
* Improve cont stack trace for yielding case.
Check if cont stack is yielding to SYS, use g_pcont->sp_yield to limit the
amount of the cont stack dumped.
Generalized dev logic path to create a generalized debug function hwdt_pre_sdk_init_icache.
* Added missed update to heap.cpp for change to use PSTR instead of PSTR4
* Updated comments and #if in aes_unwrap.
* Update boards.txt
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.
* 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
* 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 444002180bca8e36b3014eaf5ecf5e690837b440
* 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
* 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.
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().
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.