Skip to content

Commit bb67a15

Browse files
committed
hopefully fixes the ESP32 build.
1 parent 5da6713 commit bb67a15

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

builder/esp32.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,7 @@ def compile(): # NOQA
926926

927927
espressif_path = os.path.expanduser('~/.espressif')
928928
python_path = f'{espressif_path}/python_env/idf5.2_py3.10_env/bin'
929-
esptool_path = f'{python_path}/esptool'
929+
esptool_path = f'"{python_path}/esptool"'
930930
python_path += '/python'
931931

932932
output = output.split('python ', 1)[-1]
@@ -940,10 +940,12 @@ def compile(): # NOQA
940940
full_file_path = (
941941
f'{SCRIPT_DIR}/lib/micropython/ports/esp32/{build_name}'
942942
)
943-
bin_files = [
944-
'0x' + item.replace(build_name, full_file_path).strip()
945-
for item in output.split('0x')[1:]
946-
]
943+
bin_files = []
944+
for item in output.split('0x')[1:]:
945+
item, bf = item.split(build_name, 1)
946+
bf = f'"{full_file_path}{bf.strip()}"'
947+
bin_files.append(f'0x{item.strip()} {bf}')
948+
947949
bin_files = ' '.join(bin_files)
948950

949951
old_bin_files = ['0x' + item.strip() for item in output.split('0x')[1:]]
@@ -965,7 +967,7 @@ def compile(): # NOQA
965967
build_bin_file += '_OCTFLASH'
966968

967969
build_bin_file += '.bin'
968-
build_bin_file = os.path.abspath(build_bin_file)
970+
build_bin_file = f'"{os.path.abspath(build_bin_file)}"'
969971

970972
cmds = [''.join([
971973
f'{python_path} -m {esptool_path} ',
@@ -981,7 +983,7 @@ def compile(): # NOQA
981983
output = python_path + output
982984

983985
if deploy:
984-
tool_path = os.path.split(esptool_path)[0]
986+
tool_path = os.path.split(esptool_path[1:-1])[0]
985987
sys.path.insert(0, tool_path)
986988

987989
from esptool.targets import CHIP_DEFS # NOQA

0 commit comments

Comments
 (0)