def METHOD_NAME(source, target, env) -> int:
    env.AutodetectUploadPort([env])
    try:
        bf_passthrough_init(env['UPLOAD_PORT'], env['UPLOAD_SPEED'])
    except PassthroughEnabled as err:
        dbg_print(str(err))
    return reset_to_bootloader(env['UPLOAD_PORT'], env['UPLOAD_SPEED'], env['PIOENV'], source[0])