Skip to content

Commit 18cb216

Browse files
authored
Update ulp.py
1 parent fd59ead commit 18cb216

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

builder/frameworks/ulp.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# limitations under the License.
1414

1515
import os
16+
import sys
1617

1718
from platformio import fs
1819
from platformio.util import get_systype
@@ -34,11 +35,12 @@
3435
def prepare_ulp_env_vars(env):
3536
ulp_env.PrependENVPath("IDF_PATH", FRAMEWORK_DIR)
3637

38+
toolchain_path = platform.get_package_dir(
39+
"toolchain-xtensa-%s" % idf_variant
40+
)
41+
3742
additional_packages = [
38-
os.path.join(
39-
platform.get_package_dir("toolchain-xtensa-%s" % idf_variant),
40-
"bin",
41-
),
43+
toolchain_path,
4244
os.path.join(
4345
platform.get_package_dir("toolchain-esp32ulp"),
4446
"bin",
@@ -57,7 +59,7 @@ def prepare_ulp_env_vars(env):
5759

5860
def collect_ulp_sources():
5961
return [
60-
fs.to_unix_path(os.path.join(ulp_env.subst("$PROJECT_DIR"), "ulp", f))
62+
os.path.join(ulp_env.subst("$PROJECT_DIR"), "ulp", f)
6163
for f in os.listdir(os.path.join(ulp_env.subst("$PROJECT_DIR"), "ulp"))
6264
if f.endswith((".c", ".S", ".s"))
6365
]
@@ -95,7 +97,7 @@ def _generate_ulp_configuration_action(env, target, source):
9597
"-riscv" if riscv_ulp_enabled else "",
9698
),
9799
),
98-
"-DULP_S_SOURCES=%s" % ";".join([s.get_abspath() for s in source]),
100+
"-DULP_S_SOURCES=%s" % ";".join([fs.to_unix_path(s.get_abspath()) for s in source]),
99101
"-DULP_APP_NAME=ulp_main",
100102
"-DCOMPONENT_DIR=" + os.path.join(ulp_env.subst("$PROJECT_DIR"), "ulp"),
101103
"-DCOMPONENT_INCLUDES=%s" % ";".join(get_component_includes(target_config)),
@@ -110,7 +112,10 @@ def _generate_ulp_configuration_action(env, target, source):
110112
os.path.join(FRAMEWORK_DIR, "components", "ulp", "cmake"),
111113
)
112114

113-
exec_command(cmd)
115+
result = exec_command(cmd)
116+
if result["returncode"] != 0:
117+
sys.stderr.write(result["err"] + "\n")
118+
env.Exit(1)
114119

115120
ulp_sources = collect_ulp_sources()
116121
ulp_sources.sort()

0 commit comments

Comments
 (0)