def METHOD_NAME(cls, cfg, args):
    build_conf = BuildConfiguration(cfg.build_dir)
    flash_addr = cls.get_flash_address(args, build_conf)
    ret = PyOcdBinaryRunner(
        cfg, args.target,
        pyocd=args.pyocd,
        flash_addr=flash_addr, erase=args.erase, flash_opts=args.flash_opt,
        gdb_port=args.gdb_port, telnet_port=args.telnet_port, tui=args.tui,
        dev_id=args.dev_id, daparg=args.daparg,
        frequency=args.frequency,
        tool_opt=args.tool_opt)
    daparg = os.environ.get('PYOCD_DAPARG')
    if not ret.daparg_args and daparg:
        ret.logger.warning('PYOCD_DAPARG is deprecated; use --daparg')
        ret.logger.debug('--daparg={} via PYOCD_DAPARG'.format(daparg))
        ret.daparg_args = ['-da', daparg]
    return ret