def METHOD_NAME(ctx, serial_port, board=DEFAULT_BOARD_NAME,
          output_name=DEFAULT_OUTPUT_NAME, build_dir=DEFAULT_BUILD_DIR):
    """Flash an Arduino based application"""
    build_dir = os.path.abspath(os.path.join(build_dir, output_name))
    bin_file = f"{build_dir}/{os.path.basename(build_dir)}.ino.bin"
    check_board(ctx, board)
    ctx.run(f"{ctx.arduino_cli} upload -p {serial_port} --fqbn {board} -v --input-file {bin_file} {build_dir}")