The ROM routine __divsi3 is called by code whenever a division is needed,
because there is no divide unit on the ESP8266 core. When the divide
routine in ROM hits a div-by-zero case, it jumpt to an ILL(egal instruction)
at a fixed address which causes a HW exception 0 (IllegalInsnException).
In the postmortem dump, when an ILL exception is detected at this address
in ROM, convert it to a DivByZeroException for printout (6).
Divde by zero errors now print as follows:
````
--------------- CUT HERE FOR EXCEPTION DECODER ---------------
Exception (6):
epc1=0x4000dce5 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000
>>>stack>>>
...
<<<stack<<<
--------------- CUT HERE FOR EXCEPTION DECODER ---------------
````
And will decode as follows:
````
Exception 6: IntegerDivideByZero: QUOS, QUOU, REMS, or REMU divisor operand is zero
PC: 0x4000dce5
EXCVADDR: 0x00000000
Decoding stack results
...
````
Remove get.py percent dump to shorten PIO output 99%.
Use latest release version of PIO, not bleeding edge, to fix
failures introduced in devel (non-release) PIO versions.
Thanks, @mcspr, for noticing this!
This patch fixes some spelling typos in following files
bearssl-client-secure-class.rst
client-class.rst
scan-class.rst
scan-examples.rst
server-examples.rst
* Add SerialEvent() callback to loop processing
Match the AVR SerialEvent implicit callback. Callback is executed
in normal user mode, not IRQ, so standard processing can be uses.
Fixes#752 after 5 years. :)
* Fix style
* Clean up minor warnings from LGTM.com
LGTM (Semmie) is a tool, bought by GitHub last year, that conducts basic
linting tasks on code and HTML.
Clean up the warnings identified in the latest report:
https://lgtm.com/projects/g/esp8266/Arduino/?mode=list
No functionality should change, however this may fix some issues with
the perl utilities not exiting properly on a Ctrl-C from the command
line.
* Back out HTML changes and rerun boards.txt.py
Run valgrind on host mock example runs to catch more bugs in CI. These
tests would have caught the problem in #7464 before users did.
Add a list of some randomly picked examples to run, and add an option to
run the loop exactly once in the host mock routine, so the test will
actually exit under valgrind.
Parameters that are only used in an assert() statement are unused when
the NoAssert-NDEBUG option is used. This causes the following unused
parameter warnings while building:
````
/home/earle/Arduino/hardware/esp8266com/esp8266/cores/esp8266/Crypto.cpp: In function 'String {anonymous}::createBearsslHmac(const br_hash_class*, uint8_t, const String&, const void*, size_t, size_t)':
/home/earle/Arduino/hardware/esp8266com/esp8266/cores/esp8266/Crypto.cpp:101:71: warning: unused parameter 'hashTypeNaturalLength' [-Wunused-parameter]
101 | String createBearsslHmac(const br_hash_class *hashType, const uint8_t hashTypeNaturalLength, const String &message, const void *hashKey, const size_t hashKeyLength, const size_t hmacLength)
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
/home/earle/Arduino/hardware/esp8266com/esp8266/cores/esp8266/Crypto.cpp: In function 'String {anonymous}::createBearsslHmacCT(const br_hash_class*, uint8_t, const String&, const void*, size_t, size_t)':
/home/earle/Arduino/hardware/esp8266com/esp8266/cores/esp8266/Crypto.cpp:153:73: warning: unused parameter 'hashTypeNaturalLength' [-Wunused-parameter]
153 | String createBearsslHmacCT(const br_hash_class *hashType, const uint8_t hashTypeNaturalLength, const String &message, const void *hashKey, const size_t hashKeyLength, const size_t hmacLength)
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
````
Mark them unused in the code to avoid the error. The assert() still
works.
Add mention that OTA Update class will block changes to flash mode bits if the image is uncompressed, and link to the recent discussion on this.
Co-authored-by: Earle F. Philhower, III <earlephilhower@yahoo.com>
Matching standard Arduino cores, make the default analogWrite() take
values from 0...255. Users can always use the analogWriteRange() call
to change to a different setup.
Add a `analogWriteResolution` which takes a number of bits and sets
the range from 0...(1<<bits)-1, part of the standard Arduino API.
Remove the PWMRANGE define. It's non-standard and not generally valid
(i.e. it's fixed at 1024 of 256, but the real range varies depending on
what you last set).
Also add note about the change and how to fix pre 3.0 applications.
Fixes#2895
* webhook api
* simplify webserver debug printouts, move text to flash
* Hook examples in HelloServer example
* print executable code address in example
* simplify example per @mcspr suggestion
In the HTTPS example we were using a fingerprint which changes almost
daily as the github.com certificates are regenerated. Replace this with
a trust anchor based on the ultimate root CA that github.com uses to
sign their certificates. Assuming they don't change CAs, this
certificate should be good until 2030+
Fixes#7489
* CVE-2020-12638 workaround for WPA downgrade attack
When connected to an encrypted (WEP/WPA) router, a rogue packet can
cause the ESP8266 WiFi stack to drop to an unecrypted rogue network of
the same SSID.
Handle this by dropping the WiFi connection immediately and reconnecting
to the stored WPA/WEP network requested by the application, whenever the
AUTHMODE changes to OPEN from a secured mode.
https://lbsfilm.at/blog/wpa2-authenticationmode-downgrade-in-espressif-microprocessors
for more details.
* Initialize _ledPin
_ledPin should be initialized to -1 in the constructor to avoid setting a random pin when calling Updater::end without having called Updater::begin before. This happens, for example, in the Homie software
* Fix field sequence
PR #7464 removed the reset of client authentication settings when server
authentication settings were changed, however it never did initialize
the client authentication information to nullptr in the constructor.
This can result in crashes during connections when client certs are not
applied.
Fix by resetting the client authenticaion variables on object
construction.
* Comment out verify step in eboot.c
Meant for #7458 , but still requires a recompiled eboot.elf.
* Rebuild eboot.elf from changed source
Co-authored-by: Earle F. Philhower, III <earlephilhower@yahoo.com>
WiFiClientSecure.setInsecure() was clearing the secret key (but not the
_chain public client cert) incorrectly. The other server authentication
modes also had the same effect.
The only way for it to work would be if the app first set the server
authentication method and then the client keys. There's no good reason
for this.
Adjust the connection to only clear the server id methods and leave the
client ID untouched.
Fixes#7455
When stacksmash protection was added, the variable used by the compile
lines and the boards.txt.py generator is "build_stacksmash_flags".
Unfortunately, the default variable name in the platform.txt is
"build_stacksmash" w/o the "_flags."
* WebServer: Allow client to send many requests on the same connection
* WebServer: Keep the connection alive with a client by default
* WebServer: Use the request's HTTP version and Connection header to set the default keep alive value
* Fix a typo in a comment
Convert the continuous integration process to use GitHub's internal
CI cloud. Allows us to run up to 20 jobs in parallel, speeding up
CI immensely. Keep a short Travis-CI run, too, just for sanity and backup.
Uses new keys and secret when publishing a release to
esp8266.github.io.
The GCC10 PR accidentally reverted to an older BearSSL commit. There should
be no code changes, but to keep everything clean move it back ahead to the
proper commit.