21
21
22
22
from SCons .Script import Import
23
23
24
- Import ("env sdk_config project_config idf_variant" )
24
+ Import ("env sdk_config project_config app_includes idf_variant" )
25
25
26
26
ulp_env = env .Clone ()
27
27
platform = ulp_env .PioPlatform ()
@@ -37,22 +37,24 @@ def prepare_ulp_env_vars(env):
37
37
38
38
toolchain_path = platform .get_package_dir (
39
39
"toolchain-xtensa-esp-elf"
40
+ if idf_variant not in ("esp32c6" , "esp32p4" )
41
+ else "toolchain-riscv32-esp"
42
+ )
43
+
44
+ toolchain_path_ulp = platform .get_package_dir (
45
+ "toolchain-esp32ulp"
46
+ if sdk_config .get ("ULP_COPROC_TYPE_FSM" , False )
47
+ else ""
40
48
)
41
49
42
50
additional_packages = [
43
51
toolchain_path ,
44
- os .path .join (
45
- platform .get_package_dir ("toolchain-esp32ulp" ),
46
- "bin" ,
47
- ),
52
+ toolchain_path_ulp ,
48
53
platform .get_package_dir ("tool-ninja" ),
49
54
os .path .join (platform .get_package_dir ("tool-cmake" ), "bin" ),
50
55
os .path .dirname (where_is_program ("python" )),
51
56
]
52
57
53
- # if "windows" in get_systype():
54
- # additional_packages.append(platform.get_package_dir("tool-mconf"))
55
-
56
58
for package in additional_packages :
57
59
ulp_env .PrependENVPath ("PATH" , package )
58
60
@@ -89,7 +91,11 @@ def _generate_ulp_configuration_action(env, target, source):
89
91
"-riscv" if riscv_ulp_enabled else "" ,
90
92
)
91
93
else :
92
- 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
93
99
94
100
cmd = (
95
101
os .path .join (platform .get_package_dir ("tool-cmake" ), "bin" , "cmake" ),
@@ -105,7 +111,7 @@ def _generate_ulp_configuration_action(env, target, source):
105
111
"-DULP_S_SOURCES=%s" % ";" .join ([fs .to_unix_path (s .get_abspath ()) for s in source ]),
106
112
"-DULP_APP_NAME=ulp_main" ,
107
113
"-DCOMPONENT_DIR=" + os .path .join (ulp_env .subst ("$PROJECT_DIR" ), "ulp" ),
108
- "-DCOMPONENT_INCLUDES=%s" % ";" . join ( get_component_includes ( target_config )) ,
114
+ "-DCOMPONENT_INCLUDES=" + comp_includes ,
109
115
"-DIDF_TARGET=%s" % idf_variant ,
110
116
"-DIDF_PATH=" + fs .to_unix_path (FRAMEWORK_DIR ),
111
117
"-DSDKCONFIG_HEADER=" + os .path .join (BUILD_DIR , "config" , "sdkconfig.h" ),
0 commit comments