예제 #1
0
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
예제 #2
0
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
예제 #3
0
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
예제 #4
0
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
예제 #5
0
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
예제 #6
0
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