Commit Graph

1449 Commits

Author SHA1 Message Date
Rodrigo Garcia
b1d072df9f
Implements UART SerialHardware Refactoring on top of IDF (#5549)
## Summary
This PR is a complete reffactoring of UART Serial Hardware and respective HAL in order to use IDF instead of current Register manipulation approach. 

It  implements Arduino SerialEvent functionality. 

Fix #5287  
Fix #5273 
Fix #5519 
Fix #5247 
Fix #5403
Fix #5429
Fix #5047
Fix #5463
Fix #5362 
Fix #5112  
Fix #5443 

## Impact
It solves many reported issues related to UART.
It was tested and works fine for ESP32, ESP-S2 and ESP32-C3.
2021-08-23 17:25:33 +03:00
Eddie Espinal
929cf2c2d5
Add ATMegaZero ESP32-S2 microcontroller (#5569)
## Summary
Adds support for the new ATMegaZero ESP32-S2 board. Adds the relevant section to `boards.txt` and adds the folder for the `atmegazero-esp32s2` with the proper `pins_arduino.h` to the `variants` folder.

## Impact
Allows users to compile code properly for the ATMegaZero ESP32-S2 without having to use a similar board and manually entering pin numbers.

## Links
[ATMegaZero ESP32-S2](https://atmegazero.com/#/atmegazero_esp32s2_overview)

Thanks!
2021-08-23 17:21:48 +03:00
Sean Hagen
87853353db
Add SparkFun ESP32 MicroMod microcontroller (#5556)
* Add SparkFun ESP32 MicroMod to boards.txt

Copied from the tarball found in the SparkFun board manager
[JSON](https://raw.githubusercontent.com/sparkfun/Arduino_Boards/main/IDE_Board_Manager/package_sparkfun_index.json),
v1.0.1 -- [tarball can be found here](https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfun-esp32-1.0.1.tar.bz2)

* Add `pins_arduino.h` for ESP32 MicroMod

Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com>
2021-08-23 17:20:35 +03:00
Zeynep Dicle
e265bd0d7c
Add new board (Deneyap Mini) (#5531)
* The board.txt has been updated. Added variant folder.

Necessary additions for deneyapMiniKart were made in board.txt. Added pins_arduino to variant folder. deneyapMiniKart information has been added.

* Added variant files and added text in board.txt

Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com>
2021-08-23 17:20:21 +03:00
Lori
94809ce38b
fix: timerRead() is returning the last read value, not the actual #3434 (#5498) 2021-08-23 17:19:37 +03:00
Tim
29455a0447
Fix issue #5507 "Constructor WebServer::WebServer(IPAddress addr, int… (#5509)
* Fix issue #5507 "Constructor WebServer::WebServer(IPAddress addr, int port) produces an unexpected result"

"The class Webserver is declared with two explicit constructors, one with signature:
WebServer::WebServer(IPAddress addr, int port)
Using this results in a server listening on the port number obtained by converting the value of the IPAddress addr argument (in host byte order) to a uint32_t and then to a uint16_t, which is manifestly not the result that would be expected.
...
As for a fix, we can assume from these results that this constructor is not being used and therefore could simply be deleted."

* Issue 5507
Reverse changes in commit bee1e7088cef913391155f096b42cd4bb89c5c6f after discussion.
Alternative fix to be done.

* Fix issue #5507 "Constructor WebServer::WebServer(IPAddress addr, int port) produces an unexpected result"

This change adds support for multi-homed servers to libraries/WiFi.  It was assumed to be there already by libraries/WebServer, but was not.
This led to unexpected results when the IP address-specific constructor of class WebServer was used (see issue 5507).

This change was tested using three concurrent instances of WebServer, one bound to the WiFi station address, one bound to the WiFi soft AP address,
and one bound to INADDR_ANY.  See libraries/WebServer/examples/MultiHomedServers for the test method.

* Fix issue #5507 "Constructor WebServer::WebServer(IPAddress addr, int port) produces an unexpected result" (cont.)
This fixes what I think might be the cause of CI failures on GitHub for the previous commit, namely the absence of an include file
in examples/MultiHomedServers.

* Fix issue #5507 "Constructor WebServer::WebServer(IPAddress addr, int port) produces an unexpected result" (cont.)

Change port numbers in examples/MultiHomedServers per pull-request comment from me-no-dev ...
"for this test to be valid, both servers should be on the same port. That is how you can make sure that the functionality works."
2021-08-23 15:51:06 +03:00
Pedro Minatel
78499c459b
Added Franzininho WiFi board support (#5570)
This PR adds the support for the Franzininho WiFi board in CDC and MSC modes.

References: https://franzininho.github.io/docs-franzininho-site/docs/franzininho-wifi/franzininho-wifi/
https://github.com/Franzininho/imagens-franzininho/blob/main/franzininho_wifi/pinagem-franzininho-wifi.png
2021-08-23 15:43:17 +03:00
Pedro Minatel
ce680708ec
Fixed the external link to a new tab (LOLIN boards) (#5571)
Moved links to the botton
2021-08-23 15:41:07 +03:00
Me No Dev
90c01dab77
Fix build error in ESP-IDF
Fixes: https://github.com/espressif/arduino-esp32/issues/5562
2021-08-19 13:54:10 +03:00
Pedro Minatel
000d967db3
Merge pull request #5547 from pedrominatel/docs/wemos_boards
[DOCS] Added LOLIN dev kits links to the boards list in the documentation
2021-08-18 12:19:22 +01:00
Pedro Minatel
44dd99f5a5
Merge branch 'master' into docs/wemos_boards 2021-08-18 12:00:52 +01:00
me-no-dev
b580bb23fd Add log_buf to pretty print buffers
```
/* 0x0000 */ 0x7b, 0x7b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,    // {{..............
/* 0x0010 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,    // ................
```
2021-08-17 17:01:16 +03:00
pedro.minatel
a7ea737f30 Added LOLIN boards o the boards list. 2021-08-16 09:35:36 +01:00
Rodrigo Garcia
2af8cc3485
Fixes Touchpad Interrupt (#5527)
Fixes #5493 

## Summary
PR #4996 has broken Touch Interrupt functionality by removing a single line of code used to set a Register.


## Impact
This PR fixes issue #5493 by reverting the removal of necessary code as described above.
2021-08-12 10:05:47 +03:00
Me No Dev
e5bd18d6aa
Fix I2C Scan for S2 and C3 (#5528)
Thanks @chegewara

I2C Scan was failing because i2c_master_write does not accept size of 0. This change checks and skips that call if no length is provided (usually when scanning)
2021-08-12 10:03:33 +03:00
ketri2484
a4118ea889
Add ET-Board BUILTIN_LED pin (#5490)
ET-Board
No internal LED pin
Missing internal LED pin have been added to this commit.
2021-08-11 14:32:37 +03:00
Tim
c4fcab28e4
Fix issue #5506 "WebServer serveStatic () can cause LoadProhibited exception in _svfprintf_r" (#5508)
"Using a Core Debug Level of Verbose and the WebServer serveStatic() function with the default value of nullptr for its cache_header argument, results in a LoadProhibited exception in _svfprintf_r().
This is because serveStatic() calls log_v() with cache_header corresponding to a "%s" in its format but without checking that cache_header is not nullptr, and then logv() (indirectly) calls _svfprintf_r().
On the other hand, with a Core Debug Level other than Verbose, this does not occur."

Changed serveStatic() to the check value of cache_header and if it is nullptr, instead pass an empty string to log_v().
2021-08-11 14:31:07 +03:00
Drzony
0acbe781f5
Increase default timeout for WiFiClient from 3ms to 3s (#5496)
## Summary
https://github.com/espressif/arduino-esp32/pull/5487 introduced a default timeout for WiFiClient, however the default was specified in milliseconds instead of seconds, see be84c8219c (commitcomment-54358731)
This 3ms timeout breaks OTA when the processor is busy.

## Impact
Sets the default to a saner value, fixes OTA.
2021-08-11 14:17:38 +03:00
Me No Dev
0b0dfab3cf
Fix race in log_printf (#5523)
Fixes: https://github.com/espressif/arduino-esp32/issues/5513

Can still race if Serial.begin() is not called in setup()
2021-08-11 13:46:08 +03:00
Me No Dev
5fd737925f
Fix wrong attenuation being set to pins (#5522)
Fixes: https://github.com/espressif/arduino-esp32/issues/5503
2021-08-11 13:05:26 +03:00
Me No Dev
5bb8177aa1
Add initial support for USB MSC (#5466)
* Add initial support for USB MSC

* Add Firmware Upload/Download With MSC

Current running firmware is available as file inside the MSC Disk. To update the firmware on the ESP, just copy a regular firmware bin into the drive

* Support overwriting of the firmware file

Overwriting a file is done totally differently on MacOS, Windows and Linux. This change supports it on all of them.

* Allow CDC, FirmwareMSC and DFU to be enabled on boot

* Add example ESP32-S2 USB-ONLY board

* Various device code optimizations

Added `end()` methods to MSC classes
Made begin() methods safe to be called multiple times
Optimized CDC class

* Fix CDC Connect/Disconnect detection in Arduino IDE on Windows

* Rework cdc_write

* Update ESP32-S2 board configs
2021-08-02 15:35:13 +03:00
Krzysiek S
be84c8219c
[WiFiClient] Default connection timeout, when no timeout provided (#5487)
## The problem
WiFiClient's connect method variant where no timeout is passed can block esp32 MCU and may then cause watchdog to kick in and reset the device. This behavior is different from that, what is in arduino-esp8266 core.

## Summary
Some cross-esp libraries (working both on esp32 and 8266), like PubSubClient simply call connect method on WiFiClient, to get connected to remote server. However, connect behavior varies betwen esp arduino 8266 and esp arduino 32 cores. This pull request tries introduce same behavior - to make connect method non-blocking on esp32, like it is with 8266 arduino core.

## Proposed solution
Introduce default fixed timeout that can be changed by #define - by default set to 3 seconds.

### Affected components: 
WiFiClient

### Affected methods:
```c++ 
int connect(IPAddress ip, uint16_t port);
int connect(const char *host, uint16_t port);
```

### Impact
May impact projects or libraries using connect method variant without specified timeout, where:
- remote is located far away or
- connection is heavily limited, or
- remote is slow, when it comes to accept the connection
2021-08-02 15:05:44 +03:00
t-oot
31127f4260
Support for Transfer-Encoding headers that specify "identify" (#5486)
In [HTTPClient](https://github.com/espressif/arduino-esp32/tree/master/libraries/HTTPClient), if the `Transfer-Encoding` header is set to `identity`, an error (Transfer-Encoding not supported) will occur.

HTTPClient will consider the request as `identity` if the `Transfer-Encoding` header is not set. But it is also defined a response with `identity` explicitly set in the `Transfer-Encoding` header (ref:[MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Transfer-Encoding)).

This pull request will allow the request to be processed normally even when `identity` is explicitly set.
2021-08-02 15:04:48 +03:00
me-no-dev
4365a45401 Fix WiFi Deinit bug
Fixes: https://github.com/espressif/arduino-esp32/issues/4842
2021-08-02 14:57:55 +03:00
me-no-dev
023ae75b97 Rework pulseIn to work on ESP32-C3
Fixes: https://github.com/espressif/arduino-esp32/issues/5488
2021-08-02 14:53:11 +03:00
pulquero
c5a1f3efd7
Corrected CLASSIC_BT_ENABLED to CONFIG_BT_CLASSIC_ENABLED. (#5471)
CLASSIC_BT_ENABLED never worked as was incorrectly named, e.g. see
https://github.com/nkolban/esp32-snippets/issues/890#issuecomment-521520934
Now corrected to the update-to-date name CONFIG_BT_CLASSIC_ENABLED.
2021-07-29 15:06:43 +03:00
chegewara
9406f8e464
Weaken tinyusb callbacks (#5475) 2021-07-29 14:52:30 +03:00
Rodrigo Garcia
65eafd16b5
Fixes ESP32-S2 LEDC PWM #5375 #5050 (#5452)
Fixes: #5375
Fixes: #5050
2021-07-26 20:37:44 +03:00
Sagar
d5a98f9a39
Doc: Updated Troubleshooting file (#5430) 2021-07-26 20:37:12 +03:00
rtrbt
3780b5c924
Unbreak integer to string conversion functions. (#5423) (#5438) 2021-07-26 16:06:13 +03:00
Me No Dev
1775dd1faa
Add ReadTheDocs CI (#5456) 2021-07-26 16:04:20 +03:00
Me No Dev
6972695d95
IDF master c69f0ec32 (#5449)
esp-dsp: master f4d7d6e
esp-face: master 420fc7e
esp-rainmaker: f1b82c7
esp32-camera: master 6a9497b
esp_littlefs: master b58f00c
2021-07-26 15:56:05 +03:00
Vojtěch Bartoška
e0e5c88658
Create PULL_REQUEST_TEMPLATE.md (#5439)
Adding first version of PULL_REQUEST_TEMPLATE.md.

The purpose of this template is to improve and simplify writing more accurate Release Notes.
2021-07-26 15:37:14 +03:00
Quoc Huynh Nguyen
6e47e18a1b
Add files via upload (#5433)
Newly compiled esp32-camera driver from https://github.com/espressif/esp32-camera
2021-07-22 20:10:49 +03:00
vortigont
34125cee1d
Examples update, add a note for configTime() that only one ntp server is supported by lwip (#5343)
lwip lib bundled with esp32 Arduino supports only one ntp server. Any additional servers set are just silently ignored.
This default is different from esp8266 Arduino core and very confusing. Most of the examples provided uses 3 different ntp servers for redundancy while only the first one is used actually.
Addressing issue #4964
2021-07-22 20:09:28 +03:00
Me No Dev
ee24736042
Update README.md 2021-07-22 17:05:54 +03:00
Rodrigo Garcia
5458df0a54
Fixes Serial.end() hanging on ESP32-S2 (#5434)
Fixes: #5429
2021-07-21 17:02:06 +03:00
Vlasta Hajek
e12d8c8ff1
fix: WiFiClientSecure connection timeout (#5398) (#5418)
Closes #5398

Using the same non-blocking socket connect pattern for respecting connection timeout, copied from WiFiClient::connect.

WiFiClient::connect uses lwip_connect_r, whereas start_ssl_client uses lwip_connect. I haven't found what is the difference between them. I tested both, both work ok, so I kept lwip_connect.
2021-07-21 13:20:23 +03:00
me-no-dev
4ada3f5804 Fix Windows USB issues
- Device will not reset if previous baudrate was not 9600
- CDC Device is not recognized if WebUSB is enabled
2021-07-20 13:36:27 +03:00
Me No Dev
268595c743
Various USB fixes (#5422)
* Fix compile archive arguments for the new toolchain

* Add menu to S2 for picking through which port to upload

Internal USB CDC requires to reset and wait for the new port (because persistence is not yet stable)

* USB CDC should also be started in main

* Fix URL and USB version for WebUSB

* Update vendor callback API

* Update CDC::write to use TX_DONE semaphore

* Update USB_Serial example
2021-07-20 11:59:13 +03:00
Rodrigo Garcia
4a0305a05e
Fixes SD begin() end() memory leak #2897 (#5419) 2021-07-19 19:08:51 +03:00
me-no-dev
6393dbc91b Fix gh-pages update script 2021-07-19 18:56:00 +03:00
Vojtěch Bartoška
49df8778f9
Merge pull request #5417 from pedrominatel/docs/readme_docs_update
Links to the new docs updated and new docs build badge added
2021-07-19 17:31:48 +02:00
pedro.minatel
f79411f3d3 Links to the new docs updated and new docs build badge added 2021-07-19 15:01:39 +01:00
Jayantajit Gogoi
db4e7667af
add callback to HTTPUpdate (#5408)
- add callback function to HTTPUpdate
- update example to print httpupdate progress
- fix ArduinoIDE syntax coloring

Signed-off-by: Jayantajit Gogoi <jayanta.gogoi525@gmail.com>
2021-07-19 14:28:17 +03:00
Sagar
f64ca2e084
Fixed typo in comments. (#5407)
A typographical error is corrected in the 2nd line of the comment. 
From = " This is un example howto use Touch Intrrerupts "
To = " This is an example of how to use Touch Intrrerupts "
2021-07-19 13:38:40 +03:00
Pedro Minatel
1effae46ea
Docs: Initial documentation structure using Sphinx (#5355)
This PR is the initial documentation structure including the basic information about the project and Sphinx configuration.

####CONTENTS:
- Getting Started
- Installing
- Boards
- Libraries
- Library Builder
- Tutorials
- ESP-IDF as Component
- OTA Web Update
- makeEspArduino
- Troubleshooting
- Contributing

This PR also changes the README.md.
2021-07-19 13:37:26 +03:00
me-no-dev
d9833f9b6d Remove mkfatfs tool from package json
Fixes: https://github.com/espressif/arduino-esp32/issues/5376
2021-07-18 22:48:03 +03:00
xBiohazardx
0aafa05e8f
Added function to retrieve the amount of data received from an BLECharacteristic (#5339) 2021-07-17 02:03:44 +03:00
Me No Dev
16f4b0f5ba
IDF master d93887f9f (#5336)
* Update toolchain

* Update package_esp32_index.template.json

* add optional component dependencies after Kconfig options are known (#5404)

Until this commit, Kconfig options (e.g. CONFIG_TINYUSB_ENABLED) were
used in conditions preceding idf_component_register to determine which
components need to be added to `arduino` component requirements.
However the Kconfig options aren't known at the early expansion stage,
when the component CMakeLists.txt files are expanded the first time
and requirements are evaluated. So all the conditions evaluated as if
the options were not set.
This commit changes the logic to only add these components as
dependencies when the Kconfig options are known. Dependencies become
"weak", which means that if one of the components isn't included into
the build for some reason, it is not added as a dependency.
This may happen, for example, if the component is not present in the
`components` directory or is excluded by setting `COMPONENTS` variable
in the project CMakeLists.txt file.
This also ensures that if the component is not present, it will not be
added as a dependency, and this will allow the build to proceed.

Follow-up to https://github.com/espressif/arduino-esp32/pull/5391.
Closes https://github.com/espressif/arduino-esp32/issues/5319.

* IDF master d93887f9f

* PlatformIO updates for CI (#5387)

* Update PlatformIO CI build script

- Switch to the latest toolchains 8.4.0 for ESP32, ESP32S2, ESP32C3
- Use PlatformIO from master branch for better robustness

* Update package.json for PlatformIO

Co-authored-by: Ivan Grokhotkov <ivan@espressif.com>
Co-authored-by: Valerii Koval <valeros@users.noreply.github.com>
2021-07-17 01:57:49 +03:00