Skip to content

Commit

Permalink
zephyr: esp32c6: Add LP Core support
Browse files Browse the repository at this point in the history
Add LP Core support to esp32c6

Signed-off-by: Lucas Tamborrino <[email protected]>
  • Loading branch information
LucasTambor committed Jan 22, 2025
1 parent 4b6fb32 commit 0e489c9
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion zephyr/esp32c6/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ if(CONFIG_SOC_SERIES_ESP32C6)
../../components/mbedtls/port/include

../port/include/boot
../../components/ulp/lp_core/include
../../components/ulp/lp_core/lp_core/include
../../components/ulp/lp_core/shared/include
../../components/ulp/ulp_common/include
)

zephyr_link_libraries(
Expand Down Expand Up @@ -219,7 +223,8 @@ if(CONFIG_SOC_SERIES_ESP32C6)
)
endif()

zephyr_sources(
zephyr_sources_ifdef(
CONFIG_SOC_ESP32C6_HPCORE

../../components/soc/${CONFIG_SOC_SERIES}/gpio_periph.c
../../components/soc/${CONFIG_SOC_SERIES}/rtc_io_periph.c
Expand Down Expand Up @@ -307,6 +312,7 @@ if(CONFIG_SOC_SERIES_ESP32C6)
CONFIG_UART_ESP32
../../components/hal/uart_hal.c
../../components/hal/uart_hal_iram.c
../../components/soc/${CONFIG_SOC_SERIES}/uart_periph.c
)

zephyr_sources_ifdef(
Expand Down Expand Up @@ -340,6 +346,33 @@ if(CONFIG_SOC_SERIES_ESP32C6)
../../components/efuse/${CONFIG_SOC_SERIES}/esp_efuse_utility.c
)
endif()

if(CONFIG_SOC_ESP32C6_LPCORE)
zephyr_compile_definitions(IS_ULP_COCPU)
zephyr_ld_options("-nostartfiles")
zephyr_ld_options("-Wl,--no-warn-rwx-segments")
zephyr_ld_options("-Wl,--gc-sections")
endif()

if(CONFIG_ULP_COPROC_ENABLED)
zephyr_sources_ifdef(
CONFIG_SOC_ESP32C6_HPCORE
../../components/ulp/lp_core/lp_core.c
../../components/ulp/lp_core/shared/ulp_lp_core_lp_timer_shared.c
../../components/ulp/lp_core/shared/ulp_lp_core_memory_shared.c
../../components/driver/gpio/rtc_io.c
../../components/hal/rtc_io_hal.c
)

zephyr_sources_ifdef(
CONFIG_SOC_ESP32C6_LPCORE
../../components/ulp/lp_core/lp_core/lp_core_interrupt.c
../../components/ulp/lp_core/lp_core/lp_core_utils.c
../../components/ulp/lp_core/shared/ulp_lp_core_lp_timer_shared.c
../../components/ulp/lp_core/shared/ulp_lp_core_memory_shared.c
../../components/hal/uart_hal_iram.c
)
endif()

## shared WIFI/BT resources
if (CONFIG_BT OR CONFIG_WIFI_ESP32)
Expand Down

0 comments on commit 0e489c9

Please sign in to comment.