Skip to content

Commit 1892bfe

Browse files
committed
zephyr: esp32c6: Add LP Core support
Add LP Core support to esp32c6 Signed-off-by: Lucas Tamborrino <[email protected]>
1 parent 1123fe9 commit 1892bfe

File tree

1 file changed

+34
-1
lines changed

1 file changed

+34
-1
lines changed

zephyr/esp32c6/CMakeLists.txt

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ if(CONFIG_SOC_SERIES_ESP32C6)
105105
../../components/mbedtls/port/include
106106

107107
../port/include/boot
108+
../../components/ulp/lp_core/include
109+
../../components/ulp/lp_core/lp_core/include
110+
../../components/ulp/lp_core/shared/include
111+
../../components/ulp/ulp_common/include
108112
)
109113

110114
zephyr_link_libraries(
@@ -208,7 +212,8 @@ if(CONFIG_SOC_SERIES_ESP32C6)
208212
)
209213
endif()
210214

211-
zephyr_sources(
215+
zephyr_sources_ifdef(
216+
CONFIG_SOC_ESP32C6_HPCORE
212217

213218
../../components/soc/${CONFIG_SOC_SERIES}/gpio_periph.c
214219
../../components/soc/${CONFIG_SOC_SERIES}/rtc_io_periph.c
@@ -300,6 +305,7 @@ if(CONFIG_SOC_SERIES_ESP32C6)
300305
CONFIG_UART_ESP32
301306
../../components/hal/uart_hal.c
302307
../../components/hal/uart_hal_iram.c
308+
../../components/soc/${CONFIG_SOC_SERIES}/uart_periph.c
303309
)
304310

305311
zephyr_sources_ifdef(
@@ -333,6 +339,33 @@ if(CONFIG_SOC_SERIES_ESP32C6)
333339
../../components/efuse/${CONFIG_SOC_SERIES}/esp_efuse_utility.c
334340
)
335341
endif()
342+
343+
if(CONFIG_SOC_ESP32C6_LPCORE)
344+
zephyr_compile_definitions(IS_ULP_COCPU)
345+
zephyr_ld_options("-nostartfiles")
346+
zephyr_ld_options("-Wl,--no-warn-rwx-segments")
347+
zephyr_ld_options("-Wl,--gc-sections")
348+
endif()
349+
350+
if(CONFIG_ULP_COPROC_ENABLED)
351+
zephyr_sources_ifdef(
352+
CONFIG_SOC_ESP32C6_HPCORE
353+
../../components/ulp/lp_core/lp_core.c
354+
../../components/ulp/lp_core/shared/ulp_lp_core_lp_timer_shared.c
355+
../../components/ulp/lp_core/shared/ulp_lp_core_memory_shared.c
356+
../../components/driver/gpio/rtc_io.c
357+
../../components/hal/rtc_io_hal.c
358+
)
359+
360+
zephyr_sources_ifdef(
361+
CONFIG_SOC_ESP32C6_LPCORE
362+
../../components/ulp/lp_core/lp_core/lp_core_interrupt.c
363+
../../components/ulp/lp_core/lp_core/lp_core_utils.c
364+
../../components/ulp/lp_core/shared/ulp_lp_core_lp_timer_shared.c
365+
../../components/ulp/lp_core/shared/ulp_lp_core_memory_shared.c
366+
../../components/hal/uart_hal_iram.c
367+
)
368+
endif()
336369

337370
## shared WIFI/BT resources
338371
if (CONFIG_BT OR CONFIG_WIFI_ESP32)

0 commit comments

Comments
 (0)