From 121eeea392ae455789622931f30358bf2ae592e9 Mon Sep 17 00:00:00 2001 From: Magnus Persson Date: Thu, 21 Apr 2022 07:35:32 +0200 Subject: [PATCH] Saving partitions.bin for esp32 --- script/copy_firmware.py | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/script/copy_firmware.py b/script/copy_firmware.py index b23b2d3..5c1d7c4 100644 --- a/script/copy_firmware.py +++ b/script/copy_firmware.py @@ -11,21 +11,46 @@ def after_build(source, target, env): print( "Executing custom step " ) dir = env.GetLaunchDir() name = env.get( "PIOENV" ) - source = dir + "/.pio/build/" + name + "/firmware.bin" if name == "gravity-debug" : target = dir + "/bin/firmware-debug.bin" + source = dir + "/.pio/build/" + name + "/firmware.bin" + print( "Copy file : " + source + " -> " + target ) + shutil.copyfile( source, target ) + if name == "gravity-release" : target = dir + "/bin/firmware.bin" + source = dir + "/.pio/build/" + name + "/firmware.bin" + print( "Copy file : " + source + " -> " + target ) + shutil.copyfile( source, target ) + if name == "gravity-perf" : target = dir + "/bin/firmware-perf.bin" + source = dir + "/.pio/build/" + name + "/firmware.bin" + print( "Copy file : " + source + " -> " + target ) + shutil.copyfile( source, target ) + if name == "gravity32-release" : target = dir + "/bin/firmware32.bin" + source = dir + "/.pio/build/" + name + "/firmware.bin" + print( "Copy file : " + source + " -> " + target ) + shutil.copyfile( source, target ) + + target = dir + "/bin/partitions32.bin" + source = dir + "/.pio/build/" + name + "/partitions.bin" + print( "Copy file : " + source + " -> " + target ) + shutil.copyfile( source, target ) + if name == "gravity32-perf" : target = dir + "/bin/firmware32-perf.bin" + source = dir + "/.pio/build/" + name + "/firmware.bin" + print( "Copy file : " + source + " -> " + target ) + shutil.copyfile( source, target ) + if name == "gravity32-release2" : target = dir + "/bin/firmware32_2.bin" - print( "Copy file : " + source + " -> " + target ) - shutil.copyfile( source, target ) + source = dir + "/.pio/build/" + name + "/firmware.bin" + print( "Copy file : " + source + " -> " + target ) + shutil.copyfile( source, target ) print( "Adding custom build step (copy firmware): ")