[riot-notifications] [RIOT-OS/RIOT] sys: provide over-the-air update mechanism (#8902)

Koen Zandberg notifications at github.com
Mon Apr 30 10:31:08 CEST 2018


bergzand requested changes on this pull request.



> +
+    if (!from_file(argv[5], sk, sizeof(sk))) {
+        fprintf(stderr, "Error: cannot read keyfile\n");
+        return(1);
+    }
+
+    firmware_size = do_sha256(argv[1], metadata.hash, 0);
+    if (firmware_size == -1) {
+        fprintf(stderr, "Error: cannot read firmware file\n");
+        return(1);
+    }
+
+    /* Generate FW image metadata */
+    memcpy(&metadata.magic_number, "RIOT", 4);
+    metadata.size = firmware_size;
+    sscanf(argv[2], "%x", (unsigned int *)&(metadata.version));

There is a mismatch here in what is expected by `sscanf` and what is provided with the command line.
The make command from the readme:
```
BOARD=samr21-xpro APP_VER=$(date +%s) make -j4 riotboot/flash-slot2
```
supplies the version argument as a decimal number, here it is expected as a hexadecimal number.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/8902#pullrequestreview-116222165
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20180430/87a62edf/attachment.html>


More information about the notifications mailing list