diff --git a/.gitlab/ci/docs.yml b/.gitlab/ci/docs.yml index 3ea791048a..89bf179e9d 100644 --- a/.gitlab/ci/docs.yml +++ b/.gitlab/ci/docs.yml @@ -96,7 +96,7 @@ check_docs_lang_sync: parallel: matrix: - DOCLANG: ["en", "zh_CN"] - DOCTGT: ["esp32", "esp32s2", "esp32s3", "esp32c3", "esp32c2", "esp32c6", "esp32c61", "esp32c5","esp32h2", "esp32h21", "esp32p4"] + DOCTGT: ["esp32", "esp32s2", "esp32s3", "esp32c3", "esp32c2", "esp32c6", "esp32c61", "esp32c5", "esp32h2", "esp32h4", "esp32h21", "esp32p4"] check_docs_gh_links: image: $ESP_IDF_DOC_ENV_IMAGE diff --git a/components/esp_hw_support/port/esp32h4/Kconfig.mac b/components/esp_hw_support/port/esp32h4/Kconfig.mac new file mode 100644 index 0000000000..699af30771 --- /dev/null +++ b/components/esp_hw_support/port/esp32h4/Kconfig.mac @@ -0,0 +1,18 @@ +choice ESP32H4_UNIVERSAL_MAC_ADDRESSES + bool "Number of universally administered (by IEEE) MAC address" + default ESP32H4_UNIVERSAL_MAC_ADDRESSES_TWO + help + Configure the number of universally administered (by IEEE) MAC addresses. + During initialization, MAC addresses for each network interface are generated or derived from a + single base MAC address. + + config ESP32H4_UNIVERSAL_MAC_ADDRESSES_TWO + bool "Two" + select ESP_MAC_UNIVERSAL_MAC_ADDRESSES_TWO + select ESP_MAC_ADDR_UNIVERSE_IEEE802154 + select ESP_MAC_ADDR_UNIVERSE_BT +endchoice + +config ESP32H4_UNIVERSAL_MAC_ADDRESSES + int + default 2 if ESP32H4_UNIVERSAL_MAC_ADDRESSES_TWO diff --git a/components/soc/esp32h4/include/soc/Kconfig.soc_caps.in b/components/soc/esp32h4/include/soc/Kconfig.soc_caps.in index 4a736c4ad4..bb5f06f3c7 100644 --- a/components/soc/esp32h4/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32h4/include/soc/Kconfig.soc_caps.in @@ -215,6 +215,10 @@ config SOC_GPIO_SUPPORT_HOLD_SINGLE_IO_IN_DSLP bool default y +config SOC_LEDC_CHANNEL_NUM + int + default 6 + config SOC_MMU_PERIPH_NUM int default 1 diff --git a/components/soc/esp32h4/include/soc/adc_channel.h b/components/soc/esp32h4/include/soc/adc_channel.h new file mode 100644 index 0000000000..95b431d090 --- /dev/null +++ b/components/soc/esp32h4/include/soc/adc_channel.h @@ -0,0 +1,7 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once diff --git a/components/soc/esp32h4/include/soc/soc_caps.h b/components/soc/esp32h4/include/soc/soc_caps.h index af14c42aaa..54813851d2 100644 --- a/components/soc/esp32h4/include/soc/soc_caps.h +++ b/components/soc/esp32h4/include/soc/soc_caps.h @@ -282,7 +282,7 @@ /*-------------------------- LEDC CAPS ---------------------------------------*/ // #define SOC_LEDC_SUPPORT_PLL_DIV_CLOCK (1) // #define SOC_LEDC_SUPPORT_XTAL_CLOCK (1) -// #define SOC_LEDC_CHANNEL_NUM (6) +#define SOC_LEDC_CHANNEL_NUM (6) // TODO: [ESP32H4] IDF-12343 // #define SOC_LEDC_TIMER_BIT_WIDTH (20) // #define SOC_LEDC_SUPPORT_FADE_STOP (1) // #define SOC_LEDC_GAMMA_CURVE_FADE_SUPPORTED (1) diff --git a/docs/conf_common.py b/docs/conf_common.py index acd3aef6d7..492a27cde0 100644 --- a/docs/conf_common.py +++ b/docs/conf_common.py @@ -297,6 +297,10 @@ ESP32C6_DOCS = [ ESP32H2_DOCS = ['api-guides/RF_calibration.rst', 'api-guides/phy.rst'] +ESP32H4_DOCS = [ + 'api-reference/system/ipc.rst', +] + ESP32P4_DOCS = [ 'api-reference/system/ipc.rst', 'api-reference/peripherals/cap_touch_sens.rst', @@ -373,6 +377,7 @@ conditional_include_dict = { 'esp32c6': ESP32C6_DOCS, 'esp32c61': ESP32C61_DOCS, 'esp32h2': ESP32H2_DOCS, + 'esp32h4': ESP32H4_DOCS, 'esp32p4': ESP32P4_DOCS, } diff --git a/docs/doxygen/Doxyfile_esp32h4 b/docs/doxygen/Doxyfile_esp32h4 new file mode 100644 index 0000000000..910f295a01 --- /dev/null +++ b/docs/doxygen/Doxyfile_esp32h4 @@ -0,0 +1 @@ +INPUT += \ diff --git a/docs/en/api-guides/host-apps.rst b/docs/en/api-guides/host-apps.rst index c846486353..53b6f21a0a 100644 --- a/docs/en/api-guides/host-apps.rst +++ b/docs/en/api-guides/host-apps.rst @@ -56,7 +56,7 @@ Since these limitations are not very practical, in particular for testing and de Note furthermore that if you use the ESP-IDF FreeRTOS mock component (``tools/mocks/freertos``), these limitations do not apply. But that mock component will not do any scheduling, either. -.. only:: not esp32p4 +.. only:: not esp32p4 and not esp32h4 .. note:: diff --git a/docs/en/api-guides/jtag-debugging/esp32h4.inc b/docs/en/api-guides/jtag-debugging/esp32h4.inc new file mode 100644 index 0000000000..77e1ecddef --- /dev/null +++ b/docs/en/api-guides/jtag-debugging/esp32h4.inc @@ -0,0 +1,171 @@ +.. This file gets included from other .rst files in this folder. +.. It contains target-specific snippets. +.. Comments and '---' lines act as delimiters. +.. +.. This is necessary mainly because RST doesn't support substitutions +.. (defined in RST, not in Python) inside code blocks. If that is ever implemented, +.. These code blocks can be moved back to the main .rst files, with target-specific +.. file names being replaced by substitutions. + +.. run-openocd + +:: + + openocd -f board/esp32h2-builtin.cfg + +.. |run-openocd-device-name| replace:: ESP32-H2 through built-in USB connection + +--- + +.. run-openocd-output + +:: + + user-name@computer-name:~/esp/esp-idf$ openocd -f board/esp32h2-builtin.cfg + Open On-Chip Debugger v0.12.0-esp32-20221026-175-g0f5217b3-dirty (2023-02-02-11:32) + Licensed under GNU GPL v2 + For bug reports, read + http://openocd.org/doc/doxygen/bugs.html + Info : only one transport option; autoselecting 'jtag' + Info : esp_usb_jtag: VID set to 0x303a and PID to 0x1001 + Info : esp_usb_jtag: capabilities descriptor set to 0x2000 + Warn : Transport "jtag" was already selected + Info : Listening on port 6666 for tcl connections + Info : Listening on port 4444 for telnet connections + Info : esp_usb_jtag: serial (60:55:F9:F7:2C:3F) + Info : esp_usb_jtag: Device found. Base speed 24000KHz, div range 1 to 255 + Info : clock speed 24000 kHz + Info : JTAG tap: esp32h2.cpu tap/device found: 0x00010c25 (mfg: 0x612 (Espressif Systems), part: 0x0010, ver: 0x0) + Info : datacount=2 progbufsize=16 + Info : Examined RISC-V core; found 1 harts + Info : hart 0: XLEN=32, misa=0x40903105 + Info : starting gdb server for esp32h2 on 3333 + Info : Listening on port 3333 for gdb connections + +.. |run-openocd-cfg-file-err| replace:: ``Can't find board/esp32h2-builtin.cfg`` + +--- + +.. run-openocd-upload + +:: + + openocd -f board/esp32h2-builtin.cfg -c "program_esp filename.bin 0x10000 verify exit" + +--- + +.. run-openocd-src-linux + +.. code-block:: bash + + src/openocd -f board/esp32h2-builtin.cfg + +--- + +.. run-openocd-src-win + +.. code-block:: batch + + src\openocd -f board/esp32h2-builtin.cfg + +--- + +.. idf-py-openocd-default-cfg + +.. |idf-py-def-cfg| replace:: ``-f board/esp32h2-builtin.cfg`` + +--- + +.. run-openocd-appimage-offset + +:: + + openocd -f board/esp32h2-builtin.cfg -c "init; halt; esp appimage_offset 0x210000" + +--- + +.. openocd-cfg-files + +.. list-table:: OpenOCD configuration files for ESP32-H2 + :widths: 25 75 + :header-rows: 1 + + * - Name + - Description + * - ``board/esp32h2-builtin.cfg`` + - Board configuration file for ESP32-H2 through built-in USB, includes target and adapter configuration. + * - ``board/esp32h2-ftdi.cfg`` + - Board configuration file for ESP32-H2 for via externally connected FTDI-based probe like ESP-Prog, includes target and adapter configuration. + * - ``target/esp32h2.cfg`` + - ESP32-H2 target configuration file. Can be used together with one of the ``interface/`` configuration files. + * - ``interface/esp_usb_jtag.cfg`` + - JTAG adapter configuration file for ESP32-H2. + * - ``interface/ftdi/esp32_devkitj_v1.cfg`` + - JTAG adapter configuration file for ESP-Prog boards. + +--- + +.. openocd-target-specific-config-vars + +--- + +--- + +.. jtag-pins + +.. list-table:: ESP32-H2 pins and JTAG signals + :widths: 25 75 + :header-rows: 1 + + * - ESP32-H2 Pin + - JTAG Signal + * - MTDO / GPIO3 + - TDO + * - MTDI / GPIO5 + - TDI + * - MTCK / GPIO4 + - TCK + * - MTMS / GPIO2 + - TMS + +.. |jtag-sel-gpio| replace:: GPIO25 +.. |jtag-gpio-list| replace:: GPIO2-GPIO5 + +--- + +.. run-openocd-d3 + +:: + + openocd -l openocd_log.txt -d3 -f board/esp32h2-builtin.cfg + +--- + +.. run-openocd-d3-tee + +:: + + openocd -d3 -f board/esp32h2-builtin.cfg 2>&1 | tee openocd.log + +--- + +.. run-gdb-remotelog + +:: + + riscv32-esp-elf-gdb -ex "set remotelogfile gdb_log.txt" + +--- + +.. devkit-defs + +.. |devkit-name| replace:: ESP32-H2 +.. |devkit-name-with-link| replace:: :doc:`ESP32-H2 <../../hw-reference/index>` + +--- + +.. devkit-hw-config + +* Out of the box, ESP32-H2 doesn't need any additional hardware configuration for JTAG debugging. + +--- diff --git a/docs/en/api-reference/peripherals/gpio/esp32h4.inc b/docs/en/api-reference/peripherals/gpio/esp32h4.inc new file mode 100644 index 0000000000..3796a2600b --- /dev/null +++ b/docs/en/api-reference/peripherals/gpio/esp32h4.inc @@ -0,0 +1,18 @@ +.. This file gets included from other .rst files in this folder. +.. It contains target-specific snippets. +.. Comments and '---' lines act as delimiters. +.. +.. This is necessary mainly because RST doesn't support substitutions +.. (defined in RST, not in Python) inside code blocks. If that is ever implemented, +.. These code blocks can be moved back to the main .rst files, with target-specific +.. file names being replaced by substitutions. + +.. gpio-summary + + To be updated + +.. note:: + + To be updated + +--- diff --git a/docs/en/api-reference/system/inc/espefuse_summary_ESP32-H4.rst b/docs/en/api-reference/system/inc/espefuse_summary_ESP32-H4.rst new file mode 100644 index 0000000000..56fbc223f8 --- /dev/null +++ b/docs/en/api-reference/system/inc/espefuse_summary_ESP32-H4.rst @@ -0,0 +1,3 @@ +.. code-block:: none + + To be updated diff --git a/docs/en/api-reference/system/inc/espefuse_summary_ESP32-H4_dump.rst b/docs/en/api-reference/system/inc/espefuse_summary_ESP32-H4_dump.rst new file mode 100644 index 0000000000..5b6bbcdb53 --- /dev/null +++ b/docs/en/api-reference/system/inc/espefuse_summary_ESP32-H4_dump.rst @@ -0,0 +1,3 @@ +.. code-block:: none + + To be updated diff --git a/docs/en/api-reference/system/inc/power_management_esp32h4.rst b/docs/en/api-reference/system/inc/power_management_esp32h4.rst new file mode 100644 index 0000000000..754feffa03 --- /dev/null +++ b/docs/en/api-reference/system/inc/power_management_esp32h4.rst @@ -0,0 +1,7 @@ + +.. flat-table:: + :widths: 1 3 3 + + * - Max CPU Frequency Set + - Lock Acquisition + - CPU and APB Frequencies diff --git a/docs/en/api-reference/system/inc/revisions_ESP32-H4.rst b/docs/en/api-reference/system/inc/revisions_ESP32-H4.rst new file mode 100644 index 0000000000..2bc9797f60 --- /dev/null +++ b/docs/en/api-reference/system/inc/revisions_ESP32-H4.rst @@ -0,0 +1,8 @@ + +.. list-table:: + :header-rows: 1 + :width: 2 5 + :align: center + + * - ECO + - Revision (Major.Minor) diff --git a/docs/en/api-reference/system/inc/show-efuse-table_ESP32-H4.rst b/docs/en/api-reference/system/inc/show-efuse-table_ESP32-H4.rst new file mode 100644 index 0000000000..3b79f2928a --- /dev/null +++ b/docs/en/api-reference/system/inc/show-efuse-table_ESP32-H4.rst @@ -0,0 +1,4 @@ + +.. code-block:: none + + To be updated diff --git a/docs/en/get-started/esp32h4_output_log.inc b/docs/en/get-started/esp32h4_output_log.inc new file mode 100644 index 0000000000..1e2a4f3d6e --- /dev/null +++ b/docs/en/get-started/esp32h4_output_log.inc @@ -0,0 +1,5 @@ +.. output_log + +.. code-block:: none + + To be updated diff --git a/docs/en/security/esp32h4_log.inc b/docs/en/security/esp32h4_log.inc new file mode 100644 index 0000000000..61dd838690 --- /dev/null +++ b/docs/en/security/esp32h4_log.inc @@ -0,0 +1,17 @@ + +.. first_boot_enc + +.. code-block:: none + + To be updated + +------ + +.. already_en_enc + +.. code-block:: none + + To be updated + + +------ diff --git a/docs/zh_CN/api-guides/host-apps.rst b/docs/zh_CN/api-guides/host-apps.rst index 546180d76d..dd71e4d43e 100644 --- a/docs/zh_CN/api-guides/host-apps.rst +++ b/docs/zh_CN/api-guides/host-apps.rst @@ -56,7 +56,7 @@ ESP-IDF 已支持使用 `FreeRTOS POSIX/Linux 模拟器 &1 | tee openocd.log + +--- + +.. run-gdb-remotelog + +:: + + riscv32-esp-elf-gdb -ex "set remotelogfile gdb_log.txt" + +--- + +.. devkit-defs + +.. |devkit-name| replace:: ESP32-H2 +.. |devkit-name-with-link| replace:: :doc:`ESP32-H2 <../../hw-reference/index>` + +--- + +.. devkit-hw-config + +* Out of the box, ESP32-H2 doesn't need any additional hardware configuration for JTAG debugging. + +--- diff --git a/docs/zh_CN/api-reference/peripherals/gpio/esp32h4.inc b/docs/zh_CN/api-reference/peripherals/gpio/esp32h4.inc new file mode 100644 index 0000000000..3796a2600b --- /dev/null +++ b/docs/zh_CN/api-reference/peripherals/gpio/esp32h4.inc @@ -0,0 +1,18 @@ +.. This file gets included from other .rst files in this folder. +.. It contains target-specific snippets. +.. Comments and '---' lines act as delimiters. +.. +.. This is necessary mainly because RST doesn't support substitutions +.. (defined in RST, not in Python) inside code blocks. If that is ever implemented, +.. These code blocks can be moved back to the main .rst files, with target-specific +.. file names being replaced by substitutions. + +.. gpio-summary + + To be updated + +.. note:: + + To be updated + +--- diff --git a/docs/zh_CN/api-reference/system/inc/espefuse_summary_ESP32-H4.rst b/docs/zh_CN/api-reference/system/inc/espefuse_summary_ESP32-H4.rst new file mode 100644 index 0000000000..56fbc223f8 --- /dev/null +++ b/docs/zh_CN/api-reference/system/inc/espefuse_summary_ESP32-H4.rst @@ -0,0 +1,3 @@ +.. code-block:: none + + To be updated diff --git a/docs/zh_CN/api-reference/system/inc/espefuse_summary_ESP32-H4_dump.rst b/docs/zh_CN/api-reference/system/inc/espefuse_summary_ESP32-H4_dump.rst new file mode 100644 index 0000000000..5b6bbcdb53 --- /dev/null +++ b/docs/zh_CN/api-reference/system/inc/espefuse_summary_ESP32-H4_dump.rst @@ -0,0 +1,3 @@ +.. code-block:: none + + To be updated diff --git a/docs/zh_CN/api-reference/system/inc/power_management_esp32h4.rst b/docs/zh_CN/api-reference/system/inc/power_management_esp32h4.rst new file mode 100644 index 0000000000..754feffa03 --- /dev/null +++ b/docs/zh_CN/api-reference/system/inc/power_management_esp32h4.rst @@ -0,0 +1,7 @@ + +.. flat-table:: + :widths: 1 3 3 + + * - Max CPU Frequency Set + - Lock Acquisition + - CPU and APB Frequencies diff --git a/docs/zh_CN/api-reference/system/inc/revisions_ESP32-H4.rst b/docs/zh_CN/api-reference/system/inc/revisions_ESP32-H4.rst new file mode 100644 index 0000000000..2bc9797f60 --- /dev/null +++ b/docs/zh_CN/api-reference/system/inc/revisions_ESP32-H4.rst @@ -0,0 +1,8 @@ + +.. list-table:: + :header-rows: 1 + :width: 2 5 + :align: center + + * - ECO + - Revision (Major.Minor) diff --git a/docs/zh_CN/api-reference/system/inc/show-efuse-table_ESP32-H4.rst b/docs/zh_CN/api-reference/system/inc/show-efuse-table_ESP32-H4.rst new file mode 100644 index 0000000000..3b79f2928a --- /dev/null +++ b/docs/zh_CN/api-reference/system/inc/show-efuse-table_ESP32-H4.rst @@ -0,0 +1,4 @@ + +.. code-block:: none + + To be updated diff --git a/docs/zh_CN/get-started/esp32h4_output_log.inc b/docs/zh_CN/get-started/esp32h4_output_log.inc new file mode 100644 index 0000000000..1e2a4f3d6e --- /dev/null +++ b/docs/zh_CN/get-started/esp32h4_output_log.inc @@ -0,0 +1,5 @@ +.. output_log + +.. code-block:: none + + To be updated diff --git a/docs/zh_CN/security/esp32h4_log.inc b/docs/zh_CN/security/esp32h4_log.inc new file mode 100644 index 0000000000..61dd838690 --- /dev/null +++ b/docs/zh_CN/security/esp32h4_log.inc @@ -0,0 +1,17 @@ + +.. first_boot_enc + +.. code-block:: none + + To be updated + +------ + +.. already_en_enc + +.. code-block:: none + + To be updated + + +------