From b85492c744fb10d91e151cb501ce57d358ae111c Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Sat, 18 Mar 2023 14:50:09 +0000 Subject: [PATCH] when flashing, only need to erase the space we're writing --- modules/flashable.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/flashable.nix b/modules/flashable.nix index 1fdeff0..faf224d 100644 --- a/modules/flashable.nix +++ b/modules/flashable.nix @@ -56,7 +56,7 @@ in { setenv serverip ${tftp.serverip} setenv ipaddr ${tftp.ipaddr} tftp 0x$(printf %x ${tftp.loadAddress}) result/firmware.bin - erase 0x$(printf %x ${flash.address}) +0x$(printf %x ${flash.size}) + erase 0x$(printf %x ${flash.address}) +\''${filesize}) cp.b 0x$(printf %x ${tftp.loadAddress}) 0x$(printf %x ${flash.address}) \''${filesize} echo command line was ${builtins.toJSON (concatStringsSep " " config.boot.commandLine)} EOF