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

509 Commits

Author SHA1 Message Date
M Hightower
fe451a814f
Fix typo in section list (#8726)
For GCC LD scripts, using commas in a section expression
sometimes cause problems.
2022-11-23 12:33:56 -08:00
rotulet
78444a5037
Add Wemos ESP-WROOM-02 board (#8664)
* add fixes from https://github.com/esp8266/Arduino/issues/6551#issuecomment-534737671
* add flashfreq_26 to the macro list
2022-11-01 01:38:35 +03:00
Max Prokhorov
0aab6ecee2
Rework CI workflows (#8688)
- split workflows into separate files to trigger by path
  this should help out documentation and boards / eboot / pkg files
  updates, since those *wont* trigger usual build stuff anymore
- build*.sh whatever merged into just common.sh and build.sh
  trigger different parity builds, mod % rem and allow to set .ino list
  through the environment variable
- removes unnecessary temporary files, try to use more pipes
  move remaining ones into cache dir instead of PWD
- remove legacy TRAVIS env vars, use ESP8266_ARDUINO prefix for config
- remove Windows path workarounds
- hardware/ and ide/ directories are set through envionment
  do not force specific paths, simplify builds on local machine
- sketch list is set through environment. expicit paths for Windows and
  macOS builders. platformio also gets a real shuffled list instead of
  mod and rem magic numbers
- detect root of the repo through git cli, not base{name,dir} or relative paths
2022-10-31 11:13:40 -07:00
david gauchard
2360d1cff1
Consistent netif->status_callback (#8676)
https://github.com/d-a-v/esp82xx-nonos-linklayer/pull/62
2022-10-31 07:33:16 +03:00
Max Prokhorov
a0c7a85649
Fix Updater non-zero _verify->length() once again (#8545)
Amends #8507
I took the liberty to also do some refactoring; specifically, fixing signed vs. unsigned mismatch in len, using pointer object vs. the original manual malloc & free, try to have named constants for certain addresses and lengths, plus localize printing of u8 arrays.

The suggested test to have a 'dummy' verifier works just fine. (...how it actually works and gets the hash to compare with is a whole other question, though)

Another issue noticed while testing, in the underlying bearssl api there's an actual limit for hash length.
6105635531/inc/bearssl_rsa.h (L257)
2022-09-13 15:57:42 +03:00
M Hightower
313b3c07ec
Add debug support for build.opt (#8637)
Add support to have different build option comment blocks
for debug and production builds.

Updated example esp8266/HwdtStackDump to use build.opt
2022-08-04 21:33:24 +03:00
Max Prokhorov
06f34ed566
Board ID as build flag (#8634)
* Board ID as build flag

When using IDE or `arduino-cli board list`, show full board name and FQBN
```
$ arduino-cli.exe board list
Port          Protocol Type              Board Name                FQBN                       Core
xxx.xxx.x.xxx network  Network Port      LOLIN(WEMOS) D1 R2 & mini esp8266com:esp8266:d1_mini esp8266com:esp8266
```
Also add `description` field to the mDNS response containing the
original `{build.board}` string value.

resolve #7759

* does not work with recent ide (?)

* fixup! does not work with recent ide (?)
2022-07-27 22:52:20 +02:00
Earle F. Philhower, III
8048ea52ca
Rebuilt HAL w/latest toolchain and fixed configure (#8615)
Returns the library contents to the expected functions.
2022-06-24 15:24:56 +02:00
Earle F. Philhower, III
dc6b15e38a
Update to toolchain 3.1.0-gcc10.3 (#8613)
* Update to toolchain 3.1.0-gcc10.3

* Update BearSSL with L32R minimized

See https://github.com/earlephilhower/esp-quick-toolchain/issues/36#issuecomment-1162363757
2022-06-22 07:52:15 +02:00
Max Prokhorov
047f14b9db
upload.py should not always fail (#8608)
07789808b9 (r76344981)
thx @jjsuwa-sys3175
2022-06-19 01:22:33 +03:00
Max Prokhorov
07789808b9
Do not show python traceback when esptool fails (#8603)
Path separator already handled by python
Empty strings are false, implicitly checking for length
2022-06-15 02:39:16 +03:00
david gauchard
8bfc2e9eab
Fix lwip2 ping (#8596)
fixes https://github.com/esp8266/Arduino/issues/8555
related to https://github.com/dancol90/ESP8266Ping/pull/42
2022-06-14 20:24:04 +03:00
Earle F. Philhower, III
760a6bc6c7
Update to latest BearSSL (#8600)
Minor SSL bug fix included.
2022-06-14 09:49:22 -07:00
Max Prokhorov
b7c1cfbc45
DHCP custom option (#8582)
* works

* fixup! works

* back to callbacks

* names

* daisy chain

* seconds

* less inline

* fix dns setter

* might as well keep using initlist

/to d-a-v it has automatic storage, here it's the same stack based one
(just one less line for us)

* shift blame

* naming

* fix impl

* revert to ip4 dns

* merge fix

* restyle

* masking done wrong
2022-06-08 23:19:59 +02:00
M Hightower
9e2103f27e
Patch eap.o memory leak (#8566)
* Patch eap.o memory leak

WiFi Enterprise option can leak up to 3 allocations per connect/disconnect
cycle: anonymous Identity, password, and some unidentified allocation.

This solution patches eap.o from libwpa2 to call a special 2 part
wrapper instead of vPortFree for cleanup.

Corrected typos and adjusted tabs in script.

Added script eval_fix_sdks.sh to aid in evaluating similarity between
patch sections of .o files being patched across different SDKs.

* Add some dev debug code and improve comments

* Patch eap.o memory leak

WiFi Enterprise option can leak up to 3 allocations per connect/disconnect
cycle: anonymous Identity, password, and some unidentified allocation.

This solution patches eap.o from libwpa2 to call a special 2 part
wrapper instead of vPortFree for cleanup.

Corrected typos and adjusted tabs in script.

Added script eval_fix_sdks.sh to aid in evaluating similarity between
patch sections of .o files being patched across different SDKs.

* Add some dev debug code and improve comments
2022-06-02 23:48:28 +02:00
Flole998
f5ef02d643
Fix double-free when connecting to WPA2-Enterprise networks (#8529)
* Fix double-free when connecting to WPA2-Enterprise networks

Fixes: #8082

This patches the callx0 instruction to a nop in eap.o which is part of libwpa2.a.
It looks like espressif fixed the Bug in newer SDK versions, so if we update to the latest NONOS-SDK it is most likely not necessary to add/adapt this patch.
Also modifies the fix_sdk_libs.sh script as it even changed files if no changes were necessary, for example adding multiple system_func1 exports.

* Apply suggestions from code review
2022-06-02 11:38:28 +02:00
Max Prokhorov
502d9469fa
Initialize SoftAP DhcpServer object on demand (#8546)
* Initialize SoftAP DhcpServer object on demand

Remove dependency on global ctor, and just construct the object when
someone asks us to do it. Only dependency right now is netif_git, which
is expected to be initialized by the lwip code some time before
dhcps_start happens.

Removing ip_info from begin(), since we never reference later on.
Also removing the specific check for netif id and simplify the ctors.

Update tests and recover old nonos-sdk dhcps functions that were not implemented.

* nonos helpers have a separate header

* wifi ap needs this anyway, simplify sketch includes

* missing example

* existing name :/

* trying to fix header dependency

* restyle

* not a c header

* no need to init

* move dhcp server getter to WiFi

more... arduino'ish? we ahve object as namespace, plus everything else
related to softAP is there
redundant includes, redundant mock impl (out-of-scope here to fix)

* ...move things back, still expose as WiFi method

* review fix

* include -nonos header in wifi lib though

* no more lwip include

* style

* need mock dhcpserver instance
2022-06-01 22:46:04 +02:00
Maximilian Gerhardt
c1144c5740
Move _GNU_SOURCE from CCFLAGS to CPPDEFINES (#8579)
Makes _GNU_SOURCE visible in VSCode Intellisense and other IDEs.

Co-authored-by: Ivan Kravets <me@ikravets.com>
2022-05-28 21:17:33 +03:00
Ivan Kravets
35c2ae1cbb
Improve support for hand-written asm source files (#8583) 2022-05-28 20:56:13 +03:00
Takayuki 'January June' Suwa
48b60f4651
tools/sizes.py: Restore to the prior behavior regarding output destination (#8572)
once `tools/sizes.py` outputted to `stderr` rather `stdout` before da4a19fdacd7a859da395e014c9e0fded99aa985

(Arduino IDE 1.8.19 for Windows doesn't capture `stdout`, 2.0.0-rc6 does)
2022-05-17 17:24:36 +03:00
Takayuki 'January June' Suwa
fd9af97e00
tools/sizes.py: Change Unicode box-drawing chars to that of double version (#8573)
Due to historical circumstances, some of light/heavy version of Unicode
box-drawing chars may have twice width of others (aka. "Zen-Kaku" in Japanese,
means full-square), eg. All of '─'(U+2500), '│'(U+2502), '└'(U+2514) and
'├'(U+251C) correspond to that in Windows Japanese fonts and locale.

Double versions, '═'(U+2550), '║'(U+2551), '╚'(U+255A) and '╠'(U+2560) are
not like that.

(See [Box Drawing, The Unicode Standard](https://www.unicode.org/charts/PDF/U2500.pdf))
2022-05-17 16:48:30 +03:00
M Hightower
5311c0d20a
Fix utf-8 encoding (#8565)
* Fix utf-8 encoding

Issue posted to commit
d1d4212e8b (r73517358)

* Added python source code encoding

* for touch operations open/create file in binary mode
2022-05-15 22:19:39 +02:00
david gauchard
80c0570620
Define lwIP's s32/u32 to int (#8560)
* Define lwIP's s32/u32 to int

s32/u32 were previously defined as long,
but long can be 64 bits in host mode,
so this commit reduces valgrind complaints and increase coherency.

* some lads like to use `unsigned long` for 32 bits IPv4 addresses

* fix lwIP's `sys_now()` return type

* fix C declarations

* merge upstream (lwip2) update on sys_now() definition

* matching lwIP api (2/2)

Co-authored-by: Max Prokhorov <prokhorov.max@outlook.com>
2022-05-15 21:55:56 +02:00
M Hightower
d1d4212e8b
Add support for global build defines and options (#8504)
* Add support to specify global build defines and options

A script manages the use of a file with a unique name, like
`SketchName.ino.globals.h`, in the Sketch source directory to provide compiler
command-line options (build options) and sketch global defines. The build
option data is encapsulated in a unique "C" comment block and extracted into
the build tree during prebuild.

* Applied os.path.normpath() liberally to input arguments. Fixes windows file path issue.
Improved helpful message for adding embedded build options.

* doubleup '\'

* Added context help for build option support

* expunged sketchbook global
added workaround for aggressive caching

* inital pass at searching for and reading preferences.txt

* Correct Windows path for preferences.txt
Added portable path for preferences.txt
Expanded file timestamp granularity
Improved error message printing for Arduino IDE 2.0 RC4

* Improved portable path and various Windows paths to preferences.txt

* Add cleanup logic and identify 1st run after IDE restart

* text corrections

* Create mkbuildoptglobals.py

When global header file does not exist, this print makes it easier for user to create the header file by providing its name and documentation pointer.

* build.opt heads up to user

Compiler command line changes from build.opt are shown to user

* Updated text

* oops

* Expanded comment and made print help consistent

* Improve handling stderr/stdout with "no verbose output"
Grouped helpful info to print at the end.
Added missing return value.

* Correct timestamp on CommonHFile.h
More improvements to printing
Updated docs.

* Added command-line parser

Support hints for compiler.cache_core. For use when Arduino IDE uses
command-line options that override compiler.cache_core.

Removed overuse of ()

Improve FAQ entry

* Fix script failure under windows

Rely on argpaser for checking that all arguments are present.
Removed redundant argument check in main().

Added '--debug' option and print_dbg method.

Rethink failures on overrides. Remove well know path fallbacks,
error exit when override file is missing.

In well-known path search for preferences.txt, do not assume true.
Make failure to find an error exit event.

When Windows has two preferences.txt files and they have different
values for caching and globals.h is used, error exit. It is not
possible to know from the script which is being used.

* Use quotes on build.opt

Update comment
Include the @ within the expantion string use quotes around file name.
Update doc example to remind and use quotes.

* Update CI for build option and global support

Added "mkbuildoptglobals.extra_flags=--cache_core" to platform.loca.txt
Update "-ide-version=10802" this version number indicates aggressive caching support
Added example to test global .h support

* Add debug prints
Added --debug to CI - this needs to be removed later
Tweaks to touch...

* Give each build VM a unique build.tmp space

* Corrected style on example
temp CI changes
debug crud
Added --ci switch

* Removed CI debug crud

run_CI_locall.sh works fine locally. Hosted Multi-VM CI fails
to work with 'aggressive caching' workaround method.

Add #if defined(CORE_MOCK) to failing example.

* Try HOST_MOCK

* CI adjustments

mkbuildoptglobals.py is optimized around the Arduino IDE 1.x
behaviour. One way the CI differs from the Arduino IDE is in the
handling of core and caching core. With the Arduino IDE, each sketch
has a private copy of core and contributes to a core cache. With the
CI, there is one shared copy of core for all sketches. When global
options are used, the shared copy of core and cache are removed before
and after the build.

* Doc update
2022-05-12 17:14:17 +02:00
Max Prokhorov
da4a19fdac
Table output for segment size script (#8551)
* Table output for segment size script
Also include maximum aka total for every segment key
Re-format the file and clean-up the resulting data dict
* revert to line output
* used, percentage
* unicodes
* shorter desc, headers
2022-05-11 23:25:39 +02:00
Earle F. Philhower, III
a736a95655
Fix minor typo in generated comment (#8503) 2022-03-05 08:19:17 -08:00
Earle F. Philhower, III
46190b61f1
Error even w/warnings disabled for no-return fcns (#8495)
* Error even w/warnings disabled for no-return fcns

A function whose prototype says it will return a value but doesn't
is undefined behaviour in C++.  GCC 10 will generate code that crashes
in this case.

In warnings==None mode, insterad of turning off all warnings with
`-w`, explicitly list all G++ possible warnings except for the
`no-return` warning which catches this programming error.

* Use different lists for GCC vs G++

G++ and GCC have different warning options, so use different lists.

* Make separate file for each level, add readme

The readme now includes the exact commands required to regenerate the
none-XXX files, no manual editing needed.

* Address review comments, only adjusts G++/None
2022-03-04 02:10:57 +03:00
david gauchard
f60defc3d3
flash-size agnostic builds (#6690)
* flash: mapping definition by sketch at runtime depending on flash chip size and user configuration
2022-02-10 18:25:18 +01:00
M Hightower
9fcf14f81f
Fix VM Address mask (#8440)
* Fix VM Address mask

Adjust VM Address mask to allow up to 8M Byte parts.
Allow for free heap size values over 64K
  ESP.getHeapStats(, uint32_t,)
  uint32_t getMaxFreeBlockSize();

* Fix example

* Update MockEsp.cpp for uint32_t on EspClass::getMaxFreeBlockSize()

* Added comment about heap size limitation and static_assert to verify.
Updated boards.txt to show correct External memory size and Heap size.
2022-01-12 01:35:46 +03:00
david gauchard
4c07113ff5
lwIP: v2.1.3 + dhcp fixes (#8319)
* lwIP: v2.1.3
* interface set as default when gw is valid
2022-01-06 12:38:36 +01:00
Earle F. Philhower, III
55ef3e7397
GCC 10.3 Bugfix 1 (#8393)
Fixes a hard-to-track bug in GCC 10.x.
https://github.com/earlephilhower/newlib-xtensa/issues/19
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102115

GCC 10.3 had an issue with addressing constant integer literals which would
result in crazy offsets being used and random crashes in production.
Update with an upstream GCC 11 bugfix by @jjsuwa-sys3175
https://github.com/earlephilhower/esp-quick-toolchain/pull/31
https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=dcb2873cd32b263643bfd9d1298b35d6cd028f0a
2021-12-03 02:24:12 +03:00
david gauchard
986dd4209d
enable nonosdk-2.2.x version 19-03-13 for Arduino IDE per #7965 (#8363) 2021-11-05 23:49:59 +01:00
Stanimir-Petev
3f5a76cc26
MOD-WIFI-ESP8266(-DEV) update (#8297)
Added Flash mode and reset method selection options for Olimex board MOD-WIFI-ESP8266(-DEV)
The addition of the FlashMode and ResetMethod selection options via boards.txt.py generation file.
2021-10-31 13:30:38 -07:00
Maximilian Gerhardt
f7951e6842
Respect linking order of libraries for PlatformIO (#8263)
* Respect linking order of libraries

Now has the same order as the Arduino IDE does with its platform.txt

* Remove double-referenced libs

* Change implementation style

Instead of injecting at magic indices, which might break when some other extra-scripts inject other libraries, let's create the LIBS array at the bottom in easy to understand and correct order.
2021-09-01 08:43:49 -07:00
Earle F. Philhower, III
cfb6d50844
Fix PRxxx printf format macros (#8222)
* Fix PRxxx printf format macros

Update toolchain (newlib) to supply proper definitions for PRxxx macros.
Fixes #8220

Added a PRxxx macro to an example to ensure CI will catch any problem like
this in the future.
2021-07-26 21:41:08 +02:00
david gauchard
69f8cd6934
Certificate and public keys automatic updater (#8218) 2021-07-17 16:29:46 -07:00
gneiss15
95c6fbb054
Make mkdir.py work under python3 versions below 3.5 (#8194)
* Make mkdir.py work unter python3 versions below 3.5
Because early versions of python3 did not have the optional arg "exist_ok" for "pathlib.Path(...).mkdir(...)" a build under this versions will abort with an error message.
This PR will modify the python script so that it works even under python 3.4 (and below).
2021-07-09 12:09:33 +02:00
gneiss15
7ba596a5fe
Add wifi kit 8 to boards (#8190)
* Create pins_arduino.h

* Update boards.txt.py

* Update boards.txt

* done a "boards.txt.py --allgen"

* Removed the definition of LED_BUILTIN from variants/wifi_kit_8/pins_arduino.h, because this board has no build in lED
2021-07-03 23:33:20 +02:00
Max Prokhorov
019fab4e02
pio: use CCFLAGS for -Werror (#8175)
Also adds some comments referencing SCons documentation
2021-06-25 18:38:46 -07:00
Earle F. Philhower, III
90b4c6f299
Add errors on invalid/missing function return type (#8165)
GCC 10.x seems to have a knack for crashing when a function which is declared
to return a value does not.  Add a warning, present on all builds, when this
is the case.  For more info see https://github.com/esp8266/Arduino/discussions/8160

Thanks to @hreintke and @mcspr for the tips.
2021-06-24 12:44:57 -07:00
david gauchard
e55dfc3a0e
Documentation: Arduino IDE specific options for esp82xx (#8154) 2021-06-21 17:03:14 -07:00
Silvano Cerza
78e63280ba
Add missing menu.UploadTool name definition (#8153) 2021-06-21 11:12:05 +02:00
david gauchard
2f37c967e1
gnu source: honoring libc requirements (#8147) 2021-06-20 10:31:50 -07:00
david gauchard
7f78278969
makecorever.py: restore ARDUINO_ESP8266_GIT_VER even without .git/ (#8138)
fixes #8134
2021-06-18 00:03:08 +02:00
david gauchard
52be27dfb5
Release process fix #2 (#8127)
* release script: fix variable name error
* Release process in README is decribed twice. Syncing the two walk-throughs.
* adding ARDUINO_ESP8266_VERSION reflecting exactly what's passed to `makecorever.py -v`
* remove "unix-" in version name (which was present even for windows but never used)
2021-06-17 00:51:15 +02:00
david gauchard
2897679060
Release process fix & major/minor/rev macro addition (#8126)
* update release process to the new CI
* generate ARDUINO_ESP8266_{MAJOR,MINOR,REVISION} in core_version.h
* makecorever: new option `-r` for release
2021-06-16 15:51:17 +02:00
Maximilian Gerhardt
ff041942e0
Remove include and lib folders removed since 3.0.0 core (#8125) 2021-06-15 21:19:49 +02:00
Earle F. Philhower, III
e8b411fafb
Update toolchain to gcc 10.3 w/patches (#8104)
* Update toolchain to gcc 10.3 w/patches

* Bump GIT version to clear GH CI cache
2021-06-06 12:41:06 -07:00
Earle F. Philhower, III
74d675cffa
Update to GCC 10.3 and toolchain rebuild (#8103)
Fixes #8069

GCC 10.3 has a patch to stop escaping the initial : in Windows paths which
is causing Arduino and other tools to fail dependency checks and rebuild
everything on every compile.
2021-06-05 15:27:58 -07:00
Earle F. Philhower, III
114a726798
Update toolchain to fix pgm_read_float_unaligned (#8091)
Update toolchain to fix pgm_read_float_unaligned
Fixes #8083
2021-06-04 17:06:16 +02:00