1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-22 21:23:07 +03:00

3226 Commits

Author SHA1 Message Date
ZaPpInG
4d302f06c9 Fix missed backquote to make monospaced text in gdb.rst (#5663)
* Fix missed backquote to make monospaced text in gdb.rst
* Fix line spacing on example walkthrough
2019-01-24 23:04:56 +01:00
david gauchard
7c5be91430 dynamic WiFi.hostname("newname") (#5652)
* dynamic WiFi.hostname("newname")

* WiFi.hostname() back to String return type

* no silent hostname fix but proceed with debug message and returning false
2019-01-24 17:13:20 -03:00
ZaPpInG
ece93908a8 Complete info how to find elf file in windows (#5660) 2019-01-24 18:56:08 +00:00
ZaPpInG
a9e89500e1 Correct path to GDB in Windows (#5659)
* Correct path to GDB in Windows

* Added Linux and Windows label

* Added using git version
2019-01-24 14:49:16 -03:00
Earle F. Philhower, III
bff3a6d963 GDB support w/new toolchain and UART driver (#5559)
* Add full gdb support with uart/Serial integration

* Fix GDB merge errors

* Update to unpatched GDB protocol specification

It appears that Espressif patched the open source xtensa GDB port in
order to build their old GDB executable and their old gdbstub (basically
removing any register in a generic xtensa and only leaving those
present in the chip they synthesized).  Their GDBStub also assumed this
behavior.

Unpatched upstream GNU GDB now expects all the registers in
xtensa-config.c to be sent/read on a 'g' command.  Change the GDB stub
to send "xxxxxxxx"s (legal per the spec) for unimplemented registers.
This makes the 'g' response much longer, but it's results are cached
and in an interactive debugger it isn't noticeable.

* Fix .iram.literal to come before .iram.text for GDB

* Move functions to flash, call using wrappers

All functions which are not interrupt or exception called are now in
flash. A small IRAM wrapper enables flash when processing main GDB ops
by calling Cache_Read_Enable_New() and then jumping to the main flash
code.  This seems to work for catching exceptions, data and code breaks,
and Ctrl-C.

The UART ISR handler and exception handler register-saving bits of
code in ASM are still in IRAM.

GDB IRAM usage is now about 670 bytes.

* Remove LWIP2 builder commit

* Add documentation and gdbstub_init header

Add some simple GDB documentation to the main tree showing a worked
example.

Adds the definition of `void gdbstub_init()` to <GDBStub.h>

* Clean up GDB include and library dir

Replace GDBstub.h with the version in the internal/ directory, and
adjust stub code accordingly.  This way, only one copy of a file called
"GDBstub.h" will exist.

Update the gdbcommands and replace the obsolete ESPRESSIF readme with
@kylefleming's version since we're mainly doing serial, not TCP,
connected debugging.

Bump the library rev. number since this is a pretty big functionality
change.

Minor documentation tweak.

* Undo much of UART refactoring, set fifo IRQ to 16

Remove the refactoring of pin control and other little things not directly
related to GDB processing.  Should greatly reduce the diff size in uart.c.
Should also remove any register value changes (intended or otherwise)
introduced in the original PR from @kylefleming.

Set the FIFO interrupt to 16 chars when in GDB mode, matching the latest
UART configuration for highest speed.

* Add architecture comments, cleanup uart.c code

Comments added to UART.c trying to explain (as best as I understand it)
the changes done to support GDB and how they interact with standard
operation.

Fix the uart_uninit to stop the ISR and then free appropriately.

Fix uart_isr_handle_data (GDB's shim for sending chars to the 8266 app)
to do the exact same thing as the standard UART handler including set
the overflow properly and either discard or overwrite in that case.

Fix serial reception when GDB enabled by enabling the user recv ISR.

Remove commented attributes from gdbstub, leftover from the move to
flash.

General logic cleanup per comments in the PR.

* Also set the UART flags for HW error in GDB

Ensure we also check the UART flags and set the uart status
appropriately when in GDB mode.
2019-01-23 17:51:35 -03:00
Peter
4657666319 Correct 'git submodule' syntax (#5654)
Should be singular, not plural (submodule, not submodules)
2019-01-23 16:41:09 +01:00
ZaPpInG
39e31b2352 Correct link to Arduino Board Manager info (#5650)
The link was pointing to Arduino Libraries Manager info and not to Arduino Board Manager info.
2019-01-22 17:29:44 +01:00
LaborEtArs
a89ab24edc LEAmDNS Fixes (#5641)
- Better separation of ESP wifi thread code from user thread code
- Added a flag for 'update()'-less use (disabled by default)
- The too fast updates for service queries are fixed
- Switched fully to PolledTimeout; LEATimeFlag not needed anymore (BTW: a const 'expired()' method would be helpful)
- The device should stay visible now even after the first TTL timeout
- Improved service querying (queries five times now)
- Fixed TTL (bug introduced with Fixes 1.0)
2019-01-22 12:21:42 +01:00
hreintke
e9a6fd2f82 Update mDNS examples to use HTTP Server instead of TCP Server (#5589) 2019-01-22 10:04:56 +01:00
Mike C
d7094f2269 Release referenced resources in the destructor for ESP8266SSDP (#5607)
* Release referenced resources in destructor

* Release referenced resources in destructor, corrected for IPV6

* Release referenced resources in destructor, per suggested changes
2019-01-22 00:00:19 -03:00
david gauchard
471dd87b5c hardwareSerial: add missing include (#5648)
Fix #5644, #include <time.h>
2019-01-21 16:32:17 +00:00
liebman
2ffd9c993c fix lwip selection in tests/device Makefile (#5643)
add test_BearSSL/data to .gitignore
2019-01-21 15:35:51 +01:00
carlsa
cee0796a87 Changed I2C buffer from 32 to 128 bytes to match Espressif's ESP32 Arduino core (#3576) 2019-01-20 01:00:43 -03:00
liebman
049a9eaa5b decorate as override virtual methods in WiFiUDP (#5637)
make WiFiUDP destructor virtual
add empty virtual destructor to Udp
2019-01-20 00:34:21 +01:00
david gauchard
bd11d026e8
fix host emulation on macOS (#5633) 2019-01-19 03:19:17 +01:00
david gauchard
b666435282 WiFiClient::remoteIP: fix nullptr crash (#5634) 2019-01-18 22:08:32 -03:00
Philipp Reichmuth
324eb56d65 Add fix for SoftwareSerial submodule errors to documentation (#5602)
* Add fix for SoftwareSerial submodule errors to documentation

* Update installing.rst

Replaces and based on #5602
Fixes #5583

* Update installing.rst

Remove forgotten section
Add update section for Other OS
2019-01-18 17:55:20 -03:00
LaborEtArs
570b9a6b6a LEAmDNS Fixes 1.1 (#5619)
* Fixes 1.1

- Better separation of ESP wifi thread code from user thread code
- Added a flag for 'update()'-less use (disabled by default)
- The too fast updates for service queries are fixed
- Switched fully to PolledTimeout; LEATimeFlag not needed anymore (BTW: a const 'expired()' method would be helpful)
- The device should stay visible now even after the first TTL timeout
- Improved service querying (queries five times now)

* Update mDNS_Clock.ino

Removed references to LEATimeFlag.h

* Update mDNS_Clock.ino

Styling
2019-01-18 15:59:26 -03:00
Earle F. Philhower, III
6883beedec
Remove broken ltoa/ultoa, call itoa/utoa (#5625)
* Remove broken ltoa/ultoa, call itoa/utoa

Use the newlib integer-to-ASCII non-POSIX calls instead of rolling
our own.  Should be safe as sizeof(long) == sizeof(int).
The custom functions behaved differently from itoa when passed in
negative values in non-base-10.

Add host tests for negative non-base-10 int/longs
2019-01-17 02:08:19 +00:00
david gauchard
7ee503d353
lwip2: dhcp-server addon from @SmartBlug #5594 (#5613) 2019-01-16 01:26:20 +01:00
david gauchard
cef5deecb5
generic esp8266 board: Use flash mode DOUT by default, in place of QIO (#5601) 2019-01-15 23:52:21 +01:00
david gauchard
6bd26a3b4a
host emulation: improve udp, persistent spiffs (#5605) 2019-01-15 22:56:54 +01:00
Earle F. Philhower, III
8a64a1236f
Make waveform generator a NMI to run always, increase accuracy (#5578)
* Make waveform generator a NMI to run always

Make the waveform generator an NMI using the same code as in 2.4.0.
Making it NMI will ensure it runs even when interrupts are disabled.

Fixes #5568

* Move to a lockless waveform generator

Make the waveform generator lockless by doing all dangerous structure
updates in the interrupt handler.  start/stopWaveform set a flag and
cause an interrupt.  They wait for the interrupt to complete and clear
those flags before returning.

Also rework the Waveform[] array to be lockless.

* Optimize IRAM and CPU usage in IRQ

Try and minimize the IRAM needed to run the IRQ while keeping performance at
or better than before.

* Avoid WDT errors, optimize pin scans

Calculate first and last pins to scan for PWM, significantly increasing
accuracy for pulses under 10us at 80MHz.  Now if you are using a single
PWM channel at 80MHz you can generate a 1.125us pulse (down from ~4us).

Rework the IRQ logic to avoid potential WDT errors.  When at 80MHz it
appears that interrupts occuring faster than 10us apart on the timer
cause WDT errors.  Avoid it by increasing the minimum delay between
IRQs on the timer accordingly.

* Clean up format/comment, remove delay() in stop

stopWaveform may be called from an interrupt (it's called by digitalWrite)
so we can't call delay().  Make it a busy wait for the IRQ to clear the
waveform.

Only set a new timeout of 10us when starting a new waveform when there
is no other event coming sooner than that.

Update formatting and comments per @devyte's requests.

Replace MicrosecondsToCycles() with standard Arduino call.
2019-01-11 15:54:59 -08:00
Earle F. Philhower, III
9515f46684
Remove interrupt disable around flash operations (#5577)
All interrupt service routines are supposed to be in IRAM now, so there
is no need to keep interrupts disabled while doing flash operations.
Remove the IRQ disable/enable from the ESP.flash* methods.

Related to #5568
2019-01-09 15:03:58 -08:00
Robin Richtsfeld
187f6a58b8 Split common.sh into separate scripts for each job (#5569) 2019-01-08 17:32:43 -08:00
david gauchard
dc03293d82
(re)introduce timeout in HardwareSerial::readBytes(buffer, size) (#5558)
(re)introduce timeout in HardwareSerial::readBytes(buffer, size), add HardwareSerial::read(buffer, size) + visual test
2019-01-08 04:01:21 +01:00
david gauchard
8f8628c681 make CI starts with (longer) PIO jobs, also move (shorter) host job later (#5599)
* make CI starts with (longer) PIO jobs, also move host (shorter) test later

* mention stage on every test
2019-01-07 14:06:17 -08:00
Earle F. Philhower, III
c08ef514f6
Silently eat \rs in PEM decoder in BearSSL (#5598)
There is a bug in the BearSSL PEM decoder when Windows EOLs (\r\n) are
passed in.  Avoid the issue by silenly discarding \rs as they are read
from the PEM source in the C code, to keep my sanity by avoiding reworking
the pseudo-Forth parser code.

Fixes #5591
2019-01-07 09:24:38 -08:00
Earle F. Philhower, III
7c2e071351
Add Linux i686 (32bit) architecture toolchain (#5586)
Fixes #5585
2019-01-05 12:20:57 -08:00
Earle F. Philhower, III
1f13c73ced
Speed up CI builds with caching hacks (#5539) 2019-01-05 10:53:39 -08:00
SimonWilkinson
eaac1e8b24 Rework DNSServer to be more robust (#5573)
* DNSServer: Handle examplewww.com correctly

Just replacing 'www.' with the empty string when we assign the
domainname will remove all occurrences of 'www.', not just those
at the start of the string.

Change this to a startsWith check so that only "www." at the
beginning of the string is removed.

* DNSServer: Rework request handling

Rewrite the request handling in the DNSServer code to address the
following issues:

Compatibility with EDNS #1:

   RFC6891 says that
     "Responders that choose not to implement the protocol
      extensions defined in this document MUST respond with a
      return code (RCODE) of FORMERR to messages containing an
      OPT record in the additional section and MUST NOT include an
      OPT record in the response"

   If we have any additional records in the request, then we need
   to return a FORMERR, and not whatever custom error code the user
   may have set.

Compatibility with EDNS #2:

   If we're returning an error, we need to explicitly zero all of
   the record counters. In the existing code, if there is an
   additional record present in the request, we return an ARCOUNT
   of 1 in the response, despite including no additional records
   in the payload.

Don't answer non-A requests

   If we receive an AAAA request (or any other non-A record)
   requests, we shouldn't respond to it with an A record.

Don't answer non-IN requests

   If we receive a request for a non-IN type, don't answer it
   (it's unlikely that we'd see this in the real world)

Don't read off the end of malformed packets

   If a packet claims to have a query, but then doesn't include
   one, or includes a query with malformed labels, don't read off
   the end of the allocated data structure.

* DNSServer: Clarify and tidy writing the answer record

Modify the code used to write the answer record back to the server
so that it is clearer that we are writing network byte order
16-bit quantities, and to clarify what's happening with the pointer
used at the start of the answer.
2019-01-05 12:47:00 -03:00
Develo
2f0f49dbe8
Update README.md (#5581)
Add specific instructions for breaking changes.
Fix some formatting.
2019-01-03 22:44:54 -03:00
david gauchard
b26c19e82e lwip2 fixes: turn off random delay before sntp request (#5567)
+update dhcp6 patch: update ip_addr_set_zero_ip6 to use IP_SET_TYPE_VAL, avoiding compilation warning
2018-12-29 18:40:39 -03:00
hreintke
62b8ac6be7 Fix LeamDNS examples (#5563)
* Fix LeamDNS examples

* Fix Style check error

* Another style fix
2018-12-29 00:00:16 -03:00
david gauchard
eb5d636f0d
use newlib api in new mDNS, fix host using mDNS (#5545) 2018-12-27 22:06:10 +01:00
david gauchard
cac22e3576
fix dhcp6 in upstream lwIP (#5560) 2018-12-27 19:29:04 +01:00
david gauchard
e3bc3c226b
Fixes for IPv6, added in CI (#5557) 2018-12-27 16:13:48 +01:00
Earle F. Philhower, III
9def8b0669
Move exceptions back out of IRAM (#5556)
PR #5538 made exceptions disabled by default and changed some file names
which didn't get updated in the linker file, resulting in exceptions ending up
back in IRAM.
2018-12-26 12:59:13 -08:00
david gauchard
da7ffdaa28
add 1 more IPAddress constructor for IPv6 (#5551) 2018-12-26 15:01:48 +01:00
Takayuki 'January June' Suwa
8049543e98 mDNS: Add support for String arg to begin() (#5542)
Analogous to commit dd6333ee8b26dd9cc82dea252ba150e85c0ebb11
2018-12-23 12:57:34 -03:00
dav1901
dd6333ee8b Add support for String args to softAP and begin (#5295) 2018-12-22 22:48:31 -03:00
david gauchard
228ad7ed75 tests/host: fixes and updates (#5537)
(LEAmDNS, broken pipe, non blocking accepted sockets, digitalRead)
2018-12-22 03:03:11 -03:00
Earle F. Philhower, III
2388102a97 Make exceptions off by default (#5538)
Scripts, makefiles, and users who do no changes will not have exceptions
enabled during builds.  This should avoid the sketch inflation issue for
users who are space constrained, while allowing users who care about
exceptions to enable them through the IDE.
2018-12-21 23:38:41 -03:00
david gauchard
95a5c5e60a let lwIP route packets, do not let SDK teaching how to do so (#5526) 2018-12-21 19:38:22 -03:00
Gijs Noorlander
4c04c63c2a Rewrite PUYA patch to be more universal and mem friendly. (#5504)
* [PUYA] Applied ESPeasy puya_v3.patch

Applied the patch to get the starting point as described in https://github.com/esp8266/Arduino/issues/5493

* [PUYA] Only allocate memory when PUYA detected

core 2.5.0 PUYA patch, no puya:

Description	Function	#calls	call/sec	min (ms)	Avg (ms)	max (ms)
Save File		4	0.25	34.755	45.264	67.620
Free Mem:	16168

core 2.5.0 PUYA patch, Faked Puya detect:

Description	Function	#calls	call/sec	min (ms)	Avg (ms)	max (ms)
Save File		2	0.04	41.332	57.544	73.756
Free Mem:	11560

* [PUYA] Check for PUYA chip as soon as possible at boot

Check for PUYA chip in call for `getFlashChipId()`
This will only be done once and the result of the get function is also cached.

* [PUYA] Use limited buffer (512 byte) allocated at first write

No need to allocate a buffer when not writing to flash.
The default buffer size is 512 bytes, which is 2 pages in the flash chip.

* [PUYA] Lower PUYA flash buffer to 1 page (256 B)

As discussed here: https://github.com/esp8266/Arduino/issues/5493#issuecomment-447543279

* [PUYA] Fix indents naming and return conditions

* [PUYA] Move Puya write code to spi_flash_write_puya

* [PUYA] Make spi_flash_write_puya static and define PUYA_SUPPORT

* [PUYA] Add some SPI flash vendor IDs

As requested by @igrr https://github.com/esp8266/Arduino/pull/5504#discussion_r242016184

* [PUYA] All suggested changes.

See: https://github.com/esp8266/Arduino/pull/5504#pullrequestreview-186145820
2018-12-19 00:59:25 -03:00
Max Prokhorov
d6c743027d Fix negative SPIFFS size (#5522) 2018-12-18 23:33:41 -03:00
lukasostendorf
3a36501d6d Fix: some clients were not able to authenticate using DIGEST_AUTH (#5506) 2018-12-18 14:52:14 -03:00
acevest
34e90f3c56 fix bug. in sta mode, empty passphrase should not use secure auth mode (#5516)
* in sta mode, empty passphrase should not use secure auth mode

* use nullptr, camelCase and parenthesis
2018-12-18 10:47:25 -03:00
Develo
3348ddf650
Update README.md (#5519)
clarify some points, add links, add doc/conf.py
2018-12-17 19:44:49 -03:00
Develo
574a121fa6
Update README.md (#5517)
Version bumps to beta2
2018-12-17 15:00:55 -03:00