Initial build support for esp32h2.

This commit is contained in:
Jade Mattsson 2024-03-27 15:35:44 +11:00
parent d8b7ca7014
commit 15ee3699ca
5 changed files with 24 additions and 13 deletions

View File

@ -10,7 +10,7 @@ jobs:
matrix: matrix:
lua_ver: ['5.1', '5.3'] lua_ver: ['5.1', '5.3']
numbers: ['default', 'alternate'] numbers: ['default', 'alternate']
target: ['esp32', 'esp32s2', 'esp32s3', 'esp32c3', 'esp32c6'] target: ['esp32', 'esp32s2', 'esp32s3', 'esp32c3', 'esp32c6', 'esp32h2']
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04

View File

@ -1,4 +1,11 @@
# Modules common to all chips # Modules common to all chips
set(wifi_modules
"espnow.c"
"wifi.c"
"wifi_ap.c"
"wifi_common.c"
"wifi_sta.c"
)
set(module_srcs set(module_srcs
"adc.c" "adc.c"
"bit.c" "bit.c"
@ -8,7 +15,6 @@ set(module_srcs
"dht.c" "dht.c"
"encoder.c" "encoder.c"
"eromfs.c" "eromfs.c"
"espnow.c"
"file.c" "file.c"
"gpio.c" "gpio.c"
"heaptrace.c" "heaptrace.c"
@ -38,10 +44,6 @@ set(module_srcs
"u8g2.c" "u8g2.c"
"uart.c" "uart.c"
"ucg.c" "ucg.c"
"wifi.c"
"wifi_ap.c"
"wifi_common.c"
"wifi_sta.c"
"ws2812.c" "ws2812.c"
) )
@ -56,17 +58,20 @@ if(IDF_TARGET STREQUAL "esp32")
"pulsecnt.c" "pulsecnt.c"
"sdmmc.c" "sdmmc.c"
"touch.c" "touch.c"
${wifi_modules}
) )
elseif(IDF_TARGET STREQUAL "esp32s2") elseif(IDF_TARGET STREQUAL "esp32s2")
list(APPEND module_srcs list(APPEND module_srcs
"dac.c" "dac.c"
"pulsecnt.c" "pulsecnt.c"
${wifi_modules}
) )
elseif(IDF_TARGET STREQUAL "esp32s3") elseif(IDF_TARGET STREQUAL "esp32s3")
list(APPEND module_srcs list(APPEND module_srcs
"dac.c" "dac.c"
"pulsecnt.c" "pulsecnt.c"
"sdmmc.c" "sdmmc.c"
${wifi_modules}
) )
elseif(IDF_TARGET STREQUAL "esp32c3") elseif(IDF_TARGET STREQUAL "esp32c3")
list(APPEND module_srcs list(APPEND module_srcs
@ -75,6 +80,10 @@ elseif(IDF_TARGET STREQUAL "esp32c6")
list(APPEND module_srcs list(APPEND module_srcs
"dac.c" "dac.c"
"pulsecnt.c" "pulsecnt.c"
${wifi_modules}
)
elseif(IDF_TARGET STREQUAL "esp32h2")
list(APPEND module_srcs
) )
endif() endif()

View File

@ -83,6 +83,7 @@ menu "NodeMCU modules"
does. does.
config NODEMCU_CMODULE_ESPNOW config NODEMCU_CMODULE_ESPNOW
depends on !IDF_TARGET_ESP32H2
bool "ESP-NOW module" bool "ESP-NOW module"
default "n" default "n"
help help
@ -309,6 +310,7 @@ menu "NodeMCU modules"
rsource "../ucg/Kconfig.ucg" rsource "../ucg/Kconfig.ucg"
config NODEMCU_CMODULE_WIFI config NODEMCU_CMODULE_WIFI
depends on !IDF_TARGET_ESP32H2
bool "WiFi module" bool "WiFi module"
default "y" default "y"
help help

View File

@ -110,20 +110,20 @@ static int node_bootreason( lua_State *L)
#if defined(CONFIG_IDF_TARGET_ESP32) || defined(CONFIG_IDF_TARGET_ESP32C6) #if defined(CONFIG_IDF_TARGET_ESP32) || defined(CONFIG_IDF_TARGET_ESP32C6)
case SDIO_RESET: case SDIO_RESET:
#endif #endif
#if defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32C3) #if defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32H2)
case GLITCH_RTC_RESET: case GLITCH_RTC_RESET:
#endif #endif
#if defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C6) #if defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C6) || defined(CONFIG_IDF_TARGET_ESP32H2)
case EFUSE_RESET: case EFUSE_RESET:
#endif #endif
#if defined(CONFIG_IDF_TARGET_ESP32C6) #if defined(CONFIG_IDF_TARGET_ESP32C6)
case JTAG_RESET: case JTAG_RESET:
#endif #endif
#if defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C6) #if defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C6) || defined(CONFIG_IDF_TARGET_ESP32H2)
case USB_UART_CHIP_RESET: case USB_UART_CHIP_RESET:
case USB_JTAG_CHIP_RESET: case USB_JTAG_CHIP_RESET:
#endif #endif
#if defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32C3) #if defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32H2)
case POWER_GLITCH_RESET: case POWER_GLITCH_RESET:
#endif #endif
case TG0WDT_SYS_RESET: case TG0WDT_SYS_RESET:
@ -271,7 +271,7 @@ static int node_sleep (lua_State *L)
esp_sleep_enable_timer_wakeup(usecs); esp_sleep_enable_timer_wakeup(usecs);
} }
#if !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32C6) #if !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32H2)
// touch option: boolean // touch option: boolean
if (opt_checkbool(L, "touch", false)) { if (opt_checkbool(L, "touch", false)) {
int err = esp_sleep_enable_touchpad_wakeup(); int err = esp_sleep_enable_touchpad_wakeup();
@ -344,7 +344,7 @@ static int node_dsleep (lua_State *L)
} }
} }
#if !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32C6) #if !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32H2)
bool pull = opt_checkbool(L, "pull", false); bool pull = opt_checkbool(L, "pull", false);
if (opt_get(L, "isolate", LUA_TTABLE)) { if (opt_get(L, "isolate", LUA_TTABLE)) {
for (int i = 1; ; i++) { for (int i = 1; ; i++) {

View File

@ -197,7 +197,7 @@ static int onewire_rmt_attach_pin( uint8_t gpio_num )
return PLATFORM_ERR; return PLATFORM_ERR;
if (gpio_num != ow_rmt.gpio) { if (gpio_num != ow_rmt.gpio) {
#if !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32C6) #if !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32H2)
// attach GPIO to previous pin // attach GPIO to previous pin
if (gpio_num < 32) { if (gpio_num < 32) {
GPIO.enable_w1ts = (0x1 << gpio_num); GPIO.enable_w1ts = (0x1 << gpio_num);