When running
west flash to program my board using the UF2 runner, the process fails with an OSError related to copying the .uf2 file to the UF2 bootloader drive. The error message is:-
Build the application (e.g., Blinky) for a UF2-compatible board.
-
Run
west flashfrom the build directory. -
The process starts, finds the UF2 bootloader drive (
/Volumes/FTHRSNSBOOT), and attempts to copy the.uf2file. -
The process fails with the above OSError.
-
The UF2 runner in Zephyr/NCS is designed to copy the generated
.uf2file to the mounted bootloader volume, which should appear as a USB mass storage device when the board is in bootloader mode. This is the expected workflow for UF2 flashing (Zephyr UF2 Uploader documentation). -
The error occurs during the file copy operation, which suggests a problem with either the source
.uf2file, the destination volume, or the connection between the host and the device.
-
The UF2 runner expects the board to be in bootloader mode and the UF2 volume to be mounted. If the volume is not detected, the
--deviceoption can be used to specify the mount point (Zephyr UF2 Uploader). -
The process is described in the official Zephyr and NCS documentation for UF2-compatible boards (Adafruit Feather nRF52840). and also described in nordic documentation.
-
What could cause an OSError: Input/output error when copying the
.uf2file to the UF2 bootloader drive? -
Are there known issues with UF2 flashing on macOS or with certain versions of the NCS toolchain?
-
Are there recommended troubleshooting steps for verifying the integrity of the
.uf2file or the mounted volume?
The west flash log is as following :
➜ build git:(master) ✗ west flash
-- west flash: rebuilding
[0/5] Performing build step for 'blinky'
ninja: no work to do.
[4/5] cd /Users/fuad/Documents/coding/nrf_...722e/Cellar/cmake/3.21.0/bin/cmake -E true
-- west flash: using runner uf2
-- runners.uf2: Copying UF2 file to '/Volumes/FTHRSNSBOOT'
Traceback (most recent call last):
File "/opt/nordic/ncs/toolchains/ef4fc6722e/bin/west", line 8, in <module>
sys.exit(main())
^^^^^^
File "/opt/nordic/ncs/toolchains/ef4fc6722e/lib/python3.12/site-packages/west/app/main.py", line 1085, in main
app.run(argv or sys.argv[1:])
File "/opt/nordic/ncs/toolchains/ef4fc6722e/lib/python3.12/site-packages/west/app/main.py", line 244, in run
self.run_command(argv, early_args)
File "/opt/nordic/ncs/toolchains/ef4fc6722e/lib/python3.12/site-packages/west/app/main.py", line 505, in run_command
self.run_extension(args.command, argv)
File "/opt/nordic/ncs/toolchains/ef4fc6722e/lib/python3.12/site-packages/west/app/main.py", line 654, in run_extension
self.cmd.run(args, unknown, self.topdir, manifest=self.manifest,
File "/opt/nordic/ncs/toolchains/ef4fc6722e/lib/python3.12/site-packages/west/commands.py", line 194, in run
self.do_run(args, unknown)
File "/opt/nordic/ncs/v3.0.2/zephyr/scripts/west_commands/flash.py", line 33, in do_run
do_run_common(self, my_args, runner_args, domain_file=domains_file)
File "/opt/nordic/ncs/v3.0.2/zephyr/scripts/west_commands/run_common.py", line 331, in do_run_common
prev_runner = do_run_common_image(command, user_args, user_runner_args, used_cmds,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/nordic/ncs/v3.0.2/zephyr/scripts/west_commands/run_common.py", line 506, in do_run_common_image
runner.run(command_name)
File "/opt/nordic/ncs/v3.0.2/zephyr/scripts/west_commands/runners/core.py", line 720, in run
self.do_run(command, **kwargs)
File "/opt/nordic/ncs/v3.0.2/zephyr/scripts/west_commands/runners/uf2.py", line 105, in do_run
self.copy_uf2_to_partition(part)
File "/opt/nordic/ncs/v3.0.2/zephyr/scripts/west_commands/runners/uf2.py", line 88, in copy_uf2_to_partition
copy(self.cfg.uf2_file, part.mountpoint)
File "/opt/nordic/ncs/toolchains/ef4fc6722e/Cellar/[email protected]/3.12.4/Frameworks/Python.framework/Versions/3.12/lib/python3.12/shutil.py", line 435, in copy
copyfile(src, dst, follow_symlinks=follow_symlinks)
File "/opt/nordic/ncs/toolchains/ef4fc6722e/Cellar/[email protected]/3.12.4/Frameworks/Python.framework/Versions/3.12/lib/python3.12/shutil.py", line 266, in copyfile
_fastcopy_fcopyfile(fsrc, fdst, posix._COPYFILE_DATA)
File "/opt/nordic/ncs/toolchains/ef4fc6722e/Cellar/[email protected]/3.12.4/Frameworks/Python.framework/Versions/3.12/lib/python3.12/shutil.py", line 110, in _fastcopy_fcopyfile
raise err from None
File "/opt/nordic/ncs/toolchains/ef4fc6722e/Cellar/[email protected]/3.12.4/Frameworks/Python.framework/Versions/3.12/lib/python3.12/shutil.py", line 103, in _fastcopy_fcopyfile
posix._fcopyfile(infd, outfd, flags)
OSError: [Errno 5] Input/output error: '/Users/fuad/Documents/coding/nrf_sdk/blinky/build/blinky/zephyr/zephyr.uf2' -> '/Volumes/FTHRSNSBOOT/zephyr.uf2'
I also try to drag and drop the file to the disk but I get the same error.
The build configuration is as following.

Please help me fixing this error, I try a lot of things but I am not able to fix it.