def METHOD_NAME(cls, cfg, args):
    if args.esp_tool:
        espidf = args.esp_tool
    else:
        espidf = path.join(args.esp_idf_path, 'components', 'esptool_py',
                           'esptool', 'esptool.py')
    return Esp32BinaryRunner(
        cfg, args.esp_device, boot_address=args.esp_boot_address,
        part_table_address=args.esp_partition_table_address,
        app_address=args.esp_app_address, erase=args.erase,
        baud=args.esp_baud_rate, flash_size=args.esp_flash_size,
        flash_freq=args.esp_flash_freq, flash_mode=args.esp_flash_mode,
        espidf=espidf, bootloader_bin=args.esp_flash_bootloader,
        partition_table_bin=args.esp_flash_partition_table,
        no_stub=args.esp_no_stub)