convert tftp.loadAddress from string to int

This commit is contained in:
Daniel Barlow
2023-11-12 18:37:33 +00:00
parent 0131686661
commit 185117843b
6 changed files with 10 additions and 10 deletions

View File

@@ -58,7 +58,7 @@ in {
};
tftp = {
loadAddress = mkOption {
type = types.str;
type = types.ints.unsigned;
description = ''
RAM address at which to load data when transferring via
TFTP. This is not the address of the flash storage,

View File

@@ -106,9 +106,9 @@ in {
cat > $out << EOF
setenv serverip ${tftp.serverip}
setenv ipaddr ${tftp.ipaddr}
tftp 0x$(printf %x ${tftp.loadAddress}) result/firmware.bin
tftp 0x${toHexString tftp.loadAddress} result/firmware.bin
erase 0x$(printf %x ${flash.address}) +${flash.size}
cp.b 0x$(printf %x ${tftp.loadAddress}) 0x$(printf %x ${flash.address}) \''${filesize}
cp.b 0x${toHexString tftp.loadAddress} 0x$(printf %x ${flash.address}) \''${filesize}
echo command line was ${builtins.toJSON (concatStringsSep " " config.boot.commandLine)}
EOF
'';