Skip to content

Commit c9d90e6

Browse files
authored
ULP LP support
1 parent 95bbc10 commit c9d90e6

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

builder/frameworks/ulp.py

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
from SCons.Script import Import
2323

24-
Import("env sdk_config project_config idf_variant")
24+
Import("env sdk_config project_config app_includes idf_variant")
2525

2626
ulp_env = env.Clone()
2727
platform = ulp_env.PioPlatform()
@@ -37,20 +37,24 @@ def prepare_ulp_env_vars(env):
3737

3838
toolchain_path = platform.get_package_dir(
3939
"xtensa-esp-elf"
40+
if idf_variant not in ("esp32c6", "esp32p4")
41+
else "riscv32-esp-elf"
42+
)
43+
44+
toolchain_path_ulp = platform.get_package_dir(
45+
"esp32ulp-elf"
46+
if sdk_config.get("ULP_COPROC_TYPE_FSM", False)
47+
else ""
4048
)
4149

4250
additional_packages = [
4351
toolchain_path,
44-
os.path.join(
45-
platform.get_package_dir("esp32ulp-elf"),
46-
"bin",
47-
),
52+
toolchain_path_ulp,
4853
platform.get_package_dir("tool-ninja"),
4954
os.path.join(platform.get_package_dir("tool-cmake"), "bin"),
5055
os.path.dirname(where_is_program("python")),
5156
]
5257

53-
5458
for package in additional_packages:
5559
ulp_env.PrependENVPath("PATH", package)
5660

@@ -87,7 +91,11 @@ def _generate_ulp_configuration_action(env, target, source):
8791
"-riscv" if riscv_ulp_enabled else "",
8892
)
8993
else:
90-
ulp_toolchain = "toolchain-lp-core-riscv"
94+
ulp_toolchain = "toolchain-lp-core-riscv.cmake"
95+
96+
comp_includes = ";".join(get_component_includes(target_config))
97+
plain_includes = ";".join(app_includes["plain_includes"])
98+
comp_includes = comp_includes + plain_includes
9199

92100
cmd = (
93101
os.path.join(platform.get_package_dir("tool-cmake"), "bin", "cmake"),
@@ -103,7 +111,7 @@ def _generate_ulp_configuration_action(env, target, source):
103111
"-DULP_S_SOURCES=%s" % ";".join([fs.to_unix_path(s.get_abspath()) for s in source]),
104112
"-DULP_APP_NAME=ulp_main",
105113
"-DCOMPONENT_DIR=" + os.path.join(ulp_env.subst("$PROJECT_DIR"), "ulp"),
106-
"-DCOMPONENT_INCLUDES=%s" % ";".join(get_component_includes(target_config)),
114+
"-DCOMPONENT_INCLUDES=" + comp_includes,
107115
"-DIDF_TARGET=%s" % idf_variant,
108116
"-DIDF_PATH=" + fs.to_unix_path(FRAMEWORK_DIR),
109117
"-DSDKCONFIG_HEADER=" + os.path.join(BUILD_DIR, "config", "sdkconfig.h"),

0 commit comments

Comments
 (0)