Skip to content
Snippets Groups Projects
Commit 4a3ccb48 authored by Jean-Michel Picod's avatar Jean-Michel Picod
Browse files

Allow flashing only the kernel without any app.

parent b22832e9
Branches
No related tags found
No related merge requests found
......@@ -485,6 +485,7 @@ class OpenSKInstaller:
kern_hex.frombytes(kernel.read(), offset=board_props.kernel_address)
final_hex.merge(kern_hex, overlap="error")
if self.args.application:
# Add padding
if board_props.padding_address:
padding_hex = intelhex.IntelHex()
......@@ -546,9 +547,6 @@ class OpenSKInstaller:
self.check_prerequisites()
self.update_rustc_if_needed()
if self.args.application is None:
fatal("Please specify an application to be flashed")
# Compile what needs to be compiled
if self.args.tockos:
self.build_tockos()
......@@ -556,6 +554,8 @@ class OpenSKInstaller:
if self.args.application == "ctap2":
self.generate_crypto_materials(self.args.regenerate_keys)
self.build_opensk()
elif self.args.application is None:
info("No application selected.")
else:
self.build_example()
......@@ -568,16 +568,19 @@ class OpenSKInstaller:
if self.args.tockos:
# Install Tock OS
self.install_tock_os()
# Install padding and application
# Install padding and application if needed
if self.args.application:
self.install_padding()
self.install_tab_file("target/tab/{}.tab".format(self.args.application))
if self.verify_flashed_app(self.args.application):
info("You're all set!")
return 0
error(("It seems that something went wrong. App/example not found "
error(
("It seems that something went wrong. App/example not found "
"on your board. Ensure the connections between the programmer and "
"the board are correct."))
return 1
return 0
if self.args.programmer in ("pyocd", "nordicdfu", "none"):
dest_file = "target/{}_merged.hex".format(self.args.board)
......@@ -734,7 +737,14 @@ if __name__ == "__main__":
"storage (i.e. unplugging the key will reset the key)."),
)
apps_group = main_parser.add_mutually_exclusive_group()
apps_group = main_parser.add_mutually_exclusive_group(required=True)
apps_group.add_argument(
"--no-app",
dest="application",
action="store_const",
const=None,
help=("Doesn't compile nor install any application. Useful when you only "
"want to update Tock OS kernel."))
apps_group.add_argument(
"--opensk",
dest="application",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment