esp32h4: checked all the corner stuffs of the removal

pull/11275/head
laokaiyao 2023-04-13 17:06:40 +08:00 zatwierdzone przez Kevin (Lao Kaiyao)
rodzic bf2a7b2df6
commit 49f16eefbb
20 zmienionych plików z 39 dodań i 36 usunięć

Wyświetl plik

@ -334,7 +334,7 @@ typedef enum {
/**
* @brief Revokes the old signature digest. To be called in the application after the rollback logic.
*
* Relevant for Secure boot v2 on ESP32-S2, ESP32-S3, ESP32-C3 where upto 3 key digests can be stored (Key \#N-1, Key \#N, Key \#N+1).
* Relevant for Secure boot v2 on ESP32-S2, ESP32-S3, ESP32-C3, ESP32-C6, ESP32-H2 where upto 3 key digests can be stored (Key \#N-1, Key \#N, Key \#N+1).
* When key \#N-1 used to sign an app is invalidated, an OTA update is to be sent with an app signed with key \#N-1 & Key \#N.
* After successfully booting the OTA app should call this function to revoke Key \#N-1.
*

Wyświetl plik

@ -17,6 +17,7 @@ typedef enum {
ESP_CHIP_ID_ESP32S2 = 0x0002, /*!< chip ID: ESP32-S2 */
ESP_CHIP_ID_ESP32C3 = 0x0005, /*!< chip ID: ESP32-C3 */
ESP_CHIP_ID_ESP32S3 = 0x0009, /*!< chip ID: ESP32-S3 */
ESP_CHIP_ID_ESP32C2 = 0x000C, /*!< chip ID: ESP32-C2 */
ESP_CHIP_ID_ESP32C6 = 0x000D, /*!< chip ID: ESP32-C6 */
ESP_CHIP_ID_INVALID = 0xFFFF /*!< Invalid chip ID (we defined it to make sure the esp_chip_id_t is 2 bytes size) */
} __attribute__((packed)) esp_chip_id_t;

Wyświetl plik

@ -33,7 +33,6 @@
#endif
// H2 and C2 will not support external flash.
#define TEST_FLASH_FREQ_MHZ 5
typedef struct {

Wyświetl plik

@ -279,7 +279,7 @@ menu "ESP System Settings"
config ESP_CONSOLE_MULTIPLE_UART
bool
default y if !IDF_TARGET_ESP32C3 && !IDF_TARGET_ESP32C2
default y if !IDF_TARGET_ESP32C3 && !IDF_TARGET_ESP32H2 && !IDF_TARGET_ESP32C2 && !IDF_TARGET_ESP32C6
choice ESP_CONSOLE_UART_NUM
prompt "UART peripheral to use for console output (0-1)"

Wyświetl plik

@ -29,7 +29,7 @@
#define REASON_FREQ_SWITCH BIT(1)
#define REASON_GDB_CALL BIT(3)
#if !CONFIG_IDF_TARGET_ESP32C3 && !IDF_TARGET_ESP32C2 && !IDF_TARGET_ESP32C6
#if CONFIG_IDF_TARGET_ARCH_XTENSA
#define REASON_PRINT_BACKTRACE BIT(2)
#define REASON_TWDT_ABORT BIT(4)
#endif
@ -66,7 +66,7 @@ static void IRAM_ATTR esp_crosscore_isr(void *arg) {
} else {
WRITE_PERI_REG(SYSTEM_CPU_INTR_FROM_CPU_1_REG, 0);
}
#elif CONFIG_IDF_TARGET_ESP32C3|| CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2
#elif CONFIG_IDF_TARGET_ARCH_RISCV
WRITE_PERI_REG(SYSTEM_CPU_INTR_FROM_CPU_0_REG, 0);
#endif
@ -147,7 +147,7 @@ static void IRAM_ATTR esp_crosscore_int_send(int core_id, uint32_t reason_mask)
} else {
WRITE_PERI_REG(SYSTEM_CPU_INTR_FROM_CPU_1_REG, SYSTEM_CPU_INTR_FROM_CPU_1);
}
#elif CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2
#elif CONFIG_IDF_TARGET_ARCH_RISCV
WRITE_PERI_REG(SYSTEM_CPU_INTR_FROM_CPU_0_REG, SYSTEM_CPU_INTR_FROM_CPU_0);
#endif
}
@ -167,7 +167,7 @@ void IRAM_ATTR esp_crosscore_int_send_gdb_call(int core_id)
esp_crosscore_int_send(core_id, REASON_GDB_CALL);
}
#if !CONFIG_IDF_TARGET_ESP32C3 && !IDF_TARGET_ESP32C2 && !IDF_TARGET_ESP32C6 && !CONFIG_IDF_TARGET_ESP32H2
#if CONFIG_IDF_TARGET_ARCH_XTENSA
void IRAM_ATTR esp_crosscore_int_send_print_backtrace(int core_id)
{
esp_crosscore_int_send(core_id, REASON_PRINT_BACKTRACE);

Wyświetl plik

@ -43,7 +43,7 @@
#define BROWNOUT "BROWN_OUT_RST"
#define STORE_ERROR "StoreProhibited"
#elif CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C2
#elif CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32H2 || CONFIG_IDF_TARGET_ESP32C2
#define DEEPSLEEP "DSLEEP"
#define LOAD_STORE_ERROR "Store access fault"
#define RESET "RTC_SW_CPU_RST"

Wyświetl plik

@ -1,5 +1,7 @@
menu "Wi-Fi"
# TODO: Disable WIFI support on ESP32-H2 (WIFI-5796)
# visible if SOC_WIFI_SUPPORTED
config ESP_WIFI_ENABLED
bool

Wyświetl plik

@ -366,7 +366,7 @@ menu "FreeRTOS"
config FREERTOS_TICK_SUPPORT_SYSTIMER
bool
default y if !FREERTOS_TICK_SUPPORT_CORETIMER
# ESP32-S3 and ESP32-C3 can use Systimer for FreeRTOS SysTick
# All targets except ESP32 and ESP32S2 can use Systimer for FreeRTOS SysTick
# ESP32S2 also has SYSTIMER but it can not be used for the FreeRTOS SysTick because:
# - It has only one counter, which already in use esp_timer.
# A counter for SysTick should be stall in debug mode but work esp_timer.

Wyświetl plik

@ -13,18 +13,7 @@ if(CONFIG_IEEE802154_ENABLED)
target_link_libraries(${COMPONENT_LIB} INTERFACE $<TARGET_FILE:${ieee802154_lib}>
$<TARGET_FILE:${esp_phy_lib}> libphy.a libbtbb.a $<TARGET_FILE:${esp_phy_lib}>)
else()
if(IDF_TARGET STREQUAL "esp32h4")
if(CONFIG_IDF_TARGET_ESP32H4_BETA_VERSION_1)
target_link_libraries(${COMPONENT_LIB} INTERFACE
"-L ${CMAKE_CURRENT_SOURCE_DIR}/lib/${idf_target}/rev1")
endif()
if(CONFIG_IDF_TARGET_ESP32H4_BETA_VERSION_2)
target_link_libraries(${COMPONENT_LIB} INTERFACE
"-L ${CMAKE_CURRENT_SOURCE_DIR}/lib/${idf_target}/rev2")
endif()
else()
target_link_directories(${COMPONENT_LIB} INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/lib/${idf_target}")
endif()
target_link_directories(${COMPONENT_LIB} INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/lib/${idf_target}")
target_link_libraries(${COMPONENT_LIB} INTERFACE $<TARGET_FILE:${esp_phy_lib}> lib802154.a libphy.a libbtbb.a
$<TARGET_FILE:${esp_phy_lib}> $<TARGET_FILE:${esp_system_lib}>)
endif()

Wyświetl plik

@ -11,12 +11,12 @@ OpenThread can run under the following modes on Espressif chips:
Standalone node
+++++++++++++++
The full OpenThread stack and the application layer runs on the same chip. This mode is available on chips with 15.4 radio such as ESP32-H2.
The full OpenThread stack and the application layer runs on the same chip. This mode is available on chips with 15.4 radio such as {IDF_TARGET}.
Radio Co-Processor (RCP)
++++++++++++++++++++++++
The chip will be connected to another host running the OpenThread IP stack. It will send and received 15.4 packets on behalf of the host. This mode is available on chips with 15.4 radio such as ESP32-H2. The underlying transport between the chip and the host can be SPI or UART. For sake of latency, we recommend to use SPI as the underlying transport.
The chip will be connected to another host running the OpenThread IP stack. It will send and received 15.4 packets on behalf of the host. This mode is available on chips with 15.4 radio such as {IDF_TARGET}. The underlying transport between the chip and the host can be SPI or UART. For sake of latency, we recommend to use SPI as the underlying transport.
OpenThread host
+++++++++++++++

Wyświetl plik

@ -201,7 +201,7 @@ The source clock can also limit the PWM frequency. The higher the source clock f
.. only:: not SOC_LEDC_HAS_TIMER_SPECIFIC_MUX
1. For {IDF_TARGET_NAME}, all timers share one clock source. In other words, it is impossible to use different clock sources for different timers.
2. For {IDF_TARGET_NAME}, all timers share one clock source. In other words, it is impossible to use different clock sources for different timers.
When a timer is no longer needed by any channel, it can be deconfigured by calling the same function :cpp:func:`ledc_timer_config`. The configuration structure :cpp:type:`ledc_timer_config_t` passes in should be:

Wyświetl plik

@ -201,7 +201,7 @@ LED PWM 控制器可在无需 CPU 干预的情况下自动改变占空比,实
.. only:: not SOC_LEDC_HAS_TIMER_SPECIFIC_MUX
1. {IDF_TARGET_NAME} 的所有定时器共用一个时钟源。因此 {IDF_TARGET_NAME} 不支持给不同的定时器配置不同的时钟源。
2. {IDF_TARGET_NAME} 的所有定时器共用一个时钟源。因此 {IDF_TARGET_NAME} 不支持给不同的定时器配置不同的时钟源。
当一个定时器不再被任何通道所需要时,可以通过调用相同的函数 :cpp:func:`ledc_timer_config` 来重置这个定时器。此时,函数入参的配置结构体需要指定:

Wyświetl plik

@ -26,7 +26,7 @@ please set: `idf.py menuconfig --> Component config --> Example 'GATT CLIENT THR
### Hardware Required
* A development board with ESP32/ESP32-C3/ESP32-C2/ESP32-H2/ESP32-S3 SoC (e.g., ESP32-DevKitC, ESP-WROVER-KIT, etc.)
* A development board with supported SoC (e.g., ESP32-DevKitC, ESP-WROVER-KIT, etc.)
* A USB cable for Power supply and programming
See [Development Boards](https://www.espressif.com/en/products/devkits) for more information about it.

Wyświetl plik

@ -142,6 +142,7 @@ menu "Example Ethernet Configuration"
default 14 if IDF_TARGET_ESP32
default 12 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3
default 6 if IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C2
default 4 if IDF_TARGET_ESP32H2
help
Set the GPIO number used by SPI SCLK.
@ -151,6 +152,7 @@ menu "Example Ethernet Configuration"
default 13 if IDF_TARGET_ESP32
default 11 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3
default 7 if IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C2
default 5 if IDF_TARGET_ESP32H2
help
Set the GPIO number used by SPI MOSI.
@ -160,13 +162,14 @@ menu "Example Ethernet Configuration"
default 12 if IDF_TARGET_ESP32
default 13 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3
default 2 if IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C2
default 0 if IDF_TARGET_ESP32H2
help
Set the GPIO number used by SPI MISO.
config EXAMPLE_ETH_SPI_CLOCK_MHZ
int "SPI clock speed (MHz)"
range 5 80
default 12 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C2
default 12 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C2 || IDF_TARGET_ESP32H2
default 36 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3
help
Set the clock speed (MHz) of SPI interface.
@ -176,6 +179,7 @@ menu "Example Ethernet Configuration"
range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX
default 15 if IDF_TARGET_ESP32
default 10 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3 || IDF_TARGET_ESP32C2
default 1 if IDF_TARGET_ESP32H2
help
Set the GPIO number used by SPI CS0, i.e. Chip Select associated with the first SPI Eth module).
@ -187,6 +191,7 @@ menu "Example Ethernet Configuration"
default 7 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3
default 8 if IDF_TARGET_ESP32C3
default 3 if IDF_TARGET_ESP32C2
default 11 if IDF_TARGET_ESP32H2
help
Set the GPIO number used by SPI CS1, i.e. Chip Select associated with the second SPI Eth module.
@ -195,6 +200,7 @@ menu "Example Ethernet Configuration"
range ENV_GPIO_RANGE_MIN ENV_GPIO_IN_RANGE_MAX
default 4 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3
default 4 if IDF_TARGET_ESP32C2
default 9 if IDF_TARGET_ESP32H2
help
Set the GPIO number used by the first SPI Ethernet module interrupt line.
@ -204,6 +210,7 @@ menu "Example Ethernet Configuration"
range ENV_GPIO_RANGE_MIN ENV_GPIO_IN_RANGE_MAX
default 33 if IDF_TARGET_ESP32
default 5 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3 || IDF_TARGET_ESP32C2
default 10 if IDF_TARGET_ESP32H2
help
Set the GPIO number used by the second SPI Ethernet module interrupt line.

Wyświetl plik

@ -15,6 +15,7 @@ menu "Example Configuration"
default 14 if IDF_TARGET_ESP32
default 12 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3
default 6 if IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C2
default 4 if IDF_TARGET_ESP32H2
help
Set the GPIO number used by SPI SCLK.
@ -24,6 +25,7 @@ menu "Example Configuration"
default 13 if IDF_TARGET_ESP32
default 11 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3
default 7 if IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C2
default 5 if IDF_TARGET_ESP32H2
help
Set the GPIO number used by SPI MOSI.
@ -33,6 +35,7 @@ menu "Example Configuration"
default 12 if IDF_TARGET_ESP32
default 13 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3
default 2 if IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C2
default 0 if IDF_TARGET_ESP32H2
help
Set the GPIO number used by SPI MISO.
@ -41,6 +44,7 @@ menu "Example Configuration"
range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX
default 15 if IDF_TARGET_ESP32
default 10 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3 || IDF_TARGET_ESP32C2
default 1 if IDF_TARGET_ESP32H2
help
Set the GPIO number used by SPI CS.
@ -56,6 +60,7 @@ menu "Example Configuration"
range ENV_GPIO_RANGE_MIN ENV_GPIO_IN_RANGE_MAX
default 4 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3
default 4 if IDF_TARGET_ESP32C2
default 9 if IDF_TARGET_ESP32H2
help
Set the GPIO number used by ENC28J60 interrupt.

Wyświetl plik

@ -26,12 +26,12 @@
#if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3
#define I2C_SCL_IO (GPIO_NUM_16)
#define I2C_SDA_IO (GPIO_NUM_17)
#elif CONFIG_IDF_TARGET_ESP32C3
#define I2C_SCL_IO (GPIO_NUM_6)
#define I2C_SDA_IO (GPIO_NUM_7)
#elif CONFIG_IDF_TARGET_ESP32H2
#define I2C_SCL_IO (GPIO_NUM_8)
#define I2C_SDA_IO (GPIO_NUM_9)
#else
#define I2C_SCL_IO (GPIO_NUM_6)
#define I2C_SDA_IO (GPIO_NUM_7)
#endif
/* I2S port and GPIOs */

Wyświetl plik

@ -60,9 +60,11 @@ menu "Example Configuration"
config EXAMPLE_GPIO_WAKEUP_PIN
int "Enable wakeup from GPIO"
default 0
default 0 if !IDF_TARGET_ESP32H2
default 7 if IDF_TARGET_ESP32H2
range 0 7 if IDF_TARGET_ESP32C6
range 0 5
range 7 14 if IDF_TARGET_ESP32H2
range 0 5 if !IDF_TARGET_ESP32C6 && !IDF_TARGET_ESP32H2
config EXAMPLE_GPIO_WAKEUP_HIGH_LEVEL
bool "Enable GPIO high-level wakeup"

Wyświetl plik

@ -5,7 +5,7 @@ menu "Example Configuration"
config BLINK_GPIO
int "Blink GPIO number"
range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX
default 8 if IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C2
default 8 if IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32H2 || IDF_TARGET_ESP32C2
default 18 if IDF_TARGET_ESP32S2
default 48 if IDF_TARGET_ESP32S3
default 5

Wyświetl plik

@ -12,7 +12,7 @@
/* Most development boards have "boot" button attached to GPIO0.
* You can also change this to another pin.
*/
#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C2 \
#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32H2 \
|| CONFIG_IDF_TARGET_ESP32C6
#define BOOT_BUTTON_NUM 9
#else

Wyświetl plik

@ -32,7 +32,6 @@ USUAL_TO_FORMAL = {
'esp32c2': 'ESP32-C2',
'esp32c6': 'ESP32-C6',
'esp32h2': 'ESP32-H2',
'esp32h4': 'ESP32-H4',
'linux': 'Linux',
}
@ -44,7 +43,6 @@ FORMAL_TO_USUAL = {
'ESP32-C2': 'esp32c2',
'ESP32-C6': 'esp32c6',
'ESP32-H2': 'esp32h2',
'ESP32-H4': 'esp32h4',
'Linux': 'linux',
}