imgtool: change --max-align default value
The value of `--max-align` parameter passed to imgtool can never be
less than the value of `--align` parameter. At present the default
value of `--max-align` is fixed at 8. This forces user to pass the
parameter even when its value can be safely inferred.
Change the default value of the `--max-align` parameter to the larger
of the two values: `--align` or 8. Consequently, the user is required
to pass the parameter only if the flash alignment of the primary and
secondary slot differ.
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
diff --git a/scripts/imgtool/main.py b/scripts/imgtool/main.py
index e3f2775..fc56ee4 100755
--- a/scripts/imgtool/main.py
+++ b/scripts/imgtool/main.py
@@ -295,7 +295,10 @@
@click.option('--align', type=click.Choice(['1', '2', '4', '8', '16', '32']),
required=True)
@click.option('--max-align', type=click.Choice(['8', '16', '32']),
- required=False)
+ required=False,
+ help='Maximum flash alignment. Set if flash alignment of the '
+ 'primary and secondary slot differ and any of them is larger '
+ 'than 8.')
@click.option('--public-key-format', type=click.Choice(['hash', 'full']),
default='hash', help='In what format to add the public key to '
'the image manifest: full key or hash of the key.')