def parse_args(): parser = ScriptArgumentsParser() bootloader_group = parser.add_argument_group('bootloader options') bootloader_group = bootloader_group.add_mutually_exclusive_group() bootloader_group.add_argument('-b', '--bootloader', metavar='<bootloader>', type=str, help='path to bootloader') bootloader_group.add_argument('--nobootloader', action='store_true', help='do not flash bootloader') config_group = parser.add_argument_group('configuration options') config_group.add_argument('--cfg', metavar='<config_path>', type=str, help='configuration file') config_group.add_argument('--id', metavar='<serial_number>', type=str, dest='device_id', help='device serial number') config_group.add_argument('--jlink_path', metavar='<jlink_path>', type=str, help='path to jlink') security_group = parser.add_argument_group('security options') security_group.add_argument('--secure_config', metavar='<security_cfg_path>', dest='secure_config', help='path to secure config') security_group.add_argument( '--keys', metavar='<keys_path>', dest='keys', help='path to keys to be written to OTP. This file is required ' 'also for secure image generation.') parser.add_argument('binary', metavar='<app_binary>', type=str, help='path to binary to flash') parser.add_revision_args() args = parser.parse_args() return args.binary, args.bootloader, args.nobootloader, args.cfg, args.device_id, \ args.jlink_path, args.secure_config, args.keys, args.prod_id
def parse_args(): parser = ScriptArgumentsParser() parser.add_revision_args() parser.add_argument('jlink_number', nargs='?', type=str, help='JLink number') parser.add_argument('--jlink_path', type=str, help='path to JLink') args = parser.parse_args() return args.prod_id, args.jlink_number, args.jlink_path
def parse_args(): parser = ScriptArgumentsParser() parser.add_interface_args() parser.add_argument('--secure_cfg', metavar='<file_path>', dest='secure_cfg_file', help='path to DA1469x-00 secure configuration file') parser.add_argument('--keys', metavar='<file_path>', dest='keys_file', help='path to DA1469x-00 keys file') args = parser.parse_args() cli, serial = parser.get_interface_from_args(args) return args.secure_cfg_file, args.keys_file, cli, serial
def parse_args(): parser = ScriptArgumentsParser() parser.add_revision_args() parser.add_argument('-o', metavar='<file>', dest='output_file', help='output file') parser.add_argument('-ec', '--elliptic_curve', dest='elliptic_curve', help='elliptic curve (omitted for DA1469x devices)', choices=[e.value for e in ALLOWED_ELLIPTIC_CURVES]) args = parser.parse_args() return args.output_file, args.elliptic_curve, args.prod_id
def parse_args(): parser = ScriptArgumentsParser() parser.add_interface_args() args = parser.parse_args() cli, serial = parser.get_interface_from_args(args) return cli, serial
def parse_args(): parser = ScriptArgumentsParser() parser.add_argument('bin_file', type=str, help='path to app binary') parser.add_argument('--image', metavar='image_file', dest='image_file', type=str, help='output file with FLASH image') parser.add_argument('--sw_version', metavar='sw_version_file', dest='sw_version_file', type=str, help='version file used for binary') parser.add_config_args() args = parser.parse_args() return args.bin_file, args.image_file, args.sw_version_file, args.header_config, \ args.flash_config
def parse_args(): parser = ScriptArgumentsParser() parser.add_argument('-cfg', metavar='<configuration_file>', dest='configuration_file', help='configuration file') parser.add_argument('--product_keys', help='product keys file') parser.add_argument('--pub_key_idx', help='index of public key used in image signature ' 'verification') parser.add_argument('--key_revocations', nargs='+', help='indexes of keys to revoke') add_device_args(parser) args = parser.parse_args() return args.configuration_file, args.product_keys, args.prod_id, args.pub_key_idx, \ getattr(args, 'elliptic_curve', None), getattr(args, 'hash_method', None), \ args.key_revocations, getattr(args, 'min_version', None), \ getattr(args, 'sym_key_idx', None), getattr(args, 'nonce', None), \ getattr(args, 'cs_sec_boot', None)
def parse_args(): parser = ScriptArgumentsParser() parser.add_interface_args() parser.add_argument('--prod_header', '-ph', action='store_true', help='program product header (DA1469x-00 only)') parser.add_argument('image_file', type=str, nargs='?', help='path to image') parser.add_config_args() args = parser.parse_args() cli, serial = parser.get_interface_from_args(args) return args.image_file, cli, serial, args.prod_header, args.header_config, args.flash_config
def parse_args(): parser = ScriptArgumentsParser() parser.add_interface_args() parser.add_argument('image_file', type=str, nargs='?', help='path to image') parser.add_argument('--secure_cfg', metavar='<file_path>', dest='secure_cfg_file', help='path to DA1469x-00 secure configuration file') parser.add_argument('--keys', metavar='<file_path>', dest='keys_file', help='path to DA1469x-00 keys file') parser.add_config_args() args = parser.parse_args() cli, serial = parser.get_interface_from_args(args) return args.image_file, args.secure_cfg_file, args.keys_file, cli, serial, args.header_config, \ args.flash_config
def parse_args(): parser = ScriptArgumentsParser() parser.add_argument('--cfg', type=str, help='config path') parser.add_argument('--id', type=str, help='device serial number') parser.add_revision_args() parser.add_argument('--port', type=int, help='GDB port') parser.add_argument('--log', type=str, help='JLink log') parser.add_argument('--trc', type=str, help='target reset command') parser.add_argument('--jlink_path', type=str, help='JLink path') args = parser.parse_args() return args.cfg, args.prod_id, args.id, args.port, args.log, args.trc, args.jlink_path
def parse_args(): parser = ScriptArgumentsParser() parser.add_argument('binary', metavar='bin_file', type=str, help='file with application binary') parser.add_argument('image', metavar='image_file', type=str, nargs='?', help='output file with image for SUOTA') parser.add_revision_args() parser.add_argument('--sw_version', metavar='sw_version_file', dest='sw_version_file', type=str, help='version file used for binary') parser.add_argument('-s', '--sec_cfg', metavar='security_config', dest='security_config_file', type=str, help='configuration file for secure image (forces secure image)') parser.add_argument('--prod_keys', metavar='product_keys', dest='keys_file', type=str, help='keys file for secure image') args = parser.parse_args() return args.binary, args.image, args.prod_id, args.sw_version_file, args.security_config_file, \ args.keys_file
def parse_args(): parser = ScriptArgumentsParser() parser.add_revision_args() parser.add_config_args() parser.add_argument('-sf', '--select_flash', type=str, help='preselect Flash type') parser.add_argument( '--default_img_addr', action='store_true', help='use default active and update fw image addresses') args = parser.parse_args() return args.prod_id, args.flash_config, args.header_config, args.select_flash, \ args.default_img_addr
def parse_args(): parser = ScriptArgumentsParser() parser.add_argument('--cfg', metavar='<cfg_path>', type=str, help='config path') parser.add_argument('--id', metavar='<serial_number>', type=str, help='device serial number') parser.add_argument('--arm_gcc_path', metavar='<arm_gcc_path>', type=str, help='path to cross compiler') parser.add_argument('path', metavar='<project_output_path>', type=str, help='folder which contains the binary you want to program') args = parser.parse_args() return args.path, args.cfg, args.id, args.arm_gcc_path