Skip to content

v2.0.0 #4996

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 115 commits into from
Apr 5, 2021
Merged

v2.0.0 #4996

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
34cd542
clean sdk
me-no-dev Mar 30, 2021
8e3e24c
Initial IDF-4.0 port
me-no-dev Jan 25, 2020
0e46b80
Add S2 variant
me-no-dev May 11, 2020
4235faa
Update esp32-hal-gpio.c
me-no-dev May 11, 2020
bbfabaf
Update app_httpd.cpp
me-no-dev May 11, 2020
b8e644e
disable BT Serial examples for S2
me-no-dev May 11, 2020
c793fa2
Update esp32-hal-i2c.c
me-no-dev May 11, 2020
7a389b4
fix peripherals
me-no-dev May 13, 2020
706d757
fix compile errors for esp32
me-no-dev May 13, 2020
2ca5fd8
Add I2C IDF Wrapper
me-no-dev May 13, 2020
6b54a55
Update HardwareSerial.cpp
me-no-dev May 13, 2020
8c5f8d6
Update esp32-hal-uart.c
me-no-dev May 14, 2020
833e139
Fix PSRAM support
me-no-dev May 14, 2020
d15e1b0
fix WiFi
me-no-dev May 17, 2020
d2d4127
fix wrong bootloader path in pio scripts
me-no-dev May 17, 2020
edfe769
Update esp32-hal-gpio.c
me-no-dev May 17, 2020
85e21ed
Disable IRAM ISRs and functions by default
me-no-dev May 18, 2020
509bcd3
update idf libs, disable WDT on S2, use malloc for PSRAM
me-no-dev May 18, 2020
3803cad
fix issue with rtc wdt
me-no-dev May 18, 2020
aa7b015
add psram to malloc only if interrupts are not in IRAM
me-no-dev May 18, 2020
9b26012
Disable modem sleep by default on S2 for now.
me-no-dev May 18, 2020
b39aca4
Pull latest IDF and enable TinyUSB
me-no-dev May 30, 2020
f40274a
Fix swapped USB pins issue
me-no-dev May 30, 2020
b02f131
TinyUSB adjust
me-no-dev Jun 1, 2020
437db96
Fixing static IP configuration so it doesn't get overwritten by DHCP …
atanisoft Jun 22, 2020
9216cbe
Fix GPIO Interrupts
me-no-dev Jun 22, 2020
e4cb02c
Update TinyUSB Lib
me-no-dev Jun 28, 2020
a7fc1a0
Update IDF Libs
me-no-dev Jun 28, 2020
70cf282
Add TinyUSB HAL and CDC
me-no-dev Jun 29, 2020
423a737
Fix DTR/RTS state for ESP32S2 native USB
me-no-dev Jun 29, 2020
5c2d1e3
Update USBCDC.cpp
me-no-dev Jun 30, 2020
2d6587d
Update TinyUSB
me-no-dev Jul 1, 2020
e1506a6
Change driver attach api and remove DFU from CDC
me-no-dev Jul 1, 2020
031988b
Handle persistent reboot better in CDC
me-no-dev Jul 2, 2020
138e369
Add debug output to CDC
me-no-dev Jul 2, 2020
17999e7
Some CDC and BTSerial compatibility fixes
me-no-dev Jul 14, 2020
42c40ec
Update USB.cpp
me-no-dev Jul 18, 2020
bfe1a6b
Update tinyusb
me-no-dev Jul 19, 2020
334a9b3
Add support for custom VID/PID and Board name to show in ArduinoIDE p…
me-no-dev Jul 22, 2020
c648b03
Add option USB CDC to be used for Serial (starting USB early)
me-no-dev Jul 22, 2020
83f78c2
Improve CDC Logging support
me-no-dev Jul 22, 2020
7da1a2b
Added UM FeatherS2 and UM ProS2 boards to boards.txt (#4188)
UnexpectedMaker Jul 23, 2020
c91105d
Update HardwareSerial.h
me-no-dev Jul 23, 2020
fccf573
Add option to select the core used for Arduino and it's events
me-no-dev Aug 16, 2020
6b110e6
Update IDF, tools and toolchains
me-no-dev Aug 24, 2020
115d742
Add board microS2 (#4314)
microdev1 Oct 2, 2020
504b148
Added ESP32-Wrover-Kit with distinct build.board (#4118)
tobozo Oct 2, 2020
5a9a679
Try with speed optimization as opposed to debug. Coremark 240 -> 430
me-no-dev Oct 11, 2020
c0d9d0c
Add camera support
me-no-dev Oct 12, 2020
1f0c5a9
Update IDF and Tools
me-no-dev Oct 13, 2020
4920cca
Make esp32-hal-tinyusb.h conditional on tinyusb (#4155)
bobobo1618 Oct 14, 2020
98d043d
Fix Arduino PIN counts
me-no-dev Oct 14, 2020
d6e58a8
Update IDF and Camera
me-no-dev Oct 14, 2020
3a32902
Update IDF master to 357a27760
me-no-dev Nov 2, 2020
b63981e
Add esp-rainmaker support for ESP32
me-no-dev Nov 3, 2020
73911eb
Adding LITTLEFS after esp_littlefs (IDF) is built-in (#4483)
lorol Nov 3, 2020
b5efb47
fix some merge errors
me-no-dev Nov 3, 2020
5ecb491
more fixes
me-no-dev Nov 3, 2020
c4f6aff
Add missing config
me-no-dev Nov 4, 2020
2e988a0
Update WiFiProv.ino
me-no-dev Nov 4, 2020
1a0f386
more fixes
me-no-dev Nov 4, 2020
3e6d164
skip bt tests for esp32s2
me-no-dev Nov 4, 2020
f376b3b
Make setHostname return true
me-no-dev Nov 5, 2020
cabfe84
fix psram init
me-no-dev Nov 6, 2020
9c51a00
RE: Change check for BT_ENABLE to really be a check for BLUEDROID_ENA…
me-no-dev Nov 6, 2020
9809406
Try to free some memory
me-no-dev Nov 6, 2020
4961cee
Create esp_arduino_version.h
me-no-dev Nov 6, 2020
e3dd168
Update Arduino.h
me-no-dev Nov 6, 2020
99272ce
add 2 variants (#4514)
ladyada Nov 10, 2020
fee89d4
Idf release/v4.2 - corrections of LITTLEFS and tools (#4515)
lorol Nov 10, 2020
7017302
Provisioning Fixes (#4522)
sweetymhaiske Nov 12, 2020
19cdaeb
Update IDF to 494a124d9
me-no-dev Nov 15, 2020
1bc5d39
Allow custom variants directory
loick111 Nov 15, 2020
a002bad
Updated SD_MMC init to match changes upstream
lbernstone Nov 15, 2020
863da8d
Fix deprecated vref function
lbernstone Nov 15, 2020
f5052bd
Fix PSRAM on S2
me-no-dev Nov 16, 2020
9a99e6a
rework persist reboot
me-no-dev Nov 17, 2020
fe12d8e
Fix Wire.begin causing divide by zero
me-no-dev Nov 17, 2020
b405941
Ignore mklittlefs
me-no-dev Nov 18, 2020
c3b4291
Separate Provisioning library from WiFi library to avoid unnecessary …
sweetymhaiske Nov 18, 2020
3fb65b6
Fix possible race condition in uart attach (#4569)
lbernstone Dec 1, 2020
9fbc016
Update boards.txt
me-no-dev Dec 1, 2020
28c4924
ESP-IDF update to 2bfdd036b and ESP-DSP
me-no-dev Jan 12, 2021
585398e
Update PlatformIO build script to handle spaces in env name (#4791)
valeros Feb 15, 2021
0e8096c
Update esp32-hal-timer.c
me-no-dev Mar 31, 2021
58966ec
Fix WiFi::setHostname
me-no-dev Mar 31, 2021
ed4d0cd
Create .skip.esp32s2
me-no-dev Mar 31, 2021
9cbf4cb
Modified WString.h to allow for larger strings with PSRAM
lbernstone Nov 29, 2020
c743f22
Add ESP RainMaker support to Arduino
sweetymhaiske Nov 17, 2020
d7f6492
Update RMakerDevice.ino
me-no-dev Mar 31, 2021
1b896c6
Added missing default TX and RX for T-watch (#4621)
happyme531 Mar 31, 2021
baaf9f2
[2.0.0] Fix issue with init I2C for esp32 S2 (#4776)
chegewara Mar 31, 2021
d7eb1fc
Update d32_pro boards.txt (#4704)
tobozo Mar 31, 2021
a205430
Add support to read/write raw sectors from/to sd card (#4777)
chegewara Mar 31, 2021
b2ab311
Update WiFiClient.cpp (#4816)
everslick Mar 31, 2021
101a85d
Update ssl_client.cpp (#4817)
everslick Mar 31, 2021
f6116ff
Merge branch 'v2-s2' of https://github.com/espressif/arduino-esp32 in…
me-no-dev Mar 31, 2021
e46b6b6
[2.0.0] Fix dropped SSL connection when buffer gets full. (#4821)
everslick Mar 31, 2021
3307e49
[2.0.0] Update release builder and package json (#4826)
me-no-dev Mar 31, 2021
5f2ec26
Add custom partition for ESP RainMaker (#4873)
sweetymhaiske Mar 31, 2021
247dba6
Added selective compilation for LITTLEFS and WiFiProv libraries. (#4877)
AronRubin Mar 31, 2021
acd715b
[2.0.0] Made selective compile of ArduinoOTA and LITTLEFS libraries a…
AronRubin Mar 31, 2021
2a3e084
Fixed missing conditional around BLE_SCHEME. (#4880)
AronRubin Mar 31, 2021
9495e33
SparkFun ESP32-S2 Thing Plus support (#4995)
lewispg228 Mar 31, 2021
59f0fb1
Fix RainMaker build
me-no-dev Apr 1, 2021
1fb9258
IDF master 1067b2870
me-no-dev Apr 1, 2021
23ed4dc
Update on-push.sh
me-no-dev Apr 1, 2021
7ac5cc3
Update PIO build scripts
me-no-dev Apr 1, 2021
e678c73
Update PIO Scripts
me-no-dev Apr 1, 2021
49328de
Fix PSRAM settings in boards.txt
me-no-dev Apr 1, 2021
47fb95e
Update build settings
me-no-dev Apr 1, 2021
68afc10
Update TinyUSB
me-no-dev Apr 2, 2021
8e7fbe2
Fix tinyusb init
me-no-dev Apr 2, 2021
f6fda74
IDF master 1cb31e509
me-no-dev Apr 2, 2021
0795bd7
Disable USB persist for now
me-no-dev Apr 2, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ set(includedirs
set(srcs ${CORE_SRCS} ${LIBRARY_SRCS} ${BLE_SRCS})
set(priv_includes cores/esp32/libb64)
set(requires spi_flash mbedtls mdns esp_adc_cal)
set(priv_requires fatfs nvs_flash app_update spiffs bootloader_support openssl bt tinyusb main)
set(priv_requires fatfs nvs_flash app_update spiffs bootloader_support openssl bt arduino_tinyusb main)

if(NOT CONFIG_ARDUINO_SELECTIVE_COMPILATION OR CONFIG_ARDUINO_SELECTIVE_ArduinoOTA)
list(APPEND priv_requires esp_https_ota)
Expand Down
8 changes: 2 additions & 6 deletions cores/esp32/USB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "esp32-hal.h"
#include "esp32-hal-tinyusb.h"
#include "USB.h"
#if CONFIG_USB_ENABLED
#if CONFIG_TINYUSB_ENABLED

#ifndef USB_VID
#define USB_VID USB_ESPRESSIF_VID
Expand All @@ -32,10 +32,6 @@
#define USB_SERIAL "0"
#endif

extern "C" {
#include "tinyusb.h"
}

#if CFG_TUD_DFU_RUNTIME
static uint16_t load_dfu_descriptor(uint8_t * dst, uint8_t * itf)
{
Expand Down Expand Up @@ -335,4 +331,4 @@ const char * ESPUSB::webUSBURL(void){

ESPUSB USB;

#endif /* CONFIG_USB_ENABLED */
#endif /* CONFIG_TINYUSB_ENABLED */
4 changes: 2 additions & 2 deletions cores/esp32/USB.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#pragma once

#include "sdkconfig.h"
#if CONFIG_USB_ENABLED
#if CONFIG_TINYUSB_ENABLED

#include "Arduino.h"
#include "USBCDC.h"
Expand Down Expand Up @@ -115,4 +115,4 @@ class ESPUSB {

extern ESPUSB USB;

#endif /* CONFIG_USB_ENABLED */
#endif /* CONFIG_TINYUSB_ENABLED */
14 changes: 5 additions & 9 deletions cores/esp32/USBCDC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,12 @@
#include "esp32-hal-tinyusb.h"
#include "USB.h"
#include "USBCDC.h"
#if CONFIG_USB_ENABLED
#if CONFIG_TINYUSB_ENABLED

ESP_EVENT_DEFINE_BASE(ARDUINO_USB_CDC_EVENTS);
esp_err_t arduino_usb_event_post(esp_event_base_t event_base, int32_t event_id, void *event_data, size_t event_data_size, TickType_t ticks_to_wait);
esp_err_t arduino_usb_event_handler_register_with(esp_event_base_t event_base, int32_t event_id, esp_event_handler_t event_handler, void *event_handler_arg);

extern "C" {
#include "tinyusb.h"
}

#if CFG_TUD_CDC
#define MAX_USB_CDC_DEVICES 2
USBCDC * devices[MAX_USB_CDC_DEVICES] = {NULL, NULL};
Expand Down Expand Up @@ -216,8 +212,8 @@ void USBCDC::_onLineCoding(uint32_t _bit_rate, uint8_t _stop_bits, uint8_t _pari
}

void USBCDC::_onRX(){
uint8_t buf[CONFIG_USB_CDC_RX_BUFSIZE+1];
uint32_t count = tud_cdc_n_read(itf, buf, CONFIG_USB_CDC_RX_BUFSIZE);
uint8_t buf[CONFIG_TINYUSB_CDC_RX_BUFSIZE+1];
uint32_t count = tud_cdc_n_read(itf, buf, CONFIG_TINYUSB_CDC_RX_BUFSIZE);
for(uint32_t i=0; i<count; i++){
if(rx_queue == NULL || !xQueueSend(rx_queue, buf+i, 0)){
return;
Expand Down Expand Up @@ -333,6 +329,6 @@ USBCDC::operator bool() const
USBCDC Serial(0);
#endif

#endif /* CONFIG_USB_CDC_ENABLED */
#endif /* CONFIG_TINYUSB_CDC_ENABLED */

#endif /* CONFIG_USB_ENABLED */
#endif /* CONFIG_TINYUSB_ENABLED */
4 changes: 2 additions & 2 deletions cores/esp32/USBCDC.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#include "Stream.h"
#include "esp32-hal.h"
#if CONFIG_USB_CDC_ENABLED
#if CONFIG_TINYUSB_CDC_ENABLED

#include "esp_event.h"

Expand Down Expand Up @@ -130,4 +130,4 @@ class USBCDC: public Stream
extern USBCDC Serial;
#endif

#endif /* CONFIG_USB_CDC_ENABLED */
#endif /* CONFIG_TINYUSB_CDC_ENABLED */
74 changes: 71 additions & 3 deletions cores/esp32/esp32-hal-tinyusb.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@

#include "sdkconfig.h"
#if CONFIG_USB_ENABLED
#if CONFIG_TINYUSB_ENABLED
#include <stdlib.h>
#include <stdbool.h>

#include "esp_log.h"

Expand All @@ -12,10 +13,14 @@
#include "soc/usb_reg.h"
#include "soc/usb_wrap_reg.h"
#include "soc/usb_wrap_struct.h"
#include "soc/usb_periph.h"
#include "soc/periph_defs.h"
#include "soc/timer_group_struct.h"
#include "soc/system_reg.h"

#include "hal/usb_hal.h"
#include "hal/gpio_ll.h"

#include "freertos/FreeRTOS.h"
#include "freertos/task.h"

Expand All @@ -24,15 +29,78 @@

#include "esp_efuse.h"
#include "esp_efuse_table.h"
#include "esp_rom_gpio.h"

#include "tinyusb.h"
#include "esp32-hal.h"

#include "esp32-hal-tinyusb.h"
#include "esp32s2/rom/usb/usb_persist.h"
#include "esp32s2/rom/usb/usb_dc.h"
#include "esp32s2/rom/usb/chip_usb_dw_wrapper.h"

typedef enum{
TINYUSB_USBDEV_0,
} tinyusb_usbdev_t;

typedef char *tusb_desc_strarray_device_t[USB_STRING_DESCRIPTOR_ARRAY_SIZE];

typedef struct {
bool external_phy;
} tinyusb_config_t;

static TaskHandle_t s_tusb_tskh;

static void configure_pins(usb_hal_context_t *usb)
{
for (const usb_iopin_dsc_t *iopin = usb_periph_iopins; iopin->pin != -1; ++iopin) {
if ((usb->use_external_phy) || (iopin->ext_phy_only == 0)) {
esp_rom_gpio_pad_select_gpio(iopin->pin);
if (iopin->is_output) {
esp_rom_gpio_connect_out_signal(iopin->pin, iopin->func, false, false);
} else {
esp_rom_gpio_connect_in_signal(iopin->pin, iopin->func, false);
if ((iopin->pin != GPIO_FUNC_IN_LOW) && (iopin->pin != GPIO_FUNC_IN_HIGH)) {
gpio_ll_input_enable(&GPIO, iopin->pin);
}
}
esp_rom_gpio_pad_unhold(iopin->pin);
}
}
if (!usb->use_external_phy) {
gpio_set_drive_capability(USBPHY_DM_NUM, GPIO_DRIVE_CAP_3);
gpio_set_drive_capability(USBPHY_DP_NUM, GPIO_DRIVE_CAP_3);
}
}

esp_err_t tinyusb_driver_install(const tinyusb_config_t *config)
{
int res;
log_i("Driver installation...");

// Hal init
usb_hal_context_t hal = {
.use_external_phy = config->external_phy
};
usb_hal_init(&hal);
configure_pins(&hal);

if (!tusb_init()) {
log_e("Can't initialize the TinyUSB stack.");
return ESP_FAIL;
}
log_i("Driver installed");
return ESP_OK;
}










typedef char tusb_str_t[127];

static bool WEBUSB_ENABLED = false;
Expand Down Expand Up @@ -694,4 +762,4 @@ void usb_dw_reg_dump(void)
}
}
*/
#endif /* CONFIG_USB_ENABLED */
#endif /* CONFIG_TINYUSB_ENABLED */
19 changes: 12 additions & 7 deletions cores/esp32/esp32-hal-tinyusb.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,18 @@
#include "esp32-hal.h"

#if CONFIG_IDF_TARGET_ESP32S2
#if CONFIG_USB_ENABLED
#if CONFIG_TINYUSB_ENABLED

#ifdef __cplusplus
extern "C" {
#endif

#include "tinyusb.h"
#include "tusb.h"
#include "tusb_option.h"
#include "tusb_config.h"

#define USB_ESPRESSIF_VID 0x303A
#define USB_STRING_DESCRIPTOR_ARRAY_SIZE 10

typedef struct {
uint16_t vid;
Expand All @@ -46,10 +51,10 @@ typedef struct {
#define TINYUSB_CONFIG_DEFAULT() { \
.vid = USB_ESPRESSIF_VID, \
.pid = 0x0002, \
.product_name = CONFIG_USB_DESC_PRODUCT_STRING, \
.manufacturer_name = CONFIG_USB_DESC_MANUFACTURER_STRING, \
.serial_number = CONFIG_USB_DESC_SERIAL_STRING, \
.fw_version = CONFIG_USB_DESC_BCDDEVICE, \
.product_name = CONFIG_TINYUSB_DESC_PRODUCT_STRING, \
.manufacturer_name = CONFIG_TINYUSB_DESC_MANUFACTURER_STRING, \
.serial_number = CONFIG_TINYUSB_DESC_SERIAL_STRING, \
.fw_version = CONFIG_TINYUSB_DESC_BCDDEVICE, \
.usb_version = 0x0200, \
.usb_class = TUSB_CLASS_MISC, \
.usb_subclass = MISC_SUBCLASS_COMMON, \
Expand Down Expand Up @@ -99,5 +104,5 @@ uint8_t tinyusb_get_free_out_endpoint(void);
}
#endif

#endif /* CONFIG_USB_ENABLED */
#endif /* CONFIG_TINYUSB_ENABLED */
#endif /* CONFIG_IDF_TARGET_ESP32S2 */
Loading