makerdiary / nrf52840-mdk-usb-dongle

An open-source, small and low-cost USB Dongle that supports Bluetooth 5.4, Bluetooth mesh, Thread, Zigbee, 802.15.4, ANT and 2.4 GHz proprietary protocols
https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/
Other
328 stars 83 forks source link

Device doesn't install UF2 #107

Closed Slyke closed 3 weeks ago

Slyke commented 3 weeks ago

I have a Makerdiary nRF52840 MDK USB Dongle.

Info.txt:

UF2 Bootloader 0.7.1 lib/nrfx (v2.0.0) lib/tinyusb (0.12.0-145-g9775e7691) lib/uf2 (remotes/origin/configupdate-9-gadbb8c7)
Model: Makerdiary nRF52840 MDK USB Dongle
Board-ID: nRF52840-MDK-USB-DONGLE
Date: Jul 20 2023
SoftDevice: not found

I'm trying to set it up for Thread by installing: https://github.com/openthread/ot-nrf528xx/blob/main/src/nrf52840/README.md on it.

Steps (in Docker):

$ git clone https://github.com/openthread/ot-nrf528xx.git
Cloning into 'ot-nrf528xx'...
remote: Enumerating objects: 3308, done.
remote: Counting objects: 100% (797/797), done.
remote: Compressing objects: 100% (187/187), done.
remote: Total 3308 (delta 677), reused 714 (delta 610), pack-reused 2511 (from 1)
Receiving objects: 100% (3308/3308), 5.58 MiB | 10.00 MiB/s, done.
Resolving deltas: 100% (1815/1815), done.

$ cd ot-nrf528xx/

$ git submodule update --init
Submodule 'openthread' (https://github.com/openthread/openthread.git) registered for path 'openthread'
Cloning into '/ot-nrf528xx/openthread'...
Submodule path 'openthread': checked out 'd3d91634f465822b3a4c23da1347efc9a47f2de4'

$ ./script/bootstrap
++ dirname ./script/bootstrap
+ ./script/../openthread/script/bootstrap
+ main
+ install_packages
+ PM=source
+ command -v apt-get
/usr/bin/apt-get
+ PM=apt
+ install_packages_apt
+ echo 'Installing toolchain dependencies...'
Installing toolchain dependencies...
+ sudo apt-get update
Hit:1 http://archive.ubuntu.com/ubuntu jammy InRelease
Get:2 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [128 kB]
Get:3 http://security.ubuntu.com/ubuntu jammy-security InRelease [129 kB]
Get:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [127 kB]
Fetched 384 kB in 2s (243 kB/s)
Reading package lists... Done
+ sudo apt-get --no-install-recommends install -y g++ lsb-release cmake ninja-build shellcheck
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
g++ is already the newest version (4:11.2.0-1ubuntu1).
lsb-release is already the newest version (11.1.0ubuntu4).
ninja-build is already the newest version (1.10.1-1).
shellcheck is already the newest version (0.8.0-2).
cmake is already the newest version (3.22.1-1ubuntu1.22.04.2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
+ echo 'Installing GNU Arm Embedded Toolchain...'
Installing GNU Arm Embedded Toolchain...
++ lsb_release -is
+ PLATFORM=Ubuntu
++ arch
+ ARCH=x86_64
+ '[' Ubuntu = Raspbian ']'
+ '[' Ubuntu = Ubuntu ']'
+ sudo apt-get --no-install-recommends install -y bzip2 ca-certificates wget
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
bzip2 is already the newest version (1.0.8-5build1).
ca-certificates is already the newest version (20240203~22.04.1).
wget is already the newest version (1.21.2-2ubuntu1.1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
+ cd /tmp
+ wget --tries 4 --no-check-certificate --quiet -c https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2020q2/gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2
+ sudo tar xjf gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2 -C /opt
+ rm gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2
+ sudo ln -s -f /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-addr2line /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-ar /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-as /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-c++ /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-c++filt /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-cpp /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-elfedit /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-g++ /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-gcc /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-gcc-9.3.1 /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-gcc-ar /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-gcc-nm /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-gcc-ranlib /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-gcov /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-gcov-dump /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-gcov-tool /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-gdb /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-gdb-add-index /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-gdb-add-index-py /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-gdb-py /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-gprof /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-ld /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-ld.bfd /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-nm /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-objcopy /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-objdump /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-ranlib /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-readelf /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-size /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-strings /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-strip /usr/local/bin/.
+ '[' Ubuntu '!=' Raspbian ']'
+ install_packages_pretty_format
+ echo 'Installing pretty tools useful for code contributions...'
Installing pretty tools useful for code contributions...
+ sudo apt-get --no-install-recommends install -y clang-format-14 clang-tidy-14
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
clang-format-14 is already the newest version (1:14.0.0-1ubuntu1.1).
clang-tidy-14 is already the newest version (1:14.0.0-1ubuntu1.1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
+ python3 -m pip install yapf==0.31.0
Requirement already satisfied: yapf==0.31.0 in /usr/local/lib/python3.10/dist-packages (0.31.0)
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable.It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning.
+ python3 -m pip install mdv
Requirement already satisfied: mdv in /usr/local/lib/python3.10/dist-packages (1.7.5)
Requirement already satisfied: markdown in /usr/local/lib/python3.10/dist-packages (from mdv) (3.7)
Requirement already satisfied: pygments in /usr/local/lib/python3.10/dist-packages (from mdv) (2.18.0)
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable.It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning.
+ command -v shfmt
/usr/bin/shfmt
+ echo 'bootstrap completed successfully.'
bootstrap completed successfully.

$ ./script/build nrf52840 USB_trans -DOT_BOOTLOADER=USB
+ OT_CMAKE_NINJA_TARGET=
+ NRF_PLATFORMS=(nrf52811 nrf52833 nrf52840)
+ readonly NRF_PLATFORMS
+ NRF_BUILD_TYPES=(UART_trans USB_trans SPI_trans_NCP RTT_trans soft_crypto soft_crypto_threading)
+ readonly NRF_BUILD_TYPES
++ pwd
+ OT_SRCDIR=/ot-nrf528xx
+ readonly OT_SRCDIR
+ OT_OPTIONS=("-DCMAKE_BUILD_TYPE=MinSizeRel" "-DBUILD_TESTING=OFF" "-DOT_PLATFORM=external" "-DOT_SLAAC=ON")
+ readonly OT_OPTIONS
+ main nrf52840 USB_trans -DOT_BOOTLOADER=USB
+ [[ 3 == 0 ]]
+ local platform=nrf52840
+ echo nrf52811 nrf52833 nrf52840
+ grep -wq nrf52840
+ [[ 3 == 1 ]]
+ local nrf_build_type=USB_trans
+ echo UART_trans USB_trans SPI_trans_NCP RTT_trans soft_crypto soft_crypto_threading
+ grep -wq USB_trans
+ shift
+ shift
+ local_options=()
+ local local_options
+ options=('-DCMAKE_BUILD_TYPE=MinSizeRel' '-DBUILD_TESTING=OFF' '-DOT_PLATFORM=external' '-DOT_SLAAC=ON')
+ local options
+ case "${platform}" in
+ local_options+=("-DCMAKE_TOOLCHAIN_FILE=src/${platform}/arm-none-eabi.cmake")
+ case "${nrf_build_type}" in
+ options+=("${local_options[@]}" "-DOT_USB=ON" "-DOT_EXTERNAL_MBEDTLS=nordicsemi-mbedtls")
+ options+=("$@")
+ build -DNRF_PLATFORM=nrf52840 -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_TESTING=OFF -DOT_PLATFORM=external -DOT_SLAAC=ON -DCMAKE_TOOLCHAIN_FILE=src/nrf52840/arm-none-eabi.cmake -DOT_USB=ON -DOT_EXTERNAL_MBEDTLS=nordicsemi-mbedtls -DOT_BOOTLOADER=USB
+ local builddir=build
+ mkdir -p build
+ cd build
+ cmake -GNinja -DOT_COMPILE_WARNING_AS_ERROR=ON -DNRF_PLATFORM=nrf52840 -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_TESTING=OFF -DOT_PLATFORM=external -DOT_SLAAC=ON -DCMAKE_TOOLCHAIN_FILE=src/nrf52840/arm-none-eabi.cmake -DOT_USB=ON -DOT_EXTERNAL_MBEDTLS=nordicsemi-mbedtls -DOT_BOOTLOADER=USB /ot-nrf528xx
-- The C compiler identification is GNU 9.3.1
-- The CXX compiler identification is GNU 9.3.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/local/bin/arm-none-eabi-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/local/bin/arm-none-eabi-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- OpenThread Source Directory: /ot-nrf528xx/openthread
-- OT_APP_CLI=ON
-- OT_APP_NCP=ON
-- OT_APP_RCP=ON
-- OT_FTD=ON
-- OT_MTD=ON
-- OT_RCP=ON
-- - - - - - - - - - - - - - - - -
-- OpenThread ON/OFF/Unspecified Configs
-- OT_15_4=""
-- OT_ANDROID_NDK=""
-- OT_ANYCAST_LOCATOR=""
-- OT_ASSERT=""
-- OT_BACKBONE_ROUTER=""
-- OT_BACKBONE_ROUTER_DUA_NDPROXYING=""
-- OT_BACKBONE_ROUTER_MULTICAST_ROUTING=""
-- OT_BLE_TCAT=""
-- OT_BORDER_AGENT=""
-- OT_BORDER_AGENT_EPSKC=""
-- OT_BORDER_AGENT_ID=""
-- OT_BORDER_ROUTER=""
-- OT_BORDER_ROUTING=""
-- OT_BORDER_ROUTING_DHCP6_PD=""
-- OT_BORDER_ROUTING_COUNTERS=""
-- OT_CHANNEL_MANAGER=""
-- OT_CHANNEL_MANAGER_CSL=""
-- OT_CHANNEL_MONITOR=""
-- OT_COAP=""
-- OT_COAP_BLOCK=""
-- OT_COAP_OBSERVE=""
-- OT_COAPS=""
-- OT_COMMISSIONER=""
-- OT_CSL_AUTO_SYNC=""
-- OT_CSL_DEBUG=""
-- OT_CSL_RECEIVER=""
-- OT_CSL_RECEIVER_LOCAL_TIME_SYNC=""
-- OT_DATASET_UPDATER=""
-- OT_DEVICE_PROP_LEADER_WEIGHT=""
-- OT_DHCP6_CLIENT=""
-- OT_DHCP6_SERVER=""
-- OT_DIAGNOSTIC=""
-- OT_DNS_CLIENT=""
-- OT_DNS_CLIENT_OVER_TCP=""
-- OT_DNS_DSO=""
-- OT_DNS_UPSTREAM_QUERY=""
-- OT_DNSSD_DISCOVERY_PROXY=""
-- OT_DNSSD_SERVER=""
-- OT_DUA=""
-- OT_DYNAMIC_STORE_FRAME_AHEAD_COUNTER=""
-- OT_ECDSA=""
-- OT_EXTERNAL_HEAP=""
-- OT_FIREWALL=""
-- OT_HISTORY_TRACKER=""
-- OT_IP6_FRAGM=""
-- OT_JAM_DETECTION=""
-- OT_JOINER=""
-- OT_LINK_METRICS_INITIATOR=""
-- OT_LINK_METRICS_MANAGER=""
-- OT_LINK_METRICS_SUBJECT=""
-- OT_LINK_RAW=""
-- OT_LOG_LEVEL_DYNAMIC=""
-- OT_MAC_FILTER=""
-- OT_MDNS=""
-- OT_MESH_DIAG=""
-- OT_MESSAGE_USE_HEAP=""
-- OT_MLE_LONG_ROUTES=""
-- OT_MLR=""
-- OT_MULTIPAN_RCP=""
-- OT_MULTIPLE_INSTANCE=""
-- OT_NAT64_BORDER_ROUTING=""
-- OT_NAT64_TRANSLATOR=""
-- OT_NEIGHBOR_DISCOVERY_AGENT=""
-- OT_NETDATA_PUBLISHER=""
-- OT_NETDIAG_CLIENT=""
-- OT_NETDIAG_VENDOR_INFO=""
-- OT_OPERATIONAL_DATASET_AUTO_INIT=""
-- OT_OTNS=""
-- OT_PING_SENDER=ON --> OPENTHREAD_CONFIG_PING_SENDER_ENABLE=1
-- OT_PLATFORM_BOOTLOADER_MODE=""
-- OT_PLATFORM_DNSSD=""
-- OT_PLATFORM_KEY_REF=""
-- OT_PLATFORM_LOG_CRASH_DUMP=""
-- OT_PLATFORM_NETIF=""
-- OT_PLATFORM_POWER_CALIBRATION=""
-- OT_PLATFORM_UDP=""
-- OT_REFERENCE_DEVICE=""
-- OT_SERVICE=""
-- OT_SETTINGS_RAM=""
-- OT_SLAAC=ON --> OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE=1
-- OT_SNTP_CLIENT=""
-- OT_SRP_ADV_PROXY=""
-- OT_SRP_CLIENT=""
-- OT_SRP_SERVER=""
-- OT_TCP=""
-- OT_TIME_SYNC=""
-- OT_TREL=""
-- OT_TX_BEACON_PAYLOAD=""
-- OT_TX_QUEUE_STATS=""
-- OT_UDP_FORWARD=""
-- OT_UPTIME=""
-- OT_VERHOEFF_CHECKSUM=""
-- OT_WAKEUP_COORDINATOR=""
-- OT_WAKEUP_END_DEVICE=""
-- - - - - - - - - - - - - - - - -
-- OT_PLATFORM="external"
-- OT_THREAD_VERSION="1.4" -> OPENTHREAD_CONFIG_THREAD_VERSION=OT_THREAD_VERSION_1_4
-- OT_LOG_LEVEL=""
-- OT_LOG_OUTPUT=""
-- OT_VENDOR_NAME=""
-- OT_VENDOR_MODEL=""
-- OT_VENDOR_SW_VERSION=""
-- OT_POWER_SUPPLY=""
-- OT_MAC_CSL_REQUEST_AHEAD_US=""
-- OT_MLE_MAX_CHILDREN=""
-- OT_RCP_RESTORATION_MAX_COUNT=""
-- OT_RCP_TX_WAIT_TIME_SECS=""
-- OpenThread CMake build type: MinSizeRel
-- Package Name: OPENTHREAD
-- Setting default package version: thread-reference-20230706-973-gd3d91634f
-- Package Version: thread-reference-20230706-973-gd3d91634f
-- Configuring done (1.2s)
-- Generating done (0.1s)
-- Build files have been written to: /ot-nrf528xx/build
+ [[ -n '' ]]
+ ninja
[2/836] cd /ot-nrf528xx/build/openthread && /usr/local/lib/python3.10/dist-packages/cmake/data/bin/cmake -DLIST="OPENTHREAD_CONFIG_PING_SENDER_ENABLE=1;OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE=1..._TRIGGER_ENABLED=1;OPENTHREAD_CORE_CONFIG_PLATFORM_CHECK_FILE="openthread-core-nrf52840-config-check.h";MBEDTLS_CONFIG_FILE="nrf-config.h"" -P /ot-nrf528xx/openthread/etc/cmake/print.cmake
OPENTHREAD_CONFIG_PING_SENDER_ENABLE=1
OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE=1
OPENTHREAD_CONFIG_THREAD_VERSION=OT_THREAD_VERSION_1_4
OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS=0
OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS_MANAGEMENT=1
PACKAGE_NAME=OPENTHREAD
OPENTHREAD_CONFIG_NCP_INFRA_IF_ENABLE=0
OPENTHREAD_CONFIG_NCP_DNSSD_ENABLE=0
OPENTHREAD_CONFIG_NCP_HDLC_ENABLE=1
OPENTHREAD_PLATFORM_CORE_CONFIG_FILE=openthread-core-nrf52840-config.h
OPENTHREAD_CORE_CONFIG_PLATFORM_CHECK_FILE=openthread-core-nrf52840-config-check.h
MBEDTLS_USER_CONFIG_FILE=nrf52840-mbedtls-config.h
USB_CDC_AS_SERIAL_TRANSPORT=1
APP_USBD_NRF_DFU_TRIGGER_ENABLED=1
OPENTHREAD_CORE_CONFIG_PLATFORM_CHECK_FILE=openthread-core-nrf52840-config-check.h
MBEDTLS_CONFIG_FILE=nrf-config.h
[836/836] Linking CXX executable bin/ot-ncp-ftd
+ cd /ot-nrf528xx

$ pip install --pre -U git+https://github.com/makerdiary/uf2utils.git@main
Collecting git+https://github.com/makerdiary/uf2utils.git@main
  Cloning https://github.com/makerdiary/uf2utils.git (to revision main) to /tmp/pip-req-build-g64j_w56
  Running command git clone --filter=blob:none --quiet https://github.com/makerdiary/uf2utils.git /tmp/pip-req-build-g64j_w56
  Resolved https://github.com/makerdiary/uf2utils.git to commit 61d9f3ff4913461b9813e666cce62b022652144a
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: uf2conv
  Building wheel for uf2conv (setup.py) ... done
  Created wheel for uf2conv: filename=uf2conv-0.0.1-py3-none-any.whl size=7209 sha256=f920018b960b8a45104e2f7d7b8df3ce7c4c9d98cec304593df468121e116fa8
  Stored in directory: /tmp/pip-ephem-wheel-cache-dsrlfcmz/wheels/79/6f/1d/152515e84aa45c5388aa8043e1d502ac3a294bdd967bda0887
Successfully built uf2conv
Installing collected packages: uf2conv
Successfully installed uf2conv-0.0.1
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable.It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning.

$  uf2conv -f 0xADA52840 -c -b 0x1000 -o build/bin/ot-cli-ftd.uf2 build/bin/ot-cli-ftd
Converted to uf2, output size: 2419712, start address: 0x1000
Wrote 2419712 bytes to build/bin/ot-cli-ftd.uf2

On Windows 11:

  1. Insert the nRF52840 device, holding down the button. Light comes on and is green.
  2. A popup shows asking what I want to do. I open as a folder.
  3. I see 3 files CURRENT.UF2, INDEX.HTM and INFO_UF2.TXT
  4. The instructions are not clear Drag and drop the UF2 file onto the UF2BOOT volume.. Do I need to rename it to CURRENT.UF2, or just leave it as ot-cli-ftd.uf2? Either way I've attempted both. I drag the file into the folder for the nRF52840 device and I see the light is rapidly flashing red. It takes about 1 minute to finish copying over, with the light flashing red the entire time.
  5. It never stops flashing red. I've left it for hours, with renaming the file to CURRENT.UF2 and also ot-cli-ftd.uf2. If I unplug the device and plug it back in with bootloader mode enabled, the original CURRENT.UF2 file is there. I have tried compiling the binaries with -DOT_BOOTLOADER=USB set and not set.
Slyke commented 3 weeks ago

I have also attempted to flash the device using nRF Connect.

If plugging it in in non-DFU mode it never finishes mapping memory for the device: image

If plugging it in with DFU enabled, it cannot flash it, as it errors with No operation possible: image

Slyke commented 3 weeks ago

I have attempted to flash it with nrfutil:

$ sudo nrfutil dfu usb-serial -pkg ot-cli-ftd-dfu.zip -p /dev/ttyACM0
  [------------------------------------]    0%2024-11-02 04:29:22,398 No Libusb1 context found, but is required to use DFU trigger. This likely happens because the libusb1-0 binaries are missing from your system, or Python is unable to locate them.

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/serial/serialposix.py", line 322, in open
    self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
PermissionError: [Errno 1] Operation not permitted: '/dev/ttyACM0'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/nordicsemi/dfu/dfu_transport_serial.py", line 198, in open
    self.serial_port = Serial(port=self.com_port,
  File "/usr/local/lib/python3.10/dist-packages/serial/serialutil.py", line 244, in __init__
    self.open()
  File "/usr/local/lib/python3.10/dist-packages/serial/serialposix.py", line 325, in open
    raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
serial.serialutil.SerialException: [Errno 1] could not open port /dev/ttyACM0: [Errno 1] Operation not permitted: '/dev/ttyACM0'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/nrfutil", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/nordicsemi/__main__.py", line 1032, in usb_serial
    do_serial(package, port, connect_delay, flow_control, packet_receipt_notification, baud_rate, serial_number, False,
  File "/usr/local/lib/python3.10/dist-packages/nordicsemi/__main__.py", line 988, in do_serial
    dfu.dfu_send_images()
  File "/usr/local/lib/python3.10/dist-packages/nordicsemi/dfu/dfu.py", line 127, in dfu_send_images
    self._dfu_send_image(self.manifest.application)
  File "/usr/local/lib/python3.10/dist-packages/nordicsemi/dfu/dfu.py", line 88, in _dfu_send_image
    self.dfu_transport.open()
  File "/usr/local/lib/python3.10/dist-packages/nordicsemi/dfu/dfu_transport_serial.py", line 202, in open
    raise NordicSemiException("Serial port could not be opened on {0}"
pc_ble_driver_py.exceptions.NordicSemiException: Serial port could not be opened on /dev/ttyACM0. Reason: could not open port /dev/ttyACM0: [Errno 1] Operation not permitted: '/dev/ttyACM0'

In DFU and non-DFU mode, but it can't connect.

Slyke commented 3 weeks ago

Okay, figured it out. It has to be converted to a hex file first, then a uf2. Can just drag the file as is into the uf2boot drive, doesn't need renaming.