@@ -414,19 +414,20 @@ def switch_off_ldf():
414
414
# Initialize board configuration and MCU settings
415
415
board = env .BoardConfig ()
416
416
mcu = board .get ("build.mcu" , "esp32" )
417
+ is_xtensa = mcu in ("esp32" ,"esp32s2" ,"esp32s3" )
417
418
toolchain_arch = "xtensa-%s" % mcu
418
419
filesystem = board .get ("build.filesystem" , "littlefs" )
419
420
420
421
# Set toolchain architecture for RISC-V based ESP32 variants
421
- if mcu not in ( "esp32" , "esp32s2" , "esp32s3" ) :
422
+ if not is_xtensa :
422
423
toolchain_arch = "riscv32-esp"
423
424
424
425
# Initialize integration extra data if not present
425
426
if "INTEGRATION_EXTRA_DATA" not in env :
426
427
env ["INTEGRATION_EXTRA_DATA" ] = {}
427
428
428
429
# Take care of possible whitespaces in path
429
- objcopy_value = (
430
+ uploader_path = (
430
431
f'"{ esptool_binary_path } "'
431
432
if ' ' in esptool_binary_path
432
433
else esptool_binary_path
@@ -446,18 +447,14 @@ def switch_off_ldf():
446
447
GDB = join (
447
448
platform .get_package_dir (
448
449
"tool-riscv32-esp-elf-gdb"
449
- if mcu not in (
450
- "esp32" ,
451
- "esp32s2" ,
452
- "esp32s3" ,
453
- )
450
+ if not is_xtensa
454
451
else "tool-xtensa-esp-elf-gdb"
455
452
)
456
453
or "" ,
457
454
"bin" ,
458
455
"%s-elf-gdb" % toolchain_arch ,
459
456
),
460
- OBJCOPY = objcopy_value ,
457
+ OBJCOPY = uploader_path ,
461
458
RANLIB = "%s-elf-gcc-ranlib" % toolchain_arch ,
462
459
SIZETOOL = "%s-elf-size" % toolchain_arch ,
463
460
ARFLAGS = ["rc" ],
@@ -467,7 +464,7 @@ def switch_off_ldf():
467
464
SIZECHECKCMD = "$SIZETOOL -A -d $SOURCES" ,
468
465
SIZEPRINTCMD = "$SIZETOOL -B -d $SOURCES" ,
469
466
ERASEFLAGS = ["--chip" , mcu , "--port" , '"$UPLOAD_PORT"' ],
470
- ERASECMD = '" $OBJCOPY" $ERASEFLAGS erase-flash' ,
467
+ ERASECMD = '$OBJCOPY $ERASEFLAGS erase-flash' ,
471
468
# mkspiffs package contains two different binaries for IDF and Arduino
472
469
MKFSTOOL = "mk%s" % filesystem
473
470
+ (
@@ -719,7 +716,7 @@ def firmware_metrics(target, source, env):
719
716
# Configure upload protocol: esptool
720
717
elif upload_protocol == "esptool" :
721
718
env .Replace (
722
- UPLOADER = objcopy_value ,
719
+ UPLOADER = uploader_path ,
723
720
UPLOADERFLAGS = [
724
721
"--chip" ,
725
722
mcu ,
@@ -794,7 +791,7 @@ def firmware_metrics(target, source, env):
794
791
"-Q" ,
795
792
"-D" ,
796
793
],
797
- UPLOADCMD = '" $UPLOADER" $UPLOADERFLAGS "$SOURCE"' ,
794
+ UPLOADCMD = '$UPLOADER $UPLOADERFLAGS "$SOURCE"' ,
798
795
)
799
796
800
797
# Configure upload protocol: Debug tools (OpenOCD)
0 commit comments