From 03db4b5ecfef40bc9666a665161a6f7b32bd9bbd Mon Sep 17 00:00:00 2001 From: me-no-dev Date: Fri, 30 Jun 2023 18:28:17 +0300 Subject: [PATCH 1/3] Initial support for ESP32H2 --- cores/esp32/Esp.cpp | 7 ++ cores/esp32/HardwareSerial.cpp | 8 +- cores/esp32/esp32-hal-adc.c | 4 +- cores/esp32/esp32-hal-cpu.c | 14 ++- cores/esp32/esp32-hal-i2c-slave.c | 4 +- cores/esp32/esp32-hal-matrix.c | 2 + cores/esp32/esp32-hal-misc.c | 4 +- cores/esp32/esp32-hal-spi.c | 171 ++++++++++++++---------------- cores/esp32/esp32-hal-spi.h | 2 +- cores/esp32/esp32-hal-uart.c | 6 +- idf_component.yml | 2 + libraries/SPI/src/SPI.cpp | 2 +- variants/esp32h2/pins_arduino.h | 39 +++++++ 13 files changed, 158 insertions(+), 107 deletions(-) create mode 100644 variants/esp32h2/pins_arduino.h diff --git a/cores/esp32/Esp.cpp b/cores/esp32/Esp.cpp index ae691d01fbd..0c22af75c25 100644 --- a/cores/esp32/Esp.cpp +++ b/cores/esp32/Esp.cpp @@ -54,6 +54,9 @@ extern "C" { #elif CONFIG_IDF_TARGET_ESP32C6 #include "esp32c6/rom/spi_flash.h" #define ESP_FLASH_IMAGE_BASE 0x0000 // Esp32c6 is located at 0x0000 +#elif CONFIG_IDF_TARGET_ESP32H2 +#include "esp32h2/rom/spi_flash.h" +#define ESP_FLASH_IMAGE_BASE 0x0000 // Esp32h2 is located at 0x0000 #else #error Target CONFIG_IDF_TARGET is not supported #endif @@ -363,8 +366,12 @@ FlashMode_t EspClass::getFlashChipMode(void) #if CONFIG_IDF_TARGET_ESP32S2 uint32_t spi_ctrl = REG_READ(PERIPHS_SPI_FLASH_CTRL); #else + #if CONFIG_IDF_TARGET_ESP32H2 + uint32_t spi_ctrl = REG_READ(DR_REG_SPI0_BASE + 0x8); + #else uint32_t spi_ctrl = REG_READ(SPI_CTRL_REG(0)); #endif + #endif /* Not all of the following constants are already defined in older versions of spi_reg.h, so do it manually for now*/ if (spi_ctrl & BIT(24)) { //SPI_FREAD_QIO return (FM_QIO); diff --git a/cores/esp32/HardwareSerial.cpp b/cores/esp32/HardwareSerial.cpp index 498983545ed..6cdc5c91ea2 100644 --- a/cores/esp32/HardwareSerial.cpp +++ b/cores/esp32/HardwareSerial.cpp @@ -28,7 +28,7 @@ #define SOC_RX0 44 #elif CONFIG_IDF_TARGET_ESP32C3 #define SOC_RX0 20 -#elif CONFIG_IDF_TARGET_ESP32C6 +#elif CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 #define SOC_RX0 17 #endif #endif @@ -40,7 +40,7 @@ #define SOC_TX0 43 #elif CONFIG_IDF_TARGET_ESP32C3 #define SOC_TX0 21 -#elif CONFIG_IDF_TARGET_ESP32C6 +#elif CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 #define SOC_TX0 16 #endif #endif @@ -59,7 +59,7 @@ void serialEvent(void) {} #define RX1 18 #elif CONFIG_IDF_TARGET_ESP32S3 #define RX1 15 -#elif CONFIG_IDF_TARGET_ESP32C6 +#elif CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 #define RX1 5 #endif #endif @@ -73,7 +73,7 @@ void serialEvent(void) {} #define TX1 19 #elif CONFIG_IDF_TARGET_ESP32S3 #define TX1 16 -#elif CONFIG_IDF_TARGET_ESP32C6 +#elif CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 #define TX1 4 #endif #endif diff --git a/cores/esp32/esp32-hal-adc.c b/cores/esp32/esp32-hal-adc.c index 608d35f477c..b53eb868d3d 100644 --- a/cores/esp32/esp32-hal-adc.c +++ b/cores/esp32/esp32-hal-adc.c @@ -91,7 +91,7 @@ esp_err_t __analogChannelConfig(adc_bitwidth_t width, adc_attenuation_t atten, i log_e("adc_cali_create_scheme_curve_fitting failed with error: %d", err); return err; } - #elif !defined(CONFIG_IDF_TARGET_ESP32C6) //ADC_CALI_SCHEME_LINE_FITTING_SUPPORTED + #elif !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32H2) //ADC_CALI_SCHEME_LINE_FITTING_SUPPORTED log_d("Deleting ADC_UNIT_%d line cali handle",adc_unit); err = adc_cali_delete_scheme_line_fitting(adc_cali_handle[adc_unit]); if(err != ESP_OK){ @@ -278,7 +278,7 @@ uint32_t __analogReadMilliVolts(uint8_t pin){ .bitwidth = __analogWidth, }; err = adc_cali_create_scheme_curve_fitting(&cali_config, &adc_cali_handle[adc_unit]); - #elif !defined(CONFIG_IDF_TARGET_ESP32C6) //ADC_CALI_SCHEME_LINE_FITTING_SUPPORTED + #elif !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32H2) //ADC_CALI_SCHEME_LINE_FITTING_SUPPORTED adc_cali_line_fitting_config_t cali_config = { .unit_id = adc_unit, .bitwidth = __analogWidth, diff --git a/cores/esp32/esp32-hal-cpu.c b/cores/esp32/esp32-hal-cpu.c index 9163bc36d6b..e1befa1fb33 100644 --- a/cores/esp32/esp32-hal-cpu.c +++ b/cores/esp32/esp32-hal-cpu.c @@ -19,7 +19,7 @@ #include "esp_attr.h" #include "esp_log.h" #include "soc/rtc.h" -#ifndef CONFIG_IDF_TARGET_ESP32C6 +#if !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32H2) #include "soc/rtc_cntl_reg.h" #include "soc/apb_ctrl_reg.h" #endif @@ -42,6 +42,8 @@ #include "esp32c3/rom/rtc.h" #elif CONFIG_IDF_TARGET_ESP32C6 #include "esp32c6/rom/rtc.h" +#elif CONFIG_IDF_TARGET_ESP32H2 +#include "esp32h2/rom/rtc.h" #else #error Target CONFIG_IDF_TARGET is not supported #endif @@ -151,7 +153,7 @@ bool removeApbChangeCallback(void * arg, apb_change_cb_t cb){ } static uint32_t calculateApb(rtc_cpu_freq_config_t * conf){ -#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32S3 +#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32H2 return APB_CLK_FREQ; #else if(conf->freq_mhz >= 80){ @@ -167,7 +169,9 @@ bool setCpuFrequencyMhz(uint32_t cpu_freq_mhz){ rtc_cpu_freq_config_t conf, cconf; uint32_t capb, apb; //Get XTAL Frequency and calculate min CPU MHz +#ifndef CONFIG_IDF_TARGET_ESP32H2 rtc_xtal_freq_t xtal = rtc_clk_xtal_freq_get(); +#endif #if CONFIG_IDF_TARGET_ESP32 if(xtal > RTC_XTAL_FREQ_AUTO){ if(xtal < RTC_XTAL_FREQ_40M) { @@ -181,6 +185,7 @@ bool setCpuFrequencyMhz(uint32_t cpu_freq_mhz){ } } #endif +#ifndef CONFIG_IDF_TARGET_ESP32H2 if(cpu_freq_mhz > xtal && cpu_freq_mhz != 240 && cpu_freq_mhz != 160 && cpu_freq_mhz != 80){ if(xtal >= RTC_XTAL_FREQ_40M){ log_e("Bad frequency: %u MHz! Options are: 240, 160, 80, %u, %u and %u MHz", cpu_freq_mhz, xtal, xtal/2, xtal/4); @@ -189,6 +194,7 @@ bool setCpuFrequencyMhz(uint32_t cpu_freq_mhz){ } return false; } +#endif #if CONFIG_IDF_TARGET_ESP32 //check if cpu supports the frequency if(cpu_freq_mhz == 240){ @@ -222,7 +228,7 @@ bool setCpuFrequencyMhz(uint32_t cpu_freq_mhz){ } //Make the frequency change rtc_clk_cpu_freq_set_config_fast(&conf); -#ifndef CONFIG_IDF_TARGET_ESP32C6 +#if !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32H2) if(capb != apb){ //Update REF_TICK (uncomment if REF_TICK is different than 1MHz) //if(conf.freq_mhz < 80){ @@ -235,7 +241,7 @@ bool setCpuFrequencyMhz(uint32_t cpu_freq_mhz){ } #endif //Update FreeRTOS Tick Divisor -#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 #elif CONFIG_IDF_TARGET_ESP32S3 diff --git a/cores/esp32/esp32-hal-i2c-slave.c b/cores/esp32/esp32-hal-i2c-slave.c index 595a8002d90..a3e863cf799 100644 --- a/cores/esp32/esp32-hal-i2c-slave.c +++ b/cores/esp32/esp32-hal-i2c-slave.c @@ -168,7 +168,7 @@ static inline void i2c_ll_stretch_clr(i2c_dev_t *hw) static inline bool i2c_ll_slave_addressed(i2c_dev_t *hw) { -#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32S3 +#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32H2 return hw->sr.slave_addressed; #else return hw->status_reg.slave_addressed; @@ -177,7 +177,7 @@ static inline bool i2c_ll_slave_addressed(i2c_dev_t *hw) static inline bool i2c_ll_slave_rw(i2c_dev_t *hw)//not exposed by hal_ll { -#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32S3 +#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32H2 return hw->sr.slave_rw; #else return hw->status_reg.slave_rw; diff --git a/cores/esp32/esp32-hal-matrix.c b/cores/esp32/esp32-hal-matrix.c index 0e0d71bdf89..234e2f22253 100644 --- a/cores/esp32/esp32-hal-matrix.c +++ b/cores/esp32/esp32-hal-matrix.c @@ -27,6 +27,8 @@ #include "esp32c3/rom/gpio.h" #elif CONFIG_IDF_TARGET_ESP32C6 #include "esp32c6/rom/gpio.h" +#elif CONFIG_IDF_TARGET_ESP32H2 +#include "esp32h2/rom/gpio.h" #else #error Target CONFIG_IDF_TARGET is not supported #endif diff --git a/cores/esp32/esp32-hal-misc.c b/cores/esp32/esp32-hal-misc.c index c81ae38b4e1..637879236db 100644 --- a/cores/esp32/esp32-hal-misc.c +++ b/cores/esp32/esp32-hal-misc.c @@ -29,7 +29,7 @@ #endif //CONFIG_BT_ENABLED #include #include "soc/rtc.h" -#ifndef CONFIG_IDF_TARGET_ESP32C6 +#if !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32H2) #include "soc/rtc_cntl_reg.h" #include "soc/apb_ctrl_reg.h" #endif @@ -49,6 +49,8 @@ #include "esp32c3/rom/rtc.h" #elif CONFIG_IDF_TARGET_ESP32C6 #include "esp32c6/rom/rtc.h" +#elif CONFIG_IDF_TARGET_ESP32H2 +#include "esp32h2/rom/rtc.h" #else #error Target CONFIG_IDF_TARGET is not supported diff --git a/cores/esp32/esp32-hal-spi.c b/cores/esp32/esp32-hal-spi.c index da2ca542d09..4a5515eaeb5 100644 --- a/cores/esp32/esp32-hal-spi.c +++ b/cores/esp32/esp32-hal-spi.c @@ -29,39 +29,32 @@ #include "esp32-hal-periman.h" #include "esp_system.h" +#include "esp_intr_alloc.h" -#ifdef ESP_IDF_VERSION_MAJOR // IDF 4+ #if CONFIG_IDF_TARGET_ESP32 // ESP32/PICO-D4 #include "soc/dport_reg.h" #include "esp32/rom/ets_sys.h" #include "esp32/rom/gpio.h" -#include "esp_intr_alloc.h" #elif CONFIG_IDF_TARGET_ESP32S2 #include "soc/dport_reg.h" #include "esp32s2/rom/ets_sys.h" #include "esp32s2/rom/gpio.h" -#include "esp_intr_alloc.h" #elif CONFIG_IDF_TARGET_ESP32S3 #include "soc/dport_reg.h" #include "esp32s3/rom/ets_sys.h" #include "esp32s3/rom/gpio.h" -#include "esp_intr_alloc.h" #elif CONFIG_IDF_TARGET_ESP32C3 #include "esp32c3/rom/ets_sys.h" #include "esp32c3/rom/gpio.h" -#include "esp_intr_alloc.h" #elif CONFIG_IDF_TARGET_ESP32C6 #include "esp32c6/rom/ets_sys.h" #include "esp32c6/rom/gpio.h" -#include "esp_intr_alloc.h" +#elif CONFIG_IDF_TARGET_ESP32H2 +#include "esp32h2/rom/ets_sys.h" +#include "esp32h2/rom/gpio.h" #else #error Target CONFIG_IDF_TARGET is not supported #endif -#else // ESP32 Before IDF 4.0 -#include "rom/ets_sys.h" -#include "rom/gpio.h" -#include "esp_intr.h" -#endif struct spi_struct_t { spi_dev_t * dev; @@ -100,7 +93,7 @@ struct spi_struct_t { #define SPI_FSPI_SS_IDX(n) ((n==0)?FSPICS0_OUT_IDX:((n==1)?FSPICS1_OUT_IDX:0)) #define SPI_SS_IDX(p, n) ((p==0)?SPI_FSPI_SS_IDX(n):((p==1)?SPI_HSPI_SS_IDX(n):0)) -#elif CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 +#elif CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 // ESP32C3 #define SPI_COUNT (1) @@ -140,7 +133,7 @@ static spi_t _spi_bus_array[] = { {(volatile spi_dev_t *)(DR_REG_SPI3_BASE), 1, -1, -1, -1, -1} #elif CONFIG_IDF_TARGET_ESP32C3 {(volatile spi_dev_t *)(DR_REG_SPI2_BASE), 0, -1, -1, -1, -1} -#elif CONFIG_IDF_TARGET_ESP32C6 +#elif CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 {(spi_dev_t *)(DR_REG_SPI2_BASE), 0, -1, -1, -1, -1} #else {(volatile spi_dev_t *)(DR_REG_SPI0_BASE), 0, -1, -1, -1, -1}, @@ -163,7 +156,7 @@ static spi_t _spi_bus_array[] = { {(volatile spi_dev_t *)(DR_REG_SPI3_BASE), NULL, 1, -1, -1, -1, -1} #elif CONFIG_IDF_TARGET_ESP32C3 {(volatile spi_dev_t *)(DR_REG_SPI2_BASE), NULL, 0, -1, -1, -1, -1} -#elif CONFIG_IDF_TARGET_ESP32C6 +#elif CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 {(spi_dev_t *)(DR_REG_SPI2_BASE), NULL, 0, -1, -1, -1, -1} #else {(volatile spi_dev_t *)(DR_REG_SPI0_BASE), NULL, 0, -1, -1, -1, -1}, @@ -340,7 +333,7 @@ void spiEnableSSPins(spi_t * spi, uint8_t cs_mask) return; } SPI_MUTEX_LOCK(); -#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->misc.val &= ~(cs_mask & SPI_CS_MASK_ALL); #else spi->dev->pin.val &= ~(cs_mask & SPI_CS_MASK_ALL); @@ -354,7 +347,7 @@ void spiDisableSSPins(spi_t * spi, uint8_t cs_mask) return; } SPI_MUTEX_LOCK(); -#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->misc.val |= (cs_mask & SPI_CS_MASK_ALL); #else spi->dev->pin.val |= (cs_mask & SPI_CS_MASK_ALL); @@ -390,7 +383,7 @@ void spiSSSet(spi_t * spi) return; } SPI_MUTEX_LOCK(); -#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->misc.cs_keep_active = 1; #else spi->dev->pin.cs_keep_active = 1; @@ -404,7 +397,7 @@ void spiSSClear(spi_t * spi) return; } SPI_MUTEX_LOCK(); -#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->misc.cs_keep_active = 0; #else spi->dev->pin.cs_keep_active = 0; @@ -435,7 +428,7 @@ uint8_t spiGetDataMode(spi_t * spi) if(!spi) { return 0; } -#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 bool idleEdge = spi->dev->misc.ck_idle_edge; #else bool idleEdge = spi->dev->pin.ck_idle_edge; @@ -461,7 +454,7 @@ void spiSetDataMode(spi_t * spi, uint8_t dataMode) SPI_MUTEX_LOCK(); switch (dataMode) { case SPI_MODE1: -#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->misc.ck_idle_edge = 0; #else spi->dev->pin.ck_idle_edge = 0; @@ -469,7 +462,7 @@ void spiSetDataMode(spi_t * spi, uint8_t dataMode) spi->dev->user.ck_out_edge = 1; break; case SPI_MODE2: -#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->misc.ck_idle_edge = 1; #else spi->dev->pin.ck_idle_edge = 1; @@ -477,7 +470,7 @@ void spiSetDataMode(spi_t * spi, uint8_t dataMode) spi->dev->user.ck_out_edge = 1; break; case SPI_MODE3: -#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->misc.ck_idle_edge = 1; #else spi->dev->pin.ck_idle_edge = 1; @@ -486,7 +479,7 @@ void spiSetDataMode(spi_t * spi, uint8_t dataMode) break; case SPI_MODE0: default: -#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->misc.ck_idle_edge = 0; #else spi->dev->pin.ck_idle_edge = 0; @@ -539,7 +532,7 @@ static void spiInitBus(spi_t * spi) spi->dev->slave.trans_done = 0; #endif spi->dev->slave.val = 0; -#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->misc.val = 0; #else spi->dev->pin.val = 0; @@ -620,18 +613,18 @@ spi_t * spiStartBus(uint8_t spi_num, uint32_t clockDiv, uint8_t dataMode, uint8_ DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_SPI01_CLK_EN); DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_SPI01_RST); } -#elif CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 +#elif CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 periph_ll_reset( PERIPH_SPI2_MODULE ); periph_ll_enable_clk_clear_rst( PERIPH_SPI2_MODULE ); #endif SPI_MUTEX_LOCK(); spiInitBus(spi); -#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->clk_gate.clk_en = 1; spi->dev->clk_gate.mst_clk_sel = 1; spi->dev->clk_gate.mst_clk_active = 1; -#if ! CONFIG_IDF_TARGET_ESP32C6 +#if !CONFIG_IDF_TARGET_ESP32C6 && !CONFIG_IDF_TARGET_ESP32H2 spi->dev->dma_conf.tx_seg_trans_clr_en = 1; spi->dev->dma_conf.rx_seg_trans_clr_en = 1; spi->dev->dma_conf.dma_seg_trans_en = 0; @@ -642,7 +635,7 @@ spi_t * spiStartBus(uint8_t spi_num, uint32_t clockDiv, uint8_t dataMode, uint8_ spi->dev->user.doutdin = 1; int i; for(i=0; i<16; i++) { - #if CONFIG_IDF_TARGET_ESP32C6 + #if CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->data_buf[i].val = 0x00000000; #else spi->dev->data_buf[i] = 0x00000000; @@ -670,7 +663,7 @@ void spiWaitReady(spi_t * spi) #if CONFIG_IDF_TARGET_ESP32S2 #define usr_mosi_dbitlen usr_mosi_bit_len #define usr_miso_dbitlen usr_miso_bit_len -#elif CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 +#elif CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 #define usr_mosi_dbitlen ms_data_bitlen #define usr_miso_dbitlen ms_data_bitlen #define mosi_dlen ms_dlen @@ -692,13 +685,13 @@ void spiWrite(spi_t * spi, const uint32_t *data, uint8_t len) spi->dev->miso_dlen.usr_miso_dbitlen = 0; #endif for(i=0; idev->data_buf[i].val = data[i]; #else spi->dev->data_buf[i] = data[i]; #endif } -#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->cmd.update = 1; while (spi->dev->cmd.update); #endif @@ -720,20 +713,20 @@ void spiTransfer(spi_t * spi, uint32_t *data, uint8_t len) spi->dev->mosi_dlen.usr_mosi_dbitlen = (len * 32) - 1; spi->dev->miso_dlen.usr_miso_dbitlen = (len * 32) - 1; for(i=0; idev->data_buf[i].val = data[i]; #else spi->dev->data_buf[i] = data[i]; #endif } -#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->cmd.update = 1; while (spi->dev->cmd.update); #endif spi->dev->cmd.usr = 1; while(spi->dev->cmd.usr); for(i=0; idev->data_buf[i].val; #else data[i] = spi->dev->data_buf[i]; @@ -752,13 +745,13 @@ void spiWriteByte(spi_t * spi, uint8_t data) #if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32 spi->dev->miso_dlen.usr_miso_dbitlen = 0; #endif -#if CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->data_buf[0].val = data; #else spi->dev->data_buf[0] = data; #endif -#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->cmd.update = 1; while (spi->dev->cmd.update); #endif @@ -775,18 +768,18 @@ uint8_t spiTransferByte(spi_t * spi, uint8_t data) SPI_MUTEX_LOCK(); spi->dev->mosi_dlen.usr_mosi_dbitlen = 7; spi->dev->miso_dlen.usr_miso_dbitlen = 7; -#if CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->data_buf[0].val = data; #else spi->dev->data_buf[0] = data; #endif -#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->cmd.update = 1; while (spi->dev->cmd.update); #endif spi->dev->cmd.usr = 1; while(spi->dev->cmd.usr); -#if CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 data = spi->dev->data_buf[0].val & 0xFF; #else data = spi->dev->data_buf[0] & 0xFF; @@ -818,12 +811,12 @@ void spiWriteWord(spi_t * spi, uint16_t data) #if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32 spi->dev->miso_dlen.usr_miso_dbitlen = 0; #endif -#if CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->data_buf[0].val = data; #else spi->dev->data_buf[0] = data; #endif -#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->cmd.update = 1; while (spi->dev->cmd.update); #endif @@ -843,18 +836,18 @@ uint16_t spiTransferWord(spi_t * spi, uint16_t data) SPI_MUTEX_LOCK(); spi->dev->mosi_dlen.usr_mosi_dbitlen = 15; spi->dev->miso_dlen.usr_miso_dbitlen = 15; -#if CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->data_buf[0].val = data; #else spi->dev->data_buf[0] = data; #endif -#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->cmd.update = 1; while (spi->dev->cmd.update); #endif spi->dev->cmd.usr = 1; while(spi->dev->cmd.usr); -#if CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 data = spi->dev->data_buf[0].val; #else data = spi->dev->data_buf[0]; @@ -879,12 +872,12 @@ void spiWriteLong(spi_t * spi, uint32_t data) #if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32 spi->dev->miso_dlen.usr_miso_dbitlen = 0; #endif -#if CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->data_buf[0].val = data; #else spi->dev->data_buf[0] = data; #endif -#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->cmd.update = 1; while (spi->dev->cmd.update); #endif @@ -904,18 +897,18 @@ uint32_t spiTransferLong(spi_t * spi, uint32_t data) SPI_MUTEX_LOCK(); spi->dev->mosi_dlen.usr_mosi_dbitlen = 31; spi->dev->miso_dlen.usr_miso_dbitlen = 31; -#if CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->data_buf[0].val = data; #else spi->dev->data_buf[0] = data; #endif -#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->cmd.update = 1; while (spi->dev->cmd.update); #endif spi->dev->cmd.usr = 1; while(spi->dev->cmd.usr); -#if CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 data = spi->dev->data_buf[0].val; #else data = spi->dev->data_buf[0]; @@ -953,14 +946,14 @@ static void __spiTransferBytes(spi_t * spi, const uint8_t * data, uint8_t * out, spi->dev->miso_dlen.usr_miso_dbitlen = ((bytes * 8) - 1); for(i=0; idev->data_buf[i].val = wordsBuf[i]; //copy buffer to spi fifo #else spi->dev->data_buf[i] = wordsBuf[i]; //copy buffer to spi fifo #endif } -#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->cmd.update = 1; while (spi->dev->cmd.update); #endif @@ -970,7 +963,7 @@ static void __spiTransferBytes(spi_t * spi, const uint8_t * data, uint8_t * out, if(out) { for(i=0; idev->data_buf[i].val;//copy spi fifo to buffer #else wordsBuf[i] = spi->dev->data_buf[i];//copy spi fifo to buffer @@ -1032,7 +1025,7 @@ void spiTransaction(spi_t * spi, uint32_t clockDiv, uint8_t dataMode, uint8_t bi spi->dev->clock.val = clockDiv; switch (dataMode) { case SPI_MODE1: -#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->misc.ck_idle_edge = 0; #else spi->dev->pin.ck_idle_edge = 0; @@ -1040,7 +1033,7 @@ void spiTransaction(spi_t * spi, uint32_t clockDiv, uint8_t dataMode, uint8_t bi spi->dev->user.ck_out_edge = 1; break; case SPI_MODE2: -#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->misc.ck_idle_edge = 1; #else spi->dev->pin.ck_idle_edge = 1; @@ -1048,7 +1041,7 @@ void spiTransaction(spi_t * spi, uint32_t clockDiv, uint8_t dataMode, uint8_t bi spi->dev->user.ck_out_edge = 1; break; case SPI_MODE3: -#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->misc.ck_idle_edge = 1; #else spi->dev->pin.ck_idle_edge = 1; @@ -1057,7 +1050,7 @@ void spiTransaction(spi_t * spi, uint32_t clockDiv, uint8_t dataMode, uint8_t bi break; case SPI_MODE0: default: -#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->misc.ck_idle_edge = 0; #else spi->dev->pin.ck_idle_edge = 0; @@ -1099,12 +1092,12 @@ void ARDUINO_ISR_ATTR spiWriteByteNL(spi_t * spi, uint8_t data) #if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32 spi->dev->miso_dlen.usr_miso_dbitlen = 0; #endif -#if CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->data_buf[0].val = data; #else spi->dev->data_buf[0] = data; #endif -#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->cmd.update = 1; while (spi->dev->cmd.update); #endif @@ -1119,18 +1112,18 @@ uint8_t spiTransferByteNL(spi_t * spi, uint8_t data) } spi->dev->mosi_dlen.usr_mosi_dbitlen = 7; spi->dev->miso_dlen.usr_miso_dbitlen = 7; -#if CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->data_buf[0].val = data; #else spi->dev->data_buf[0] = data; #endif -#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->cmd.update = 1; while (spi->dev->cmd.update); #endif spi->dev->cmd.usr = 1; while(spi->dev->cmd.usr); -#if CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 data = spi->dev->data_buf[0].val & 0xFF; #else data = spi->dev->data_buf[0] & 0xFF; @@ -1150,12 +1143,12 @@ void ARDUINO_ISR_ATTR spiWriteShortNL(spi_t * spi, uint16_t data) #if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32 spi->dev->miso_dlen.usr_miso_dbitlen = 0; #endif -#if CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->data_buf[0].val = data; #else spi->dev->data_buf[0] = data; #endif -#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->cmd.update = 1; while (spi->dev->cmd.update); #endif @@ -1173,18 +1166,18 @@ uint16_t spiTransferShortNL(spi_t * spi, uint16_t data) } spi->dev->mosi_dlen.usr_mosi_dbitlen = 15; spi->dev->miso_dlen.usr_miso_dbitlen = 15; -#if CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->data_buf[0].val = data; #else spi->dev->data_buf[0] = data; #endif -#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->cmd.update = 1; while (spi->dev->cmd.update); #endif spi->dev->cmd.usr = 1; while(spi->dev->cmd.usr); -#if CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 data = spi->dev->data_buf[0].val & 0xFFFF; #else data = spi->dev->data_buf[0] & 0xFFFF; @@ -1207,12 +1200,12 @@ void ARDUINO_ISR_ATTR spiWriteLongNL(spi_t * spi, uint32_t data) #if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32 spi->dev->miso_dlen.usr_miso_dbitlen = 0; #endif -#if CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->data_buf[0].val = data; #else spi->dev->data_buf[0] = data; #endif -#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->cmd.update = 1; while (spi->dev->cmd.update); #endif @@ -1230,18 +1223,18 @@ uint32_t spiTransferLongNL(spi_t * spi, uint32_t data) } spi->dev->mosi_dlen.usr_mosi_dbitlen = 31; spi->dev->miso_dlen.usr_miso_dbitlen = 31; -#if CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->data_buf[0].val = data; #else spi->dev->data_buf[0] = data; #endif -#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->cmd.update = 1; while (spi->dev->cmd.update); #endif spi->dev->cmd.usr = 1; while(spi->dev->cmd.usr); - #if CONFIG_IDF_TARGET_ESP32C6 + #if CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 data = spi->dev->data_buf[0].val; #else data = spi->dev->data_buf[0]; @@ -1272,13 +1265,13 @@ void spiWriteNL(spi_t * spi, const void * data_in, uint32_t len){ spi->dev->miso_dlen.usr_miso_dbitlen = 0; #endif for (size_t i=0; idev->data_buf[i].val = data[i]; #else spi->dev->data_buf[i] = data[i]; #endif } -#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->cmd.update = 1; while (spi->dev->cmd.update); #endif @@ -1311,7 +1304,7 @@ void spiTransferBytesNL(spi_t * spi, const void * data_in, uint8_t * data_out, u spi->dev->miso_dlen.usr_miso_dbitlen = (c_len*8)-1; if(data){ for (size_t i=0; idev->data_buf[i].val = data[i]; #else spi->dev->data_buf[i] = data[i]; @@ -1319,14 +1312,14 @@ void spiTransferBytesNL(spi_t * spi, const void * data_in, uint8_t * data_out, u } } else { for (size_t i=0; idev->data_buf[i].val = 0xFFFFFFFF; #else spi->dev->data_buf[i] = 0xFFFFFFFF; #endif } } -#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->cmd.update = 1; while (spi->dev->cmd.update); #endif @@ -1335,13 +1328,13 @@ void spiTransferBytesNL(spi_t * spi, const void * data_in, uint8_t * data_out, u if(result){ if(c_len & 3){ for (size_t i=0; i<(c_longs-1); i++) { - #if CONFIG_IDF_TARGET_ESP32C6 + #if CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 result[i] = spi->dev->data_buf[i].val; #else result[i] = spi->dev->data_buf[i]; #endif } - #if CONFIG_IDF_TARGET_ESP32C6 + #if CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 uint32_t last_data = spi->dev->data_buf[c_longs-1].val; #else uint32_t last_data = spi->dev->data_buf[c_longs-1]; @@ -1353,7 +1346,7 @@ void spiTransferBytesNL(spi_t * spi, const void * data_in, uint8_t * data_out, u } } else { for (size_t i=0; idev->data_buf[i].val; #else result[i] = spi->dev->data_buf[i]; @@ -1396,18 +1389,18 @@ void spiTransferBitsNL(spi_t * spi, uint32_t data, uint32_t * out, uint8_t bits) spi->dev->mosi_dlen.usr_mosi_dbitlen = (bits - 1); spi->dev->miso_dlen.usr_miso_dbitlen = (bits - 1); -#if CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->data_buf[0].val = data; #else spi->dev->data_buf[0] = data; #endif -#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->cmd.update = 1; while (spi->dev->cmd.update); #endif spi->dev->cmd.usr = 1; while(spi->dev->cmd.usr); - #if CONFIG_IDF_TARGET_ESP32C6 + #if CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 data = spi->dev->data_buf[0].val; #else data = spi->dev->data_buf[0]; @@ -1448,34 +1441,34 @@ void ARDUINO_ISR_ATTR spiWritePixelsNL(spi_t * spi, const void * data_in, uint32 if(msb){ if(l_bytes && i == (c_longs - 1)){ if(l_bytes == 2){ - #if CONFIG_IDF_TARGET_ESP32C6 + #if CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 MSB_16_SET(spi->dev->data_buf[i].val, data[i]); #else MSB_16_SET(spi->dev->data_buf[i], data[i]); #endif } else { - #if CONFIG_IDF_TARGET_ESP32C6 + #if CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->data_buf[i].val = data[i] & 0xFF; #else spi->dev->data_buf[i] = data[i] & 0xFF; #endif } } else { - #if CONFIG_IDF_TARGET_ESP32C6 + #if CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 MSB_PIX_SET(spi->dev->data_buf[i].val, data[i]); #else MSB_PIX_SET(spi->dev->data_buf[i], data[i]); #endif } } else { - #if CONFIG_IDF_TARGET_ESP32C6 + #if CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->data_buf[i].val = data[i]; #else spi->dev->data_buf[i] = data[i]; #endif } } -#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->cmd.update = 1; while (spi->dev->cmd.update); #endif @@ -1501,7 +1494,7 @@ typedef union { uint32_t clkcnt_l: 6; /*it must be equal to spi_clkcnt_N.*/ uint32_t clkcnt_h: 6; /*it must be floor((spi_clkcnt_N+1)/2-1).*/ uint32_t clkcnt_n: 6; /*it is the divider of spi_clk. So spi_clk frequency is system/(spi_clkdiv_pre+1)/(spi_clkcnt_N+1)*/ -#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 uint32_t clkdiv_pre: 4; /*it is pre-divider of spi_clk.*/ uint32_t reserved: 9; /*reserved*/ #else @@ -1548,7 +1541,7 @@ uint32_t spiFrequencyToClockDiv(uint32_t freq) while(calPreVari++ <= 1) { calPre = (((apb_freq / (reg.clkcnt_n + 1)) / freq) - 1) + calPreVari; -#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 if(calPre > 0xF) { reg.clkdiv_pre = 0xF; #else diff --git a/cores/esp32/esp32-hal-spi.h b/cores/esp32/esp32-hal-spi.h index 654ed6b8bdf..640501d6415 100644 --- a/cores/esp32/esp32-hal-spi.h +++ b/cores/esp32/esp32-hal-spi.h @@ -28,7 +28,7 @@ extern "C" { #define SPI_HAS_TRANSACTION -#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32S3 +#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 || CONFIG_IDF_TARGET_ESP32S3 #define FSPI 0 #define HSPI 1 #else diff --git a/cores/esp32/esp32-hal-uart.c b/cores/esp32/esp32-hal-uart.c index e23db130dd8..058742f3c12 100644 --- a/cores/esp32/esp32-hal-uart.c +++ b/cores/esp32/esp32-hal-uart.c @@ -364,7 +364,7 @@ void uartSetRxInvert(uart_t* uart, bool invert) { if (uart == NULL) return; -#if CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 // POTENTIAL ISSUE :: original code only set/reset rxd_inv bit // IDF or LL set/reset the whole inv_mask! // if (invert) @@ -771,7 +771,7 @@ void uartStartDetectBaudrate(uart_t *uart) { return; } -#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 // ESP32-C3 requires further testing // Baud rate detection returns wrong values @@ -842,7 +842,7 @@ uartDetectBaudrate(uart_t *uart) return default_rates[i]; #else -#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 log_e("ESP32-C3 baud rate detection is not supported."); #else log_e("ESP32-S3 baud rate detection is not supported."); diff --git a/idf_component.yml b/idf_component.yml index 536d5cf5148..5418fe0ab00 100644 --- a/idf_component.yml +++ b/idf_component.yml @@ -6,6 +6,7 @@ targets: - esp32s3 - esp32c3 - esp32c6 + - esp32h2 tags: - arduino files: @@ -16,6 +17,7 @@ files: - "variants/esp32s3/**/*" - "variants/esp32c3/**/*" - "variants/esp32c6/**/*" + - "variants/esp32h2/**/*" - "libraries/**/*" - "CMakeLists.txt" - "Kconfig.projbuild" diff --git a/libraries/SPI/src/SPI.cpp b/libraries/SPI/src/SPI.cpp index 6e2c024fdd6..dbea4f8e6e3 100644 --- a/libraries/SPI/src/SPI.cpp +++ b/libraries/SPI/src/SPI.cpp @@ -90,7 +90,7 @@ void SPIClass::begin(int8_t sck, int8_t miso, int8_t mosi, int8_t ss) _miso = (_spi_num == FSPI) ? MISO : -1; _mosi = (_spi_num == FSPI) ? MOSI : -1; _ss = (_spi_num == FSPI) ? SS : -1; -#elif CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 +#elif CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 _sck = SCK; _miso = MISO; _mosi = MOSI; diff --git a/variants/esp32h2/pins_arduino.h b/variants/esp32h2/pins_arduino.h new file mode 100644 index 00000000000..ab28240d4b4 --- /dev/null +++ b/variants/esp32h2/pins_arduino.h @@ -0,0 +1,39 @@ +#ifndef Pins_Arduino_h +#define Pins_Arduino_h + +#include +#include "soc/soc_caps.h" + +#define EXTERNAL_NUM_INTERRUPTS 22 +#define NUM_DIGITAL_PINS 22 +#define NUM_ANALOG_INPUTS 6 + +static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+8; +#define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN +#define RGB_BUILTIN LED_BUILTIN +#define RGB_BRIGHTNESS 64 + +#define analogInputToDigitalPin(p) (((p) Date: Sat, 1 Jul 2023 10:41:11 +0300 Subject: [PATCH 2/3] Additional changes for ESP32H2 --- .github/scripts/on-push.sh | 2 + .github/scripts/sketch_utils.sh | 4 + .github/workflows/hil.yml | 4 +- .github/workflows/lib.yml | 3 + boards.txt | 157 ++++++++++++++++++ cores/esp32/HardwareSerial.cpp | 14 +- .../examples/BasicOTA/.skip.esp32h2 | 0 .../examples/OTAWebUpdater/.skip.esp32h2 | 0 .../examples/AsyncUDPClient/.skip.esp32h2 | 0 .../AsyncUDPMulticastServer/.skip.esp32h2 | 0 .../examples/AsyncUDPServer/.skip.esp32h2 | 0 .../BLE_EddystoneTLM_Beacon/.skip.esp32h2 | 0 .../BLE_EddystoneURL_Beacon/.skip.esp32h2 | 0 .../examples/DiscoverConnect/.skip.esp32h2 | 0 .../examples/GetLocalMAC/.skip.esp32h2 | 0 .../examples/SerialToSerialBT/.skip.esp32h2 | 0 .../examples/SerialToSerialBTM/.skip.esp32h2 | 0 .../.skip.esp32h2 | 0 .../bt_classic_device_discovery/.skip.esp32h2 | 0 .../bt_remove_paired_devices/.skip.esp32h2 | 0 .../examples/CaptivePortal/.skip.esp32h2 | 0 .../Camera/CameraWebServer/.skip.esp32h2 | 0 .../DeepSleep/ExternalWakeUp/.skip.esp32h2 | 0 .../SmoothBlink_ULP_Code/.skip.esp32h2 | 0 .../DeepSleep/TimerWakeUp/.skip.esp32h2 | 0 .../DeepSleep/TouchWakeUp/.skip.esp32h2 | 0 .../ESPNow/ESPNow_Basic_Master/.skip.esp32h2 | 0 .../ESPNow/ESPNow_Basic_Slave/.skip.esp32h2 | 0 .../ESPNow_MultiSlave_Master/.skip.esp32h2 | 0 .../ESPNow_MultiSlave_Slave/.skip.esp32h2 | 0 .../examples/I2S/HiFreq_ADC/.skip.esp32h2 | 0 .../examples/RMT/RMTLoopback/RMTLoopback.ino | 2 +- .../examples/ResetReason/ResetReason.ino | 6 +- .../examples/Time/SimpleTime/.skip.esp32h2 | 0 .../examples/Touch/TouchButton/.skip.esp32h2 | 0 .../Touch/TouchButtonV2/.skip.esp32h2 | 0 .../Touch/TouchInterrupt/.skip.esp32h2 | 0 .../examples/Touch/TouchRead/.skip.esp32h2 | 0 .../examples/mDNS-SD_Extended/.skip.esp32h2 | 0 .../examples/mDNS_Web_Server/.skip.esp32h2 | 0 .../examples/ETH_LAN8720/.skip.esp32h2 | 0 .../examples/ETH_TLK110/.skip.esp32h2 | 0 .../FFat/examples/FFat_time/.skip.esp32h2 | 0 .../examples/Authorization/.skip.esp32h2 | 0 .../examples/BasicHttpClient/.skip.esp32h2 | 0 .../examples/BasicHttpsClient/.skip.esp32h2 | 0 .../HTTPClientEnterprise/.skip.esp32h2 | 0 .../examples/ReuseConnection/.skip.esp32h2 | 0 .../examples/StreamHttpClient/.skip.esp32h2 | 0 .../examples/httpUpdate/.skip.esp32h2 | 0 .../examples/httpUpdateSPIFFS/.skip.esp32h2 | 0 .../examples/httpUpdateSecure/.skip.esp32h2 | 0 .../examples/WebUpdater/.skip.esp32h2 | 0 .../I2S/examples/ADCPlotter/.skip.esp32h2 | 0 .../I2S/examples/FullDuplex/.skip.esp32h2 | 0 .../examples/InputSerialPlotter/.skip.esp32h2 | 0 .../I2S/examples/SimpleTone/.skip.esp32h2 | 0 .../DiagnosticsSmokeTest/.skip.esp32h2 | 0 .../examples/MinimalDiagnostics/.skip.esp32h2 | 0 .../examples/LITTLEFS_time/.skip.esp32h2 | 0 .../NetBIOS/examples/ESP_NBNST/.skip.esp32h2 | 0 .../examples/RMakerCustom/.skip.esp32h2 | 0 .../RMakerCustomAirCooler/.skip.esp32h2 | 0 .../examples/RMakerSonoffDualR3/.skip.esp32h2 | 0 .../examples/RMakerSwitch/.skip.esp32h2 | 0 libraries/SD/examples/SD_time/.skip.esp32h2 | 0 .../SD_MMC/examples/SDMMC_Test/.skip.esp32h2 | 0 .../SD_MMC/examples/SDMMC_time/.skip.esp32h2 | 0 .../examples/SPI_Multiple_Buses/.skip.esp32h2 | 0 .../SPIFFS/examples/SPIFFS_time/.skip.esp32h2 | 0 .../examples/CompositeDevice/.skip.esp32h2 | 0 .../examples/ConsumerControl/.skip.esp32h2 | 0 .../examples/CustomHIDDevice/.skip.esp32h2 | 0 .../USB/examples/FirmwareMSC/.skip.esp32h2 | 0 libraries/USB/examples/Gamepad/.skip.esp32h2 | 0 .../USB/examples/HIDVendor/.skip.esp32h2 | 0 .../Keyboard/KeyboardLogout/.skip.esp32h2 | 0 .../Keyboard/KeyboardMessage/.skip.esp32h2 | 0 .../Keyboard/KeyboardReprogram/.skip.esp32h2 | 0 .../Keyboard/KeyboardSerial/.skip.esp32h2 | 0 .../KeyboardAndMouseControl/.skip.esp32h2 | 0 .../Mouse/ButtonMouseControl/.skip.esp32h2 | 0 .../USB/examples/SystemControl/.skip.esp32h2 | 0 libraries/USB/examples/USBMSC/.skip.esp32h2 | 0 .../USB/examples/USBSerial/.skip.esp32h2 | 0 .../USB/examples/USBVendor/.skip.esp32h2 | 0 .../examples/AWS_S3_OTA_Update/.skip.esp32h2 | 0 .../examples/HTTPS_OTA_Update/.skip.esp32h2 | 0 .../examples/AdvancedWebServer/.skip.esp32h2 | 0 .../examples/FSBrowser/.skip.esp32h2 | 0 .../examples/HelloServer/.skip.esp32h2 | 0 .../examples/HttpAdvancedAuth/.skip.esp32h2 | 0 .../examples/HttpBasicAuth/.skip.esp32h2 | 0 .../examples/MultiHomedServers/.skip.esp32h2 | 0 .../examples/PathArgServer/.skip.esp32h2 | 0 .../examples/SDWebServer/.skip.esp32h2 | 0 .../SimpleAuthentification/.skip.esp32h2 | 0 .../examples/WebUpdate/.skip.esp32h2 | 0 .../examples/FTM/FTM_Initiator/.skip.esp32h2 | 0 .../examples/FTM/FTM_Responder/.skip.esp32h2 | 0 .../examples/SimpleWiFiServer/.skip.esp32h2 | 0 libraries/WiFi/examples/WPS/.skip.esp32h2 | 0 .../examples/WiFiAccessPoint/.skip.esp32h2 | 0 .../WiFiBlueToothSwitch/.skip.esp32h2 | 0 .../WiFi/examples/WiFiClient/.skip.esp32h2 | 0 .../examples/WiFiClientBasic/.skip.esp32h2 | 0 .../examples/WiFiClientConnect/.skip.esp32h2 | 0 .../WiFiClientEnterprise/.skip.esp32h2 | 0 .../examples/WiFiClientEvents/.skip.esp32h2 | 0 .../examples/WiFiClientStaticIP/.skip.esp32h2 | 0 .../WiFi/examples/WiFiIPv6/.skip.esp32h2 | 0 .../WiFi/examples/WiFiMulti/.skip.esp32h2 | 0 .../WiFi/examples/WiFiScan/.skip.esp32h2 | 0 .../WiFiScanDualAntenna/.skip.esp32h2 | 0 .../examples/WiFiSmartConfig/.skip.esp32h2 | 0 .../examples/WiFiTelnetToSerial/.skip.esp32h2 | 0 .../WiFi/examples/WiFiUDPClient/.skip.esp32h2 | 0 .../examples/WiFiClientInsecure/.skip.esp32h2 | 0 .../examples/WiFiClientPSK/.skip.esp32h2 | 0 .../examples/WiFiClientSecure/.skip.esp32h2 | 0 .../WiFiClientSecureEnterprise/.skip.esp32h2 | 0 .../.skip.esp32h2 | 0 .../WiFiProv/examples/WiFiProv/.skip.esp32h2 | 0 platform.txt | 7 +- 124 files changed, 190 insertions(+), 9 deletions(-) create mode 100644 libraries/ArduinoOTA/examples/BasicOTA/.skip.esp32h2 create mode 100644 libraries/ArduinoOTA/examples/OTAWebUpdater/.skip.esp32h2 create mode 100644 libraries/AsyncUDP/examples/AsyncUDPClient/.skip.esp32h2 create mode 100644 libraries/AsyncUDP/examples/AsyncUDPMulticastServer/.skip.esp32h2 create mode 100644 libraries/AsyncUDP/examples/AsyncUDPServer/.skip.esp32h2 create mode 100644 libraries/BLE/examples/BLE_EddystoneTLM_Beacon/.skip.esp32h2 create mode 100644 libraries/BLE/examples/BLE_EddystoneURL_Beacon/.skip.esp32h2 create mode 100644 libraries/BluetoothSerial/examples/DiscoverConnect/.skip.esp32h2 create mode 100644 libraries/BluetoothSerial/examples/GetLocalMAC/.skip.esp32h2 create mode 100644 libraries/BluetoothSerial/examples/SerialToSerialBT/.skip.esp32h2 create mode 100644 libraries/BluetoothSerial/examples/SerialToSerialBTM/.skip.esp32h2 create mode 100644 libraries/BluetoothSerial/examples/SerialToSerialBT_SSP_pairing/.skip.esp32h2 create mode 100644 libraries/BluetoothSerial/examples/bt_classic_device_discovery/.skip.esp32h2 create mode 100644 libraries/BluetoothSerial/examples/bt_remove_paired_devices/.skip.esp32h2 create mode 100644 libraries/DNSServer/examples/CaptivePortal/.skip.esp32h2 create mode 100644 libraries/ESP32/examples/Camera/CameraWebServer/.skip.esp32h2 create mode 100644 libraries/ESP32/examples/DeepSleep/ExternalWakeUp/.skip.esp32h2 create mode 100644 libraries/ESP32/examples/DeepSleep/SmoothBlink_ULP_Code/.skip.esp32h2 create mode 100644 libraries/ESP32/examples/DeepSleep/TimerWakeUp/.skip.esp32h2 create mode 100644 libraries/ESP32/examples/DeepSleep/TouchWakeUp/.skip.esp32h2 create mode 100644 libraries/ESP32/examples/ESPNow/ESPNow_Basic_Master/.skip.esp32h2 create mode 100644 libraries/ESP32/examples/ESPNow/ESPNow_Basic_Slave/.skip.esp32h2 create mode 100644 libraries/ESP32/examples/ESPNow/ESPNow_MultiSlave_Master/.skip.esp32h2 create mode 100644 libraries/ESP32/examples/ESPNow/ESPNow_MultiSlave_Slave/.skip.esp32h2 create mode 100644 libraries/ESP32/examples/I2S/HiFreq_ADC/.skip.esp32h2 create mode 100644 libraries/ESP32/examples/Time/SimpleTime/.skip.esp32h2 create mode 100644 libraries/ESP32/examples/Touch/TouchButton/.skip.esp32h2 create mode 100644 libraries/ESP32/examples/Touch/TouchButtonV2/.skip.esp32h2 create mode 100644 libraries/ESP32/examples/Touch/TouchInterrupt/.skip.esp32h2 create mode 100644 libraries/ESP32/examples/Touch/TouchRead/.skip.esp32h2 create mode 100644 libraries/ESPmDNS/examples/mDNS-SD_Extended/.skip.esp32h2 create mode 100644 libraries/ESPmDNS/examples/mDNS_Web_Server/.skip.esp32h2 create mode 100644 libraries/Ethernet/examples/ETH_LAN8720/.skip.esp32h2 create mode 100644 libraries/Ethernet/examples/ETH_TLK110/.skip.esp32h2 create mode 100644 libraries/FFat/examples/FFat_time/.skip.esp32h2 create mode 100644 libraries/HTTPClient/examples/Authorization/.skip.esp32h2 create mode 100644 libraries/HTTPClient/examples/BasicHttpClient/.skip.esp32h2 create mode 100644 libraries/HTTPClient/examples/BasicHttpsClient/.skip.esp32h2 create mode 100644 libraries/HTTPClient/examples/HTTPClientEnterprise/.skip.esp32h2 create mode 100644 libraries/HTTPClient/examples/ReuseConnection/.skip.esp32h2 create mode 100644 libraries/HTTPClient/examples/StreamHttpClient/.skip.esp32h2 create mode 100644 libraries/HTTPUpdate/examples/httpUpdate/.skip.esp32h2 create mode 100644 libraries/HTTPUpdate/examples/httpUpdateSPIFFS/.skip.esp32h2 create mode 100644 libraries/HTTPUpdate/examples/httpUpdateSecure/.skip.esp32h2 create mode 100644 libraries/HTTPUpdateServer/examples/WebUpdater/.skip.esp32h2 create mode 100644 libraries/I2S/examples/ADCPlotter/.skip.esp32h2 create mode 100644 libraries/I2S/examples/FullDuplex/.skip.esp32h2 create mode 100644 libraries/I2S/examples/InputSerialPlotter/.skip.esp32h2 create mode 100644 libraries/I2S/examples/SimpleTone/.skip.esp32h2 create mode 100644 libraries/Insights/examples/DiagnosticsSmokeTest/.skip.esp32h2 create mode 100644 libraries/Insights/examples/MinimalDiagnostics/.skip.esp32h2 create mode 100644 libraries/LittleFS/examples/LITTLEFS_time/.skip.esp32h2 create mode 100644 libraries/NetBIOS/examples/ESP_NBNST/.skip.esp32h2 create mode 100644 libraries/RainMaker/examples/RMakerCustom/.skip.esp32h2 create mode 100644 libraries/RainMaker/examples/RMakerCustomAirCooler/.skip.esp32h2 create mode 100644 libraries/RainMaker/examples/RMakerSonoffDualR3/.skip.esp32h2 create mode 100644 libraries/RainMaker/examples/RMakerSwitch/.skip.esp32h2 create mode 100644 libraries/SD/examples/SD_time/.skip.esp32h2 create mode 100644 libraries/SD_MMC/examples/SDMMC_Test/.skip.esp32h2 create mode 100644 libraries/SD_MMC/examples/SDMMC_time/.skip.esp32h2 create mode 100644 libraries/SPI/examples/SPI_Multiple_Buses/.skip.esp32h2 create mode 100644 libraries/SPIFFS/examples/SPIFFS_time/.skip.esp32h2 create mode 100644 libraries/USB/examples/CompositeDevice/.skip.esp32h2 create mode 100644 libraries/USB/examples/ConsumerControl/.skip.esp32h2 create mode 100644 libraries/USB/examples/CustomHIDDevice/.skip.esp32h2 create mode 100644 libraries/USB/examples/FirmwareMSC/.skip.esp32h2 create mode 100644 libraries/USB/examples/Gamepad/.skip.esp32h2 create mode 100644 libraries/USB/examples/HIDVendor/.skip.esp32h2 create mode 100644 libraries/USB/examples/Keyboard/KeyboardLogout/.skip.esp32h2 create mode 100644 libraries/USB/examples/Keyboard/KeyboardMessage/.skip.esp32h2 create mode 100644 libraries/USB/examples/Keyboard/KeyboardReprogram/.skip.esp32h2 create mode 100644 libraries/USB/examples/Keyboard/KeyboardSerial/.skip.esp32h2 create mode 100644 libraries/USB/examples/KeyboardAndMouseControl/.skip.esp32h2 create mode 100644 libraries/USB/examples/Mouse/ButtonMouseControl/.skip.esp32h2 create mode 100644 libraries/USB/examples/SystemControl/.skip.esp32h2 create mode 100644 libraries/USB/examples/USBMSC/.skip.esp32h2 create mode 100644 libraries/USB/examples/USBSerial/.skip.esp32h2 create mode 100644 libraries/USB/examples/USBVendor/.skip.esp32h2 create mode 100644 libraries/Update/examples/AWS_S3_OTA_Update/.skip.esp32h2 create mode 100644 libraries/Update/examples/HTTPS_OTA_Update/.skip.esp32h2 create mode 100644 libraries/WebServer/examples/AdvancedWebServer/.skip.esp32h2 create mode 100644 libraries/WebServer/examples/FSBrowser/.skip.esp32h2 create mode 100644 libraries/WebServer/examples/HelloServer/.skip.esp32h2 create mode 100644 libraries/WebServer/examples/HttpAdvancedAuth/.skip.esp32h2 create mode 100644 libraries/WebServer/examples/HttpBasicAuth/.skip.esp32h2 create mode 100644 libraries/WebServer/examples/MultiHomedServers/.skip.esp32h2 create mode 100644 libraries/WebServer/examples/PathArgServer/.skip.esp32h2 create mode 100644 libraries/WebServer/examples/SDWebServer/.skip.esp32h2 create mode 100644 libraries/WebServer/examples/SimpleAuthentification/.skip.esp32h2 create mode 100644 libraries/WebServer/examples/WebUpdate/.skip.esp32h2 create mode 100644 libraries/WiFi/examples/FTM/FTM_Initiator/.skip.esp32h2 create mode 100644 libraries/WiFi/examples/FTM/FTM_Responder/.skip.esp32h2 create mode 100644 libraries/WiFi/examples/SimpleWiFiServer/.skip.esp32h2 create mode 100644 libraries/WiFi/examples/WPS/.skip.esp32h2 create mode 100644 libraries/WiFi/examples/WiFiAccessPoint/.skip.esp32h2 create mode 100644 libraries/WiFi/examples/WiFiBlueToothSwitch/.skip.esp32h2 create mode 100644 libraries/WiFi/examples/WiFiClient/.skip.esp32h2 create mode 100644 libraries/WiFi/examples/WiFiClientBasic/.skip.esp32h2 create mode 100644 libraries/WiFi/examples/WiFiClientConnect/.skip.esp32h2 create mode 100644 libraries/WiFi/examples/WiFiClientEnterprise/.skip.esp32h2 create mode 100644 libraries/WiFi/examples/WiFiClientEvents/.skip.esp32h2 create mode 100644 libraries/WiFi/examples/WiFiClientStaticIP/.skip.esp32h2 create mode 100644 libraries/WiFi/examples/WiFiIPv6/.skip.esp32h2 create mode 100644 libraries/WiFi/examples/WiFiMulti/.skip.esp32h2 create mode 100644 libraries/WiFi/examples/WiFiScan/.skip.esp32h2 create mode 100644 libraries/WiFi/examples/WiFiScanDualAntenna/.skip.esp32h2 create mode 100644 libraries/WiFi/examples/WiFiSmartConfig/.skip.esp32h2 create mode 100644 libraries/WiFi/examples/WiFiTelnetToSerial/.skip.esp32h2 create mode 100644 libraries/WiFi/examples/WiFiUDPClient/.skip.esp32h2 create mode 100644 libraries/WiFiClientSecure/examples/WiFiClientInsecure/.skip.esp32h2 create mode 100644 libraries/WiFiClientSecure/examples/WiFiClientPSK/.skip.esp32h2 create mode 100644 libraries/WiFiClientSecure/examples/WiFiClientSecure/.skip.esp32h2 create mode 100644 libraries/WiFiClientSecure/examples/WiFiClientSecureEnterprise/.skip.esp32h2 create mode 100644 libraries/WiFiClientSecure/examples/WiFiClientShowPeerCredentials/.skip.esp32h2 create mode 100644 libraries/WiFiProv/examples/WiFiProv/.skip.esp32h2 diff --git a/.github/scripts/on-push.sh b/.github/scripts/on-push.sh index b7ef92d0c86..4227e920d21 100755 --- a/.github/scripts/on-push.sh +++ b/.github/scripts/on-push.sh @@ -69,6 +69,7 @@ if [ "$BUILD_PIO" -eq 0 ]; then FQBN_ESP32S3="espressif:esp32:esp32s3:PSRAM=opi,USBMode=default,PartitionScheme=huge_app" FQBN_ESP32C3="espressif:esp32:esp32c3:PartitionScheme=huge_app" FQBN_ESP32C6="espressif:esp32:esp32c6:PartitionScheme=huge_app" + FQBN_ESP32H2="espressif:esp32:esp32h2:PartitionScheme=huge_app" SKETCHES_ESP32="\ $ARDUINO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino\ @@ -87,6 +88,7 @@ if [ "$BUILD_PIO" -eq 0 ]; then build "esp32s2" $FQBN_ESP32S2 $CHUNK_INDEX $CHUNKS_CNT $SKETCHES_ESP32XX build "esp32c3" $FQBN_ESP32C3 $CHUNK_INDEX $CHUNKS_CNT $SKETCHES_ESP32XX build "esp32c6" $FQBN_ESP32C6 $CHUNK_INDEX $CHUNKS_CNT $SKETCHES_ESP32XX + build "esp32h2" $FQBN_ESP32H2 $CHUNK_INDEX $CHUNKS_CNT $SKETCHES_ESP32XX build "esp32" $FQBN_ESP32 $CHUNK_INDEX $CHUNKS_CNT $SKETCHES_ESP32 else source ${SCRIPTS_DIR}/install-platformio-esp32.sh diff --git a/.github/scripts/sketch_utils.sh b/.github/scripts/sketch_utils.sh index 97a402a562b..42b3669bb8b 100755 --- a/.github/scripts/sketch_utils.sh +++ b/.github/scripts/sketch_utils.sh @@ -75,6 +75,7 @@ function build_sketch(){ # build_sketch [ex esp32s3_opts="PSRAM=opi,USBMode=default,PartitionScheme=huge_app" esp32c3_opts="PartitionScheme=huge_app" esp32c6_opts="PartitionScheme=huge_app" + esp32h2_opts="PartitionScheme=huge_app" # Select the common part of the FQBN based on the target. The rest will be # appended depending on the passed options. @@ -95,6 +96,9 @@ function build_sketch(){ # build_sketch [ex "esp32c6") fqbn="espressif:esp32:esp32c6:${options:-$esp32c6_opts}" ;; + "esp32h2") + fqbn="espressif:esp32:esp32h2:${options:-$esp32h2_opts}" + ;; esac # Make it look like a JSON array. diff --git a/.github/workflows/hil.yml b/.github/workflows/hil.yml index 89115db07df..8823f9b5376 100644 --- a/.github/workflows/hil.yml +++ b/.github/workflows/hil.yml @@ -47,7 +47,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - chip: ['esp32', 'esp32s2', 'esp32s3', 'esp32c3', 'esp32c6'] + chip: ['esp32', 'esp32s2', 'esp32s3', 'esp32c3', 'esp32c6', 'esp32h2'] chunks: ${{fromJson(needs.gen_chunks.outputs.chunks)}} steps: - name: Checkout Repository @@ -76,7 +76,7 @@ jobs: strategy: fail-fast: false matrix: - chip: ['esp32', 'esp32s2', 'esp32s3', 'esp32c3', 'esp32c6'] + chip: ['esp32', 'esp32s2', 'esp32s3', 'esp32c3', 'esp32c6', 'esp32h2'] chunks: ${{fromJson(needs.gen_chunks.outputs.chunks)}} container: image: python:3.10.1-bullseye diff --git a/.github/workflows/lib.yml b/.github/workflows/lib.yml index 3d52fd63f97..5e44e705e29 100644 --- a/.github/workflows/lib.yml +++ b/.github/workflows/lib.yml @@ -37,6 +37,7 @@ jobs: - esp32c3 - esp32s3 - esp32c6 + - esp32h2 include: - target: esp32 @@ -49,6 +50,8 @@ jobs: fqbn: espressif:esp32:esp32s3 - target: esp32c6 fqbn: espressif:esp32:esp32c6 + - target: esp32h2 + fqbn: espressif:esp32:esp32h2 steps: diff --git a/boards.txt b/boards.txt index df2827b0343..3d2336a50c8 100644 --- a/boards.txt +++ b/boards.txt @@ -29,6 +29,163 @@ menu.LORAWAN_PREAMBLE_LENGTH=LoRaWan Preamble Length ### DO NOT PUT BOARDS ABOVE THE OFFICIAL ESPRESSIF BOARDS! ### ############################################################## +esp32h2.name=ESP32H2 Dev Module +esp32h2.vid.0=0x303a +esp32h2.pid.0=0x1001 + +esp32h2.bootloader.tool=esptool_py +esp32h2.bootloader.tool.default=esptool_py + +esp32h2.upload.tool=esptool_py +esp32h2.upload.tool.default=esptool_py +esp32h2.upload.tool.network=esp_ota + +esp32h2.upload.maximum_size=1310720 +esp32h2.upload.maximum_data_size=327680 +esp32h2.upload.flags= +esp32h2.upload.extra_flags= +esp32h2.upload.use_1200bps_touch=false +esp32h2.upload.wait_for_upload_port=false + +esp32h2.serial.disableDTR=false +esp32h2.serial.disableRTS=false + +esp32h2.build.tarch=riscv32 +esp32h2.build.target=esp +esp32h2.build.mcu=esp32h2 +esp32h2.build.core=esp32 +esp32h2.build.variant=esp32h2 +esp32h2.build.board=ESP32H2_DEV +esp32h2.build.bootloader_addr=0x0 + +esp32h2.build.cdc_on_boot=0 +esp32h2.build.f_cpu=96000000L +esp32h2.build.flash_size=4MB +esp32h2.build.flash_freq=64m +esp32h2.build.img_freq=48m +esp32h2.build.flash_mode=qio +esp32h2.build.boot=qio +esp32h2.build.partitions=default +esp32h2.build.defines= + +## IDE 2.0 Seems to not update the value +esp32h2.menu.JTAGAdapter.default=Disabled +esp32h2.menu.JTAGAdapter.default.build.copy_jtag_files=0 +esp32h2.menu.JTAGAdapter.builtin=Integrated USB JTAG +esp32h2.menu.JTAGAdapter.builtin.build.openocdscript=esp32h2-builtin.cfg +esp32h2.menu.JTAGAdapter.builtin.build.copy_jtag_files=1 +esp32h2.menu.JTAGAdapter.external=FTDI Adapter +esp32h2.menu.JTAGAdapter.external.build.openocdscript=esp32h2-ftdi.cfg +esp32h2.menu.JTAGAdapter.external.build.copy_jtag_files=1 +esp32h2.menu.JTAGAdapter.bridge=ESP USB Bridge +esp32h2.menu.JTAGAdapter.bridge.build.openocdscript=esp32h2-bridge.cfg +esp32h2.menu.JTAGAdapter.bridge.build.copy_jtag_files=1 + +esp32h2.menu.CDCOnBoot.default=Disabled +esp32h2.menu.CDCOnBoot.default.build.cdc_on_boot=0 +esp32h2.menu.CDCOnBoot.cdc=Enabled +esp32h2.menu.CDCOnBoot.cdc.build.cdc_on_boot=1 + +esp32h2.menu.PartitionScheme.default=Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS) +esp32h2.menu.PartitionScheme.default.build.partitions=default +esp32h2.menu.PartitionScheme.defaultffat=Default 4MB with ffat (1.2MB APP/1.5MB FATFS) +esp32h2.menu.PartitionScheme.defaultffat.build.partitions=default_ffat +esp32h2.menu.PartitionScheme.default_8MB=8M with spiffs (3MB APP/1.5MB SPIFFS) +esp32h2.menu.PartitionScheme.default_8MB.build.partitions=default_8MB +esp32h2.menu.PartitionScheme.default_8MB.upload.maximum_size=3342336 +esp32h2.menu.PartitionScheme.minimal=Minimal (1.3MB APP/700KB SPIFFS) +esp32h2.menu.PartitionScheme.minimal.build.partitions=minimal +esp32h2.menu.PartitionScheme.no_ota=No OTA (2MB APP/2MB SPIFFS) +esp32h2.menu.PartitionScheme.no_ota.build.partitions=no_ota +esp32h2.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 +esp32h2.menu.PartitionScheme.noota_3g=No OTA (1MB APP/3MB SPIFFS) +esp32h2.menu.PartitionScheme.noota_3g.build.partitions=noota_3g +esp32h2.menu.PartitionScheme.noota_3g.upload.maximum_size=1048576 +esp32h2.menu.PartitionScheme.noota_ffat=No OTA (2MB APP/2MB FATFS) +esp32h2.menu.PartitionScheme.noota_ffat.build.partitions=noota_ffat +esp32h2.menu.PartitionScheme.noota_ffat.upload.maximum_size=2097152 +esp32h2.menu.PartitionScheme.noota_3gffat=No OTA (1MB APP/3MB FATFS) +esp32h2.menu.PartitionScheme.noota_3gffat.build.partitions=noota_3gffat +esp32h2.menu.PartitionScheme.noota_3gffat.upload.maximum_size=1048576 +esp32h2.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA/1MB SPIFFS) +esp32h2.menu.PartitionScheme.huge_app.build.partitions=huge_app +esp32h2.menu.PartitionScheme.huge_app.upload.maximum_size=3145728 +esp32h2.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS) +esp32h2.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs +esp32h2.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 +esp32h2.menu.PartitionScheme.fatflash=16M Flash (2MB APP/12.5MB FATFS) +esp32h2.menu.PartitionScheme.fatflash.build.partitions=ffat +esp32h2.menu.PartitionScheme.fatflash.upload.maximum_size=2097152 +esp32h2.menu.PartitionScheme.app3M_fat9M_16MB=16M Flash (3MB APP/9.9MB FATFS) +esp32h2.menu.PartitionScheme.app3M_fat9M_16MB.build.partitions=app3M_fat9M_16MB +esp32h2.menu.PartitionScheme.app3M_fat9M_16MB.upload.maximum_size=3145728 +esp32h2.menu.PartitionScheme.rainmaker=RainMaker +esp32h2.menu.PartitionScheme.rainmaker.build.partitions=rainmaker +esp32h2.menu.PartitionScheme.rainmaker.upload.maximum_size=3145728 + +esp32h2.menu.FlashMode.qio=QIO +esp32h2.menu.FlashMode.qio.build.flash_mode=dio +esp32h2.menu.FlashMode.qio.build.boot=qio +esp32h2.menu.FlashMode.dio=DIO +esp32h2.menu.FlashMode.dio.build.flash_mode=dio +esp32h2.menu.FlashMode.dio.build.boot=dio + +esp32h2.menu.FlashFreq.64=64MHz +esp32h2.menu.FlashFreq.64.build.flash_freq=64m +esp32h2.menu.FlashFreq.64.build.img_freq=48m +#esp32h2.menu.FlashFreq.32=32MHz +#esp32h2.menu.FlashFreq.32.build.flash_freq=32m +#esp32h2.menu.FlashFreq.32.build.img_freq=24m +esp32h2.menu.FlashFreq.16=16MHz +esp32h2.menu.FlashFreq.16.build.flash_freq=16m +esp32h2.menu.FlashFreq.16.build.img_freq=12m + +esp32h2.menu.FlashSize.4M=4MB (32Mb) +esp32h2.menu.FlashSize.4M.build.flash_size=4MB +esp32h2.menu.FlashSize.8M=8MB (64Mb) +esp32h2.menu.FlashSize.8M.build.flash_size=8MB +esp32h2.menu.FlashSize.8M.build.partitions=default_8MB +esp32h2.menu.FlashSize.2M=2MB (16Mb) +esp32h2.menu.FlashSize.2M.build.flash_size=2MB +esp32h2.menu.FlashSize.2M.build.partitions=minimal +esp32h2.menu.FlashSize.16M=16MB (128Mb) +esp32h2.menu.FlashSize.16M.build.flash_size=16MB + +esp32h2.menu.UploadSpeed.921600=921600 +esp32h2.menu.UploadSpeed.921600.upload.speed=921600 +esp32h2.menu.UploadSpeed.115200=115200 +esp32h2.menu.UploadSpeed.115200.upload.speed=115200 +esp32h2.menu.UploadSpeed.256000.windows=256000 +esp32h2.menu.UploadSpeed.256000.upload.speed=256000 +esp32h2.menu.UploadSpeed.230400.windows.upload.speed=256000 +esp32h2.menu.UploadSpeed.230400=230400 +esp32h2.menu.UploadSpeed.230400.upload.speed=230400 +esp32h2.menu.UploadSpeed.460800.linux=460800 +esp32h2.menu.UploadSpeed.460800.macosx=460800 +esp32h2.menu.UploadSpeed.460800.upload.speed=460800 +esp32h2.menu.UploadSpeed.512000.windows=512000 +esp32h2.menu.UploadSpeed.512000.upload.speed=512000 + +esp32h2.menu.DebugLevel.none=None +esp32h2.menu.DebugLevel.none.build.code_debug=0 +esp32h2.menu.DebugLevel.error=Error +esp32h2.menu.DebugLevel.error.build.code_debug=1 +esp32h2.menu.DebugLevel.warn=Warn +esp32h2.menu.DebugLevel.warn.build.code_debug=2 +esp32h2.menu.DebugLevel.info=Info +esp32h2.menu.DebugLevel.info.build.code_debug=3 +esp32h2.menu.DebugLevel.debug=Debug +esp32h2.menu.DebugLevel.debug.build.code_debug=4 +esp32h2.menu.DebugLevel.verbose=Verbose +esp32h2.menu.DebugLevel.verbose.build.code_debug=5 + +esp32h2.menu.EraseFlash.none=Disabled +esp32h2.menu.EraseFlash.none.upload.erase_cmd= +esp32h2.menu.EraseFlash.all=Enabled +esp32h2.menu.EraseFlash.all.upload.erase_cmd=-e + +############################################################## + esp32c6.name=ESP32C6 Dev Module esp32c6.vid.0=0x303a esp32c6.pid.0=0x1001 diff --git a/cores/esp32/HardwareSerial.cpp b/cores/esp32/HardwareSerial.cpp index 6cdc5c91ea2..531dfd28a54 100644 --- a/cores/esp32/HardwareSerial.cpp +++ b/cores/esp32/HardwareSerial.cpp @@ -28,8 +28,10 @@ #define SOC_RX0 44 #elif CONFIG_IDF_TARGET_ESP32C3 #define SOC_RX0 20 -#elif CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 +#elif CONFIG_IDF_TARGET_ESP32C6 #define SOC_RX0 17 +#elif CONFIG_IDF_TARGET_ESP32H2 +#define SOC_RX0 23 #endif #endif @@ -40,8 +42,10 @@ #define SOC_TX0 43 #elif CONFIG_IDF_TARGET_ESP32C3 #define SOC_TX0 21 -#elif CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 +#elif CONFIG_IDF_TARGET_ESP32C6 #define SOC_TX0 16 +#elif CONFIG_IDF_TARGET_ESP32H2 +#define SOC_TX0 24 #endif #endif @@ -59,8 +63,10 @@ void serialEvent(void) {} #define RX1 18 #elif CONFIG_IDF_TARGET_ESP32S3 #define RX1 15 -#elif CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 +#elif CONFIG_IDF_TARGET_ESP32C6 #define RX1 5 +#elif CONFIG_IDF_TARGET_ESP32H2 +#define RX1 0 #endif #endif @@ -75,6 +81,8 @@ void serialEvent(void) {} #define TX1 16 #elif CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 #define TX1 4 +#elif CONFIG_IDF_TARGET_ESP32H2 +#define TX1 1 #endif #endif diff --git a/libraries/ArduinoOTA/examples/BasicOTA/.skip.esp32h2 b/libraries/ArduinoOTA/examples/BasicOTA/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/ArduinoOTA/examples/OTAWebUpdater/.skip.esp32h2 b/libraries/ArduinoOTA/examples/OTAWebUpdater/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/AsyncUDP/examples/AsyncUDPClient/.skip.esp32h2 b/libraries/AsyncUDP/examples/AsyncUDPClient/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/AsyncUDP/examples/AsyncUDPMulticastServer/.skip.esp32h2 b/libraries/AsyncUDP/examples/AsyncUDPMulticastServer/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/AsyncUDP/examples/AsyncUDPServer/.skip.esp32h2 b/libraries/AsyncUDP/examples/AsyncUDPServer/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/BLE/examples/BLE_EddystoneTLM_Beacon/.skip.esp32h2 b/libraries/BLE/examples/BLE_EddystoneTLM_Beacon/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/BLE/examples/BLE_EddystoneURL_Beacon/.skip.esp32h2 b/libraries/BLE/examples/BLE_EddystoneURL_Beacon/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/BluetoothSerial/examples/DiscoverConnect/.skip.esp32h2 b/libraries/BluetoothSerial/examples/DiscoverConnect/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/BluetoothSerial/examples/GetLocalMAC/.skip.esp32h2 b/libraries/BluetoothSerial/examples/GetLocalMAC/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/BluetoothSerial/examples/SerialToSerialBT/.skip.esp32h2 b/libraries/BluetoothSerial/examples/SerialToSerialBT/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/BluetoothSerial/examples/SerialToSerialBTM/.skip.esp32h2 b/libraries/BluetoothSerial/examples/SerialToSerialBTM/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/BluetoothSerial/examples/SerialToSerialBT_SSP_pairing/.skip.esp32h2 b/libraries/BluetoothSerial/examples/SerialToSerialBT_SSP_pairing/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/BluetoothSerial/examples/bt_classic_device_discovery/.skip.esp32h2 b/libraries/BluetoothSerial/examples/bt_classic_device_discovery/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/BluetoothSerial/examples/bt_remove_paired_devices/.skip.esp32h2 b/libraries/BluetoothSerial/examples/bt_remove_paired_devices/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/DNSServer/examples/CaptivePortal/.skip.esp32h2 b/libraries/DNSServer/examples/CaptivePortal/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/ESP32/examples/Camera/CameraWebServer/.skip.esp32h2 b/libraries/ESP32/examples/Camera/CameraWebServer/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/ESP32/examples/DeepSleep/ExternalWakeUp/.skip.esp32h2 b/libraries/ESP32/examples/DeepSleep/ExternalWakeUp/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/ESP32/examples/DeepSleep/SmoothBlink_ULP_Code/.skip.esp32h2 b/libraries/ESP32/examples/DeepSleep/SmoothBlink_ULP_Code/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/ESP32/examples/DeepSleep/TimerWakeUp/.skip.esp32h2 b/libraries/ESP32/examples/DeepSleep/TimerWakeUp/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/ESP32/examples/DeepSleep/TouchWakeUp/.skip.esp32h2 b/libraries/ESP32/examples/DeepSleep/TouchWakeUp/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/ESP32/examples/ESPNow/ESPNow_Basic_Master/.skip.esp32h2 b/libraries/ESP32/examples/ESPNow/ESPNow_Basic_Master/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/ESP32/examples/ESPNow/ESPNow_Basic_Slave/.skip.esp32h2 b/libraries/ESP32/examples/ESPNow/ESPNow_Basic_Slave/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/ESP32/examples/ESPNow/ESPNow_MultiSlave_Master/.skip.esp32h2 b/libraries/ESP32/examples/ESPNow/ESPNow_MultiSlave_Master/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/ESP32/examples/ESPNow/ESPNow_MultiSlave_Slave/.skip.esp32h2 b/libraries/ESP32/examples/ESPNow/ESPNow_MultiSlave_Slave/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/ESP32/examples/I2S/HiFreq_ADC/.skip.esp32h2 b/libraries/ESP32/examples/I2S/HiFreq_ADC/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/ESP32/examples/RMT/RMTLoopback/RMTLoopback.ino b/libraries/ESP32/examples/RMT/RMTLoopback/RMTLoopback.ino index 7a37c78b196..e77a9dddabc 100644 --- a/libraries/ESP32/examples/RMT/RMTLoopback/RMTLoopback.ino +++ b/libraries/ESP32/examples/RMT/RMTLoopback/RMTLoopback.ino @@ -21,7 +21,7 @@ * */ -#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 // ESP32 C3 has only 2 channels for RX and 2 for TX, thus MAX RMT_MEM is 128 #define RMT_TX_PIN 4 #define RMT_RX_PIN 5 diff --git a/libraries/ESP32/examples/ResetReason/ResetReason.ino b/libraries/ESP32/examples/ResetReason/ResetReason.ino index 8fd227ad873..4c3243de84a 100644 --- a/libraries/ESP32/examples/ResetReason/ResetReason.ino +++ b/libraries/ESP32/examples/ResetReason/ResetReason.ino @@ -22,6 +22,8 @@ #include "esp32s3/rom/rtc.h" #elif CONFIG_IDF_TARGET_ESP32C6 #include "esp32c6/rom/rtc.h" +#elif CONFIG_IDF_TARGET_ESP32H2 +#include "esp32h2/rom/rtc.h" #else #error Target CONFIG_IDF_TARGET is not supported #endif @@ -87,15 +89,17 @@ void setup() { print_reset_reason(rtc_get_reset_reason(1)); verbose_print_reset_reason(rtc_get_reset_reason(1)); +#ifndef CONFIG_IDF_TARGET_ESP32H2 // Set ESP32 to go to deep sleep to see a variation // in the reset reason. Device will sleep for 5 seconds. -#if CONFIG_IDF_TARGET_ESP32C3 +#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32H2 esp_sleep_pd_config(ESP_PD_DOMAIN_RC_FAST, ESP_PD_OPTION_OFF); #else esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_OFF); #endif Serial.println("Going to sleep"); esp_deep_sleep(5 * uS_TO_S_FACTOR); +#endif } void loop() { diff --git a/libraries/ESP32/examples/Time/SimpleTime/.skip.esp32h2 b/libraries/ESP32/examples/Time/SimpleTime/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/ESP32/examples/Touch/TouchButton/.skip.esp32h2 b/libraries/ESP32/examples/Touch/TouchButton/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/ESP32/examples/Touch/TouchButtonV2/.skip.esp32h2 b/libraries/ESP32/examples/Touch/TouchButtonV2/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/ESP32/examples/Touch/TouchInterrupt/.skip.esp32h2 b/libraries/ESP32/examples/Touch/TouchInterrupt/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/ESP32/examples/Touch/TouchRead/.skip.esp32h2 b/libraries/ESP32/examples/Touch/TouchRead/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/ESPmDNS/examples/mDNS-SD_Extended/.skip.esp32h2 b/libraries/ESPmDNS/examples/mDNS-SD_Extended/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/ESPmDNS/examples/mDNS_Web_Server/.skip.esp32h2 b/libraries/ESPmDNS/examples/mDNS_Web_Server/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/Ethernet/examples/ETH_LAN8720/.skip.esp32h2 b/libraries/Ethernet/examples/ETH_LAN8720/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/Ethernet/examples/ETH_TLK110/.skip.esp32h2 b/libraries/Ethernet/examples/ETH_TLK110/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/FFat/examples/FFat_time/.skip.esp32h2 b/libraries/FFat/examples/FFat_time/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/HTTPClient/examples/Authorization/.skip.esp32h2 b/libraries/HTTPClient/examples/Authorization/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/HTTPClient/examples/BasicHttpClient/.skip.esp32h2 b/libraries/HTTPClient/examples/BasicHttpClient/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/HTTPClient/examples/BasicHttpsClient/.skip.esp32h2 b/libraries/HTTPClient/examples/BasicHttpsClient/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/HTTPClient/examples/HTTPClientEnterprise/.skip.esp32h2 b/libraries/HTTPClient/examples/HTTPClientEnterprise/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/HTTPClient/examples/ReuseConnection/.skip.esp32h2 b/libraries/HTTPClient/examples/ReuseConnection/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/HTTPClient/examples/StreamHttpClient/.skip.esp32h2 b/libraries/HTTPClient/examples/StreamHttpClient/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/HTTPUpdate/examples/httpUpdate/.skip.esp32h2 b/libraries/HTTPUpdate/examples/httpUpdate/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/HTTPUpdate/examples/httpUpdateSPIFFS/.skip.esp32h2 b/libraries/HTTPUpdate/examples/httpUpdateSPIFFS/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/HTTPUpdate/examples/httpUpdateSecure/.skip.esp32h2 b/libraries/HTTPUpdate/examples/httpUpdateSecure/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/HTTPUpdateServer/examples/WebUpdater/.skip.esp32h2 b/libraries/HTTPUpdateServer/examples/WebUpdater/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/I2S/examples/ADCPlotter/.skip.esp32h2 b/libraries/I2S/examples/ADCPlotter/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/I2S/examples/FullDuplex/.skip.esp32h2 b/libraries/I2S/examples/FullDuplex/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/I2S/examples/InputSerialPlotter/.skip.esp32h2 b/libraries/I2S/examples/InputSerialPlotter/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/I2S/examples/SimpleTone/.skip.esp32h2 b/libraries/I2S/examples/SimpleTone/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/Insights/examples/DiagnosticsSmokeTest/.skip.esp32h2 b/libraries/Insights/examples/DiagnosticsSmokeTest/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/Insights/examples/MinimalDiagnostics/.skip.esp32h2 b/libraries/Insights/examples/MinimalDiagnostics/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/LittleFS/examples/LITTLEFS_time/.skip.esp32h2 b/libraries/LittleFS/examples/LITTLEFS_time/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/NetBIOS/examples/ESP_NBNST/.skip.esp32h2 b/libraries/NetBIOS/examples/ESP_NBNST/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/RainMaker/examples/RMakerCustom/.skip.esp32h2 b/libraries/RainMaker/examples/RMakerCustom/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/RainMaker/examples/RMakerCustomAirCooler/.skip.esp32h2 b/libraries/RainMaker/examples/RMakerCustomAirCooler/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/RainMaker/examples/RMakerSonoffDualR3/.skip.esp32h2 b/libraries/RainMaker/examples/RMakerSonoffDualR3/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/RainMaker/examples/RMakerSwitch/.skip.esp32h2 b/libraries/RainMaker/examples/RMakerSwitch/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/SD/examples/SD_time/.skip.esp32h2 b/libraries/SD/examples/SD_time/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/SD_MMC/examples/SDMMC_Test/.skip.esp32h2 b/libraries/SD_MMC/examples/SDMMC_Test/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/SD_MMC/examples/SDMMC_time/.skip.esp32h2 b/libraries/SD_MMC/examples/SDMMC_time/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/SPI/examples/SPI_Multiple_Buses/.skip.esp32h2 b/libraries/SPI/examples/SPI_Multiple_Buses/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/SPIFFS/examples/SPIFFS_time/.skip.esp32h2 b/libraries/SPIFFS/examples/SPIFFS_time/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/USB/examples/CompositeDevice/.skip.esp32h2 b/libraries/USB/examples/CompositeDevice/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/USB/examples/ConsumerControl/.skip.esp32h2 b/libraries/USB/examples/ConsumerControl/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/USB/examples/CustomHIDDevice/.skip.esp32h2 b/libraries/USB/examples/CustomHIDDevice/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/USB/examples/FirmwareMSC/.skip.esp32h2 b/libraries/USB/examples/FirmwareMSC/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/USB/examples/Gamepad/.skip.esp32h2 b/libraries/USB/examples/Gamepad/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/USB/examples/HIDVendor/.skip.esp32h2 b/libraries/USB/examples/HIDVendor/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/USB/examples/Keyboard/KeyboardLogout/.skip.esp32h2 b/libraries/USB/examples/Keyboard/KeyboardLogout/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/USB/examples/Keyboard/KeyboardMessage/.skip.esp32h2 b/libraries/USB/examples/Keyboard/KeyboardMessage/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/USB/examples/Keyboard/KeyboardReprogram/.skip.esp32h2 b/libraries/USB/examples/Keyboard/KeyboardReprogram/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/USB/examples/Keyboard/KeyboardSerial/.skip.esp32h2 b/libraries/USB/examples/Keyboard/KeyboardSerial/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/USB/examples/KeyboardAndMouseControl/.skip.esp32h2 b/libraries/USB/examples/KeyboardAndMouseControl/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/USB/examples/Mouse/ButtonMouseControl/.skip.esp32h2 b/libraries/USB/examples/Mouse/ButtonMouseControl/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/USB/examples/SystemControl/.skip.esp32h2 b/libraries/USB/examples/SystemControl/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/USB/examples/USBMSC/.skip.esp32h2 b/libraries/USB/examples/USBMSC/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/USB/examples/USBSerial/.skip.esp32h2 b/libraries/USB/examples/USBSerial/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/USB/examples/USBVendor/.skip.esp32h2 b/libraries/USB/examples/USBVendor/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/Update/examples/AWS_S3_OTA_Update/.skip.esp32h2 b/libraries/Update/examples/AWS_S3_OTA_Update/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/Update/examples/HTTPS_OTA_Update/.skip.esp32h2 b/libraries/Update/examples/HTTPS_OTA_Update/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/WebServer/examples/AdvancedWebServer/.skip.esp32h2 b/libraries/WebServer/examples/AdvancedWebServer/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/WebServer/examples/FSBrowser/.skip.esp32h2 b/libraries/WebServer/examples/FSBrowser/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/WebServer/examples/HelloServer/.skip.esp32h2 b/libraries/WebServer/examples/HelloServer/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/WebServer/examples/HttpAdvancedAuth/.skip.esp32h2 b/libraries/WebServer/examples/HttpAdvancedAuth/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/WebServer/examples/HttpBasicAuth/.skip.esp32h2 b/libraries/WebServer/examples/HttpBasicAuth/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/WebServer/examples/MultiHomedServers/.skip.esp32h2 b/libraries/WebServer/examples/MultiHomedServers/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/WebServer/examples/PathArgServer/.skip.esp32h2 b/libraries/WebServer/examples/PathArgServer/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/WebServer/examples/SDWebServer/.skip.esp32h2 b/libraries/WebServer/examples/SDWebServer/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/WebServer/examples/SimpleAuthentification/.skip.esp32h2 b/libraries/WebServer/examples/SimpleAuthentification/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/WebServer/examples/WebUpdate/.skip.esp32h2 b/libraries/WebServer/examples/WebUpdate/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/WiFi/examples/FTM/FTM_Initiator/.skip.esp32h2 b/libraries/WiFi/examples/FTM/FTM_Initiator/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/WiFi/examples/FTM/FTM_Responder/.skip.esp32h2 b/libraries/WiFi/examples/FTM/FTM_Responder/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/WiFi/examples/SimpleWiFiServer/.skip.esp32h2 b/libraries/WiFi/examples/SimpleWiFiServer/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/WiFi/examples/WPS/.skip.esp32h2 b/libraries/WiFi/examples/WPS/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/WiFi/examples/WiFiAccessPoint/.skip.esp32h2 b/libraries/WiFi/examples/WiFiAccessPoint/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/WiFi/examples/WiFiBlueToothSwitch/.skip.esp32h2 b/libraries/WiFi/examples/WiFiBlueToothSwitch/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/WiFi/examples/WiFiClient/.skip.esp32h2 b/libraries/WiFi/examples/WiFiClient/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/WiFi/examples/WiFiClientBasic/.skip.esp32h2 b/libraries/WiFi/examples/WiFiClientBasic/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/WiFi/examples/WiFiClientConnect/.skip.esp32h2 b/libraries/WiFi/examples/WiFiClientConnect/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/WiFi/examples/WiFiClientEnterprise/.skip.esp32h2 b/libraries/WiFi/examples/WiFiClientEnterprise/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/WiFi/examples/WiFiClientEvents/.skip.esp32h2 b/libraries/WiFi/examples/WiFiClientEvents/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/WiFi/examples/WiFiClientStaticIP/.skip.esp32h2 b/libraries/WiFi/examples/WiFiClientStaticIP/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/WiFi/examples/WiFiIPv6/.skip.esp32h2 b/libraries/WiFi/examples/WiFiIPv6/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/WiFi/examples/WiFiMulti/.skip.esp32h2 b/libraries/WiFi/examples/WiFiMulti/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/WiFi/examples/WiFiScan/.skip.esp32h2 b/libraries/WiFi/examples/WiFiScan/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/WiFi/examples/WiFiScanDualAntenna/.skip.esp32h2 b/libraries/WiFi/examples/WiFiScanDualAntenna/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/WiFi/examples/WiFiSmartConfig/.skip.esp32h2 b/libraries/WiFi/examples/WiFiSmartConfig/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/WiFi/examples/WiFiTelnetToSerial/.skip.esp32h2 b/libraries/WiFi/examples/WiFiTelnetToSerial/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/WiFi/examples/WiFiUDPClient/.skip.esp32h2 b/libraries/WiFi/examples/WiFiUDPClient/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/WiFiClientSecure/examples/WiFiClientInsecure/.skip.esp32h2 b/libraries/WiFiClientSecure/examples/WiFiClientInsecure/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/WiFiClientSecure/examples/WiFiClientPSK/.skip.esp32h2 b/libraries/WiFiClientSecure/examples/WiFiClientPSK/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/WiFiClientSecure/examples/WiFiClientSecure/.skip.esp32h2 b/libraries/WiFiClientSecure/examples/WiFiClientSecure/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/WiFiClientSecure/examples/WiFiClientSecureEnterprise/.skip.esp32h2 b/libraries/WiFiClientSecure/examples/WiFiClientSecureEnterprise/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/WiFiClientSecure/examples/WiFiClientShowPeerCredentials/.skip.esp32h2 b/libraries/WiFiClientSecure/examples/WiFiClientShowPeerCredentials/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/WiFiProv/examples/WiFiProv/.skip.esp32h2 b/libraries/WiFiProv/examples/WiFiProv/.skip.esp32h2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/platform.txt b/platform.txt index 1403b1e7f45..ed0c7925726 100644 --- a/platform.txt +++ b/platform.txt @@ -82,11 +82,13 @@ build.extra_flags.esp32s3=-DARDUINO_USB_MODE={build.usb_mode} -DARDUINO_USB_CDC_ build.extra_flags.esp32s2=-DARDUINO_USB_MODE=0 -DARDUINO_USB_CDC_ON_BOOT={build.cdc_on_boot} -DARDUINO_USB_MSC_ON_BOOT={build.msc_on_boot} -DARDUINO_USB_DFU_ON_BOOT={build.dfu_on_boot} build.extra_flags.esp32c3=-DARDUINO_USB_MODE=1 -DARDUINO_USB_CDC_ON_BOOT={build.cdc_on_boot} build.extra_flags.esp32c6=-DARDUINO_USB_MODE=1 -DARDUINO_USB_CDC_ON_BOOT={build.cdc_on_boot} +build.extra_flags.esp32h2=-DARDUINO_USB_MODE=1 -DARDUINO_USB_CDC_ON_BOOT={build.cdc_on_boot} # This can be overriden in boards.txt build.flash_size=4MB build.flash_mode=dio build.flash_freq=80m +build.img_freq={build.flash_freq} build.boot=qio build.boot_freq={build.flash_freq} build.bootloader_addr=0x1000 @@ -107,6 +109,7 @@ build.openocdscript.esp32s2=esp32s2-kaluga-1.cfg build.openocdscript.esp32s3=esp32s3-builtin.cfg build.openocdscript.esp32c3=esp32c3-builtin.cfg build.openocdscript.esp32c6=esp32c6-builtin.cfg +build.openocdscript.esp32c6=esp32h2-builtin.cfg build.openocdscript={build.openocdscript.{build.mcu}} # Custom build options @@ -123,7 +126,7 @@ recipe.hooks.prebuild.2.pattern.windows=cmd /c if not exist "{build.path}\partit recipe.hooks.prebuild.3.pattern.windows=cmd /c if not exist "{build.path}\partitions.csv" COPY "{runtime.platform.path}\tools\partitions\{build.partitions}.csv" "{build.path}\partitions.csv" # Check if custom bootloader exist: source > variant > build.boot -recipe.hooks.prebuild.4.pattern_args=--chip {build.mcu} elf2image --flash_mode {build.flash_mode} --flash_freq {build.flash_freq} --flash_size {build.flash_size} -o +recipe.hooks.prebuild.4.pattern_args=--chip {build.mcu} elf2image --flash_mode {build.flash_mode} --flash_freq {build.img_freq} --flash_size {build.flash_size} -o recipe.hooks.prebuild.4.pattern=bash -c "[ -f "{build.source.path}"/bootloader.bin ] && cp -f "{build.source.path}"/bootloader.bin "{build.path}"/{build.project_name}.bootloader.bin || ( [ -f "{build.variant.path}"/{build.custom_bootloader}.bin ] && cp "{build.variant.path}"/{build.custom_bootloader}.bin "{build.path}"/{build.project_name}.bootloader.bin || "{tools.esptool_py.path}"/{tools.esptool_py.cmd} {recipe.hooks.prebuild.4.pattern_args} "{build.path}"/{build.project_name}.bootloader.bin "{compiler.sdk.path}"/bin/bootloader_{build.boot}_{build.boot_freq}.elf )" recipe.hooks.prebuild.4.pattern.linux=bash -c "[ -f "{build.source.path}"/bootloader.bin ] && cp -f "{build.source.path}"/bootloader.bin "{build.path}"/{build.project_name}.bootloader.bin || ( [ -f "{build.variant.path}"/{build.custom_bootloader}.bin ] && cp "{build.variant.path}"/{build.custom_bootloader}.bin "{build.path}"/{build.project_name}.bootloader.bin || python3 "{tools.esptool_py.path}"/{tools.esptool_py.cmd} {recipe.hooks.prebuild.4.pattern_args} "{build.path}"/{build.project_name}.bootloader.bin "{compiler.sdk.path}"/bin/bootloader_{build.boot}_{build.boot_freq}.elf )" recipe.hooks.prebuild.4.pattern.windows=cmd /c IF EXIST "{build.source.path}\bootloader.bin" ( COPY /y "{build.source.path}\bootloader.bin" "{build.path}\{build.project_name}.bootloader.bin" ) ELSE ( IF EXIST "{build.variant.path}\{build.custom_bootloader}.bin" ( COPY "{build.variant.path}\{build.custom_bootloader}.bin" "{build.path}\{build.project_name}.bootloader.bin" ) ELSE ( "{tools.esptool_py.path}/{tools.esptool_py.cmd}" {recipe.hooks.prebuild.4.pattern_args} "{build.path}\{build.project_name}.bootloader.bin" "{compiler.sdk.path}\bin\bootloader_{build.boot}_{build.boot_freq}.elf" ) ) @@ -166,7 +169,7 @@ recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.f recipe.objcopy.partitions.bin.pattern={tools.gen_esp32part.cmd} -q "{build.path}/partitions.csv" "{build.path}/{build.project_name}.partitions.bin" ## Create bin -recipe.objcopy.bin.pattern_args=--chip {build.mcu} elf2image --flash_mode "{build.flash_mode}" --flash_freq "{build.flash_freq}" --flash_size "{build.flash_size}" --elf-sha256-offset 0xb0 -o "{build.path}/{build.project_name}.bin" "{build.path}/{build.project_name}.elf" +recipe.objcopy.bin.pattern_args=--chip {build.mcu} elf2image --flash_mode "{build.flash_mode}" --flash_freq "{build.img_freq}" --flash_size "{build.flash_size}" --elf-sha256-offset 0xb0 -o "{build.path}/{build.project_name}.bin" "{build.path}/{build.project_name}.elf" recipe.objcopy.bin.pattern="{tools.esptool_py.path}/{tools.esptool_py.cmd}" {recipe.objcopy.bin.pattern_args} recipe.objcopy.bin.pattern.linux=python3 "{tools.esptool_py.path}/{tools.esptool_py.cmd}" {recipe.objcopy.bin.pattern_args} From c5a5cf5609f070b6ac0093c6e08efbd7f75530fb Mon Sep 17 00:00:00 2001 From: me-no-dev Date: Sat, 1 Jul 2023 11:11:55 +0300 Subject: [PATCH 3/3] Update libs for ESP32H2 --- package/package_esp32_index.template.json | 36 +++++++++++------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/package/package_esp32_index.template.json b/package/package_esp32_index.template.json index 7b82e263980..feacc05162d 100644 --- a/package/package_esp32_index.template.json +++ b/package/package_esp32_index.template.json @@ -39,7 +39,7 @@ { "packager": "esp32", "name": "esp32-arduino-libs", - "version": "idf-release_v5.1-4bc762621f" + "version": "idf-release_v5.1-4bc762621g" }, { "packager": "esp32", @@ -97,61 +97,61 @@ "tools": [ { "name": "esp32-arduino-libs", - "version": "idf-release_v5.1-4bc762621f", + "version": "idf-release_v5.1-4bc762621g", "systems": [ { "host": "i686-mingw32", - "url": "https://codeload.github.com/espressif/esp32-arduino-libs/zip/21759a1fa7bf2289fc0b6e31367a07c7bebfe303", - "archiveFileName": "esp32-arduino-libs-21759a1fa7bf2289fc0b6e31367a07c7bebfe303.zip", + "url": "https://codeload.github.com/espressif/esp32-arduino-libs/zip/3220341ad12fe553ec5b7c6068b58622d87af04b", + "archiveFileName": "esp32-arduino-libs-3220341ad12fe553ec5b7c6068b58622d87af04b.zip", "checksum": "SHA-256:a586736d0d129560f14d77a2de157c496689be7c975c494aacad1d3655344845", "size": "196715296" }, { "host": "x86_64-mingw32", - "url": "https://codeload.github.com/espressif/esp32-arduino-libs/zip/21759a1fa7bf2289fc0b6e31367a07c7bebfe303", - "archiveFileName": "esp32-arduino-libs-21759a1fa7bf2289fc0b6e31367a07c7bebfe303.zip", + "url": "https://codeload.github.com/espressif/esp32-arduino-libs/zip/3220341ad12fe553ec5b7c6068b58622d87af04b", + "archiveFileName": "esp32-arduino-libs-3220341ad12fe553ec5b7c6068b58622d87af04b.zip", "checksum": "SHA-256:a586736d0d129560f14d77a2de157c496689be7c975c494aacad1d3655344845", "size": "196715296" }, { "host": "arm64-apple-darwin", - "url": "https://codeload.github.com/espressif/esp32-arduino-libs/zip/21759a1fa7bf2289fc0b6e31367a07c7bebfe303", - "archiveFileName": "esp32-arduino-libs-21759a1fa7bf2289fc0b6e31367a07c7bebfe303.zip", + "url": "https://codeload.github.com/espressif/esp32-arduino-libs/zip/3220341ad12fe553ec5b7c6068b58622d87af04b", + "archiveFileName": "esp32-arduino-libs-3220341ad12fe553ec5b7c6068b58622d87af04b.zip", "checksum": "SHA-256:a586736d0d129560f14d77a2de157c496689be7c975c494aacad1d3655344845", "size": "196715296" }, { "host": "x86_64-apple-darwin", - "url": "https://codeload.github.com/espressif/esp32-arduino-libs/zip/21759a1fa7bf2289fc0b6e31367a07c7bebfe303", - "archiveFileName": "esp32-arduino-libs-21759a1fa7bf2289fc0b6e31367a07c7bebfe303.zip", + "url": "https://codeload.github.com/espressif/esp32-arduino-libs/zip/3220341ad12fe553ec5b7c6068b58622d87af04b", + "archiveFileName": "esp32-arduino-libs-3220341ad12fe553ec5b7c6068b58622d87af04b.zip", "checksum": "SHA-256:a586736d0d129560f14d77a2de157c496689be7c975c494aacad1d3655344845", "size": "196715296" }, { "host": "x86_64-pc-linux-gnu", - "url": "https://codeload.github.com/espressif/esp32-arduino-libs/zip/21759a1fa7bf2289fc0b6e31367a07c7bebfe303", - "archiveFileName": "esp32-arduino-libs-21759a1fa7bf2289fc0b6e31367a07c7bebfe303.zip", + "url": "https://codeload.github.com/espressif/esp32-arduino-libs/zip/3220341ad12fe553ec5b7c6068b58622d87af04b", + "archiveFileName": "esp32-arduino-libs-3220341ad12fe553ec5b7c6068b58622d87af04b.zip", "checksum": "SHA-256:a586736d0d129560f14d77a2de157c496689be7c975c494aacad1d3655344845", "size": "196715296" }, { "host": "i686-pc-linux-gnu", - "url": "https://codeload.github.com/espressif/esp32-arduino-libs/zip/21759a1fa7bf2289fc0b6e31367a07c7bebfe303", - "archiveFileName": "esp32-arduino-libs-21759a1fa7bf2289fc0b6e31367a07c7bebfe303.zip", + "url": "https://codeload.github.com/espressif/esp32-arduino-libs/zip/3220341ad12fe553ec5b7c6068b58622d87af04b", + "archiveFileName": "esp32-arduino-libs-3220341ad12fe553ec5b7c6068b58622d87af04b.zip", "checksum": "SHA-256:a586736d0d129560f14d77a2de157c496689be7c975c494aacad1d3655344845", "size": "196715296" }, { "host": "aarch64-linux-gnu", - "url": "https://codeload.github.com/espressif/esp32-arduino-libs/zip/21759a1fa7bf2289fc0b6e31367a07c7bebfe303", - "archiveFileName": "esp32-arduino-libs-21759a1fa7bf2289fc0b6e31367a07c7bebfe303.zip", + "url": "https://codeload.github.com/espressif/esp32-arduino-libs/zip/3220341ad12fe553ec5b7c6068b58622d87af04b", + "archiveFileName": "esp32-arduino-libs-3220341ad12fe553ec5b7c6068b58622d87af04b.zip", "checksum": "SHA-256:a586736d0d129560f14d77a2de157c496689be7c975c494aacad1d3655344845", "size": "196715296" }, { "host": "arm-linux-gnueabihf", - "url": "https://codeload.github.com/espressif/esp32-arduino-libs/zip/21759a1fa7bf2289fc0b6e31367a07c7bebfe303", - "archiveFileName": "esp32-arduino-libs-21759a1fa7bf2289fc0b6e31367a07c7bebfe303.zip", + "url": "https://codeload.github.com/espressif/esp32-arduino-libs/zip/3220341ad12fe553ec5b7c6068b58622d87af04b", + "archiveFileName": "esp32-arduino-libs-3220341ad12fe553ec5b7c6068b58622d87af04b.zip", "checksum": "SHA-256:a586736d0d129560f14d77a2de157c496689be7c975c494aacad1d3655344845", "size": "196715296" }