1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-25 20:02:37 +03:00

4376 Commits

Author SHA1 Message Date
david gauchard
b7f7b7488a
fix delay(0) (#8960) 2023-07-19 00:25:31 +02:00
Max Prokhorov
10cd3a1eae
Document git version install, upkeep and PR management (#8902) 2023-07-19 00:12:35 +02:00
M Hightower
dcceee8cbd
Fixes occasional UMM_POISON failure (#8953)
* Fixes occasional UMM_POISON failure

Bug introduced with PR fix #8914.
When a reallocated pointer could not grow in place, a replacement
allocation was created. Then UMM_POISON was written to the wrong block.

* Fix umm_poison data corruption on realloc when memory move is used.

Bug introduced with PR fix #8914

* refactored to resolve unused error in some build contexts
2023-07-18 23:34:42 +02:00
M Hightower
521ae60a89
Fix for dangerous relocation: j: cannot encode (#8925)
Fixes to recent changes to Postmortem to cover large jump offsets, use relaxed jump (J.L) in __wrap_system_restart_local.
Also add check that epc1 is a valid code address before reading.
2023-06-16 18:39:29 +03:00
supersjellie
8b33e2e250
Fix for occasional WebServer timeout issues (#8944)
Fixes #8941
2023-06-14 08:22:27 -07:00
Suwatchai K
e05656bd78
Add support WiFiClientSecure TCP KeepAlive (#8940)
* Add support WiFiClientSecure TCP KeepAlive
* Make TCP keepalive and related functions virtual.
* Make TCP keepalive and related functions override.

Fixes #8939
2023-06-11 11:11:38 -07:00
M Hightower
57fa6cdc92
Soft WDT: detect deliberate infinite loop at Postmortem (#8918)
A popular method of handling an unrecoverable state is to reboot. The SDK does this in many places by printing a cryptic debug message followed by something equivalent to while(true){}, which compiles down to loop: j loop, creating a Soft WDT reset.
2023-05-01 02:05:32 +03:00
M Hightower
c517bfd997
umm_poison false positive from ISR (#8914)
The umm_poison logic runs outside the UMM_CRITICAL_* umbrella. When interrupt routines do alloc calls, it is possible to interrupt an in-progress allocation just before the poison is set, with a new alloc request resulting in a false "poison check fail" against the in-progress allocation. The SDK does mallocs from ISRs.

SmartConfig can illustrate this issue, see
https://github.com/esp8266/Arduino/issues/3494#issue-247919259

Other Sketches built with Debug: "Serial," that use the SDK's Promiscuous callbacks are also likely to encounter problems.
The SDK support for "Promiscuous Receive" allocates memory from an ISR context, occasionally interrupting the poison wrapper code before it finishes setting the poison fences resulting in a false poison failed event.
2023-04-28 15:57:50 +03:00
ilmanowar
ad9aaef8c8
Fix removing first certificate in certs-from-mozilla.py (#8907)
.pem list has no headers, that operation removes a real certificate.
2023-04-22 17:33:27 +03:00
Dirk O. Kaar
c3f36316bf
EspSoftwareSerial 8.0.2: possibly uninitialized inverted mode flag fix (#8911) 2023-04-22 16:57:12 +03:00
Takayuki 'January June' Suwa
65579d2908
Make precache() cleaner and more efficient (#8903)
No need to issue a MEMW instrunction per load from each cache line.
Only once after the last load is sufficient.

  MEMW ensures that all previous load, store, acquire, release, prefetch,
  and cache instructions perform before performing any subsequent load,
  store, acquire, release, prefetch, or cache instructions.

    -- MEMW (Memory Wait), 6. Instruction Descriptions,
                                      Xtensa ISA Reference Manual (p.409)
2023-04-06 01:26:34 +03:00
M Hightower
a76ef290ea
Support user_rf_pre_init() for SDK v3.0 (#8888)
* For SDK v3.0+, early system calls that were called from user_rf_pre_init
(SDK v2.2) need to now be called from user_pre_init.

Moved user_rf_pre_init() call to the end of user_pre_init() so we
can still perform early calls like: system_phy_set_rfoption(rf_mode),
system_phy_set_powerup_option(2), etc.

* Update comment

* Improve "spoof_init_data" enable/disable logic.
Out of an overabundance of caution, limit logic change to the
experimental SDK v3.0.5.
2023-03-30 19:54:28 +02:00
david gauchard
97018a5bbf
various minor web fixes (#8885)
* httpclient: use refs - httpserver: add chunks in examples

* basic https client: update cert

* debug log: read() returning -1 is usual and means "nothing to read"

* emulation on host: SSL server has never been and is now working

* style

* move SSL server certs from examples into a single place with appropriate warnings

* web-hello-servers: make chunks bigger

* factorize template declaration

* http-client: add getString(pre-reservation)

* mock: add umm_info()

* style

* comment API in example

* style

* fix per review
2023-03-30 19:39:35 +02:00
M Hightower
d3c102e717
Update documentation and arduino debug options (#8837)
* Update documentation

Describe how to improve Exception Decoder results.

Updated build option details.

* Added d-a-v's code. And updated description and debug macro.

* Update doc

Updated platform.txt - positioned -Os such that it can be overridden by `build.opt`.

Add suggestion of using `-Og` which may improve the Decoder's line number correlation
with the problem in the source code.

Untested adjustments to platformio-build.py

* Fixed code formatting

* Fixed example

Previously `-O3` in the example had no effect. It was overridden by later flags.
Reording the `-Os` allowed changing optimization to  work. Somehow this triggered
a new warning "Stream.h:50:7: warning: 'f.Stream::_startMillis' may be used
uninitialized in this function". Replaced `-O3` with `-Og`.

* Proposed "Debug port" menu change
Preserves a pathway for `build.opt` override.

* Update boards.txt.py and docs - WIP

* Improve organization of optimization content.
Use "Debug Optimization" for menu name.
The menu item defines the initial optimization.
platform.txt - optimization parameter can be overridden by build.opt.

* Add fallback value for build.debug_optim to platform.txt

* update text and undo changes to platformio-build.py

* tweak text

* Added ':orphan:' mark to a06-global-build-options.rst

* Update doc. Added link in page index to 'Improving Exception Decoder Results'

* Update text to reference PR#8868 improvements for leaf function.
2023-03-29 11:16:33 +02:00
Earle F. Philhower, III
ce9e72014b
Update compiler toolchain to 3.2.0 (#8868)
* Update compiler toolchain to 3.2.0

Includes compiler updates from @jjsuwa-sys3175

* Manually update python3-via-env tools
2023-03-29 10:55:09 +02:00
david gauchard
a5d31a7187
deprecate and update Stream::send*(Print -> Stream) (#8874)
* deprecate and update Stream::send(Print -> Stream) in order to benefit from and use output's timeout value
2023-03-28 11:21:05 +02:00
david gauchard
01d1c8e46f
3.1.2 is released (#8894) 2023-03-20 23:49:21 +01:00
david gauchard
210897ef83
Release 3.1.2 (#8893)
* release 3.1.2
3.1.2
2023-03-20 23:14:05 +01:00
Max Prokhorov
734defb87d
mkbuildoptglobals.py: assert python version (#8886)
Fix unused var causing warnings
Assert minimal supported version of python3
Python 3.7 in documentation
2023-03-17 11:10:14 +03:00
M Hightower
84a59aa97f
Add reporting address interrupted by Soft WDT (#8851) 2023-03-11 18:22:10 +03:00
Dirk O. Kaar
23036328a5
EspSoftwareSerial 8.0.1: onReceive bug fix and new namespace (#8869)
* Upcoming EspSoftwareSerial 7.0.1

* EspSoftwareSerial example: higher bitrates due to forcing half-duplex

* Adapt to SoftwareSerial's latest use of namespace.

* In EspSoftwareSerial, some renaming after review feedback.

* EspSoftwareSerial's use of a template class in order to permit users their own GPIO capabilities definitions.

* CI caught some warning.

* Stick to non-namespace EspSoftwareSerial class name for the moment.

* Delegate operator() is now nullptr-safe, good for use in ISRs.

* Pushed EspSoftwareSerial 8.0.1: Platformio picks up versions that aren't published in Github
2023-03-11 18:02:04 +03:00
Lars Kellogg-Stedman
6ad9bf3b07
Expand the esp8266 hardware debugging limitations section (#8879)
It's trivial to run into a problem caused by the single hardware breakpoint
limitation, but the existing documentation doesn't explicitly address this
situation (and search results for the error message aren't particularly
helpful).

This commit updates the documentation with an explicit example of what
happens when a breakpoint expression matches multiple locations, along with
a possible workaround.
2023-03-11 12:44:50 +01:00
Bogg
503502f13b
Weak assignment in flash_hal (#8884)
The assignment done in FLASH_MAP_SETUP_CONFIG_ATTR did not apply the attribute to __flashdesc,
and made it impossible to override it with FLASH_MAP_SETUP_CONFIG.
2023-03-11 11:43:03 +01:00
david gauchard
32323e55b5
fix library name in library.properties (#8880) 2023-03-06 16:03:45 +01:00
david gauchard
74e02d1a6f
basichttpsclient example: fingerprint handled by update scripts (#8311)
* basichttpsclient example: fingerprint handled by update scripts
2023-03-06 15:05:36 +01:00
M Hightower
be02af0504
Remove stale patch for SDK v1.1 and earlier (#8858)
rts_reg address referenced was not valid for SDK v2.0.0 and up.
rts_reg[30] = 0; cleared storaged used to set TestStaFreqCalValInput.
2023-02-23 01:02:55 +03:00
M Hightower
71a51b1113
Resolve Windows path problems (#8860)
Moved up os.makedirs for ./core/ directory.
Strange problem creating files with file paths with spaces.
Strange that "create file" would work when the path did not contain spaces and the last folder of the path hadn't been created.

Added try/except on main to commit print buffer on traceback for context.

Additional issues with diacritics and locale character encoding for shell vs source code.
build.opt is written with the same encoding as the shell; however, the data read from the Sketch.ino.global.h is UTF-8.

Tested on Windows 10 (en-US) with Arduino IDE 2.0.3 Under an
account with a diacritic character in the user ID path.

Needs testing on Japanese Windows
2023-02-22 20:46:25 +03:00
david gauchard
d7cd4bef6c
make http-server less verbose in debug mode (#8850)
* make http-server less verbose in debug mode
2023-02-05 18:17:28 +01:00
david gauchard
9a3d55c781
Fix String build warning with DEBUG_ESP_PORT but without DEBUG_ESP_CORE (#8849) 2023-02-05 15:35:56 +03:00
Max Prokhorov
badb407bbb
Update SdFat fork (#8844)
SdFat 2.0.2+ doesn't call yield(), make sure we don't trigger SWDT

fix #8822
2023-02-02 18:21:11 -08:00
M Hightower
326be35c88
Postmortem improvements (#8839)
* divide by 0 reporting to point back at the divide function caller
* stack offset adjustments to be independent of __wrap_system_restart_local()'s stack frame size.
2023-02-01 18:57:32 +03:00
GrzegorzWo
1beca6f4da
Fix LowPowerDemo.ino (#8841)
CRC checking of data read from RTC was always true
2023-02-01 18:31:20 +03:00
Max Prokhorov
6dfebec8c5
SdFat -> FS HAL mode fixes & test (#8833)
* re-use SdFat access mode through static const, no need to hard-code our own value w/ cast in the macro
* separate read-modes from flags; read, write and rw are distinct numbers
* simple compile-time tests in .cpp

resolve #8831
2023-01-31 22:28:37 +03:00
david gauchard
d7da591ed8
Revert ESPSoftwareSerial from v7 to v6
7.0.0 includes a breaking change to onReceive callback
https://github.com/plerup/espsoftwareserial/releases/tag/7.0.0
2023-01-30 18:23:57 +03:00
Max Prokhorov
e25f9e9578
Safeguard for Ticker internal storage that may be changed during callback execution (#8820)
Temporarily move callback into the function scope and execute it from there.
Detaching would no longer destroy it, and re-scheduling would no longer be almost immediately cancelled by our code.
2023-01-26 15:50:14 +03:00
david gauchard
9c4a1239da
String: informative messages on issues (#8821)
Always enable messages when serial debug port is enabled
Allocation issue was not reported
2023-01-26 14:45:09 +03:00
Max Prokhorov
79dde219c5
Don't use -g++ or -gcc suffixes in command line arguments (#8829)
It may confuse some greedy parsers matching compiler either with a glob
or by iterating each argument and not stopping on the first one

ref. this library used by VSCode Arduino extension
ce12578557/src/ParserGcc.ts (L63-L68)

fix #8809
2023-01-26 14:20:17 +03:00
david gauchard
a9675ca837
emulation on host: fix UDP seek&peek (#8827) 2023-01-24 13:44:50 +01:00
M Hightower
cf24024292
New handling of missing perferences.txt in mkbuildoptglobals (#8814)
* Only rely on `perferences.txt ` when requested
* Always assume shared `core.a` caching is in use
* Ignore the passed-in IDE version. Too often, the value is not correct
2023-01-22 11:19:38 +03:00
koliwbr
bed2fa339d
HTTPClient example: Fix typo (#8819)
fix from [HTTP} to [HTTP]
2023-01-20 15:47:42 +01:00
Max Prokhorov
56107fb1f9
Properly handle u8 pointers when assigning and comparing (#8818)
* simplify ctors and operator=, use a common code paths instead of special handling here and there
* fix u8->u32 casts, copy before using u8 data
* do not use raw_address() internally
2023-01-20 12:26:12 +03:00
M Hightower
41c2be2068
Fix mkbuildoptglobals script not finding preferences.txt (#8812)
Also fixes os.utime usage on windows, as it does not accept file descriptors instead of file paths
2023-01-19 00:34:14 +03:00
Edan Schwartz
39b41379ee
Log all exceptions in upload.py (#8813)
Currently some exceptions cause a exit code 2, but without any relevant error message.

As an example, I had an issue with my USB drivers. But the only message I saw using the Arduino IDE was: uploading error: exit status 2. With this code change I could see a more specific Resource busy error message, which helped me identify the actual problem.
2023-01-18 05:16:48 +03:00
Max Prokhorov
6af463baaf
Back to 3.2.0-dev (#8807) 2023-01-15 02:47:00 +03:00
Max Prokhorov
0e5d358c3c
Version 3.1.1 (#8806) 3.1.1 2023-01-15 02:01:02 +03:00
Max Prokhorov
6033ed35d5
Use subprocess.run in elf2bin (#8799)
Properly handle Popen object, it takes care of everything we need to do like .communicate() and handle timeouts. Introduce a small timeout to run so we also know when that happens
Clean-up with pythonic path join and formatting through f"" strings
2023-01-15 00:59:33 +03:00
david gauchard
39080e317e
delay / esp_delay: transparently manage recurrent scheduled functions (#8802)
Recurrent scheduled functions will always be running in background.

esp_delay()'s interval (intvl_ms) is internally kept to its highest value allowing to honor recurrent scheduled functions requirements.

It transparently allows to keep with the arduino and nonos-sdk trivial programming way and still use background services or drivers running regularly.
2023-01-14 22:25:57 +01:00
Max Prokhorov
e1c4a6c8e6
Portable python fix for mkbuildopts (#8804)
see #8226
mentioned in #8803
2023-01-14 21:22:28 +03:00
Max Prokhorov
840ef78237
Fix C builds (#8795)
Missing stdbool.h for 'bool' in features .h, at least one user is arduinoWebSockets
Adds minimal headers sanity-check script to verify that C builds work as expected

Also noticed and removed default argument from crc32() in internal .h that may be used in .c
(not sure how extern C & default worked simultaniously, but at least in our .cpp Gcc somehow figured out it is a no overload solution)
2023-01-11 03:48:30 +03:00
M Hightower
7e2da8b25b
Typo in EAP patch (#8797)
NONOSDK22x_191124 -> NONOSDK22x_191024
2023-01-09 21:36:26 +03:00