Flash a nrf52840dk sniffer board

I programmed a nrf52840dk board (PCA10056 3.0.0 2022.7 1050288497) as a sniffer. It works well.

Now I want to flash it to zephyr samples/basic/blinky by "west flash".
west flash
-- west flash: rebuilding
ninja: no work to do.
-- west flash: using runner nrfjprog
-- runners.nrfjprog: reset after flashing requested
FATAL ERROR: Unable to find a board; is the board connected?

ls -hal /dev/serial/by-id

usb-ZEPHYR_nRF_Sniffer_for_Bluetooth_LE_49F8F9D7E8AE3B9E-if00 -> ../../ttyACM0

I tried to hold RESET button and cycled the power but it still ran into sniffer.

Thanks!

Parents Reply Children
  • USB cable is connected to the "nRF USB" port next to the "IF BOOT/RESET" button.


    After plug in the board, dmesg shows:

    [ +6.918874] usb 3-2: new full-speed USB device number 6 using xhci_hcd
    [ +0.253505] usb 3-2: New USB device found, idVendor=1915, idProduct=522a, bcdDevice= 2.04
    [ +0.000009] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [ +0.000001] usb 3-2: Product: nRF Sniffer for Bluetooth LE
    [ +0.000001] usb 3-2: Manufacturer: ZEPHYR
    [ +0.000001] usb 3-2: SerialNumber: 49F8F9D7E8AE3B9E
    [ +0.003185] cdc_acm 3-2:1.0: ttyACM0: USB ACM device

    ls -hal /dev/serial/by-id
    total 0
    drwxr-xr-x 2 root root 60 Nov 25 14:29 .
    drwxr-xr-x 4 root root 80 Nov 25 14:29 ..
    lrwxrwxrwx 1 root root 13 Nov 25 14:29 usb-ZEPHYR_nRF_Sniffer_for_Bluetooth_LE_49F8F9D7E8AE3B9E-if00 -> ../../ttyACM0

    nrfjprog --version
    nrfjprog version: 10.24.2 external
    JLinkARM.dll version: 7.94e

    source ~/zephyrproject/.venv/bin/activate
    cd ~/zephyrproject/zephyr
    west build -p -b nrf52840dk/nrf52840 samples/basic/blinky
    ...
    [3/135] Generating include/generated/zephyr/version.h
    -- Zephyr version: 4.0.0-rc3 (/home/yc/zephyrproject/zephyr), build: v4.0.0-rc3-227-g9ffc4b1df8a7
    [135/135] Linking C executable zephyr/zephyr.elf
    Memory region Used Size Region Size %age Used
    FLASH: 18732 B 1 MB 1.79%
    RAM: 5696 B 256 KB 2.17%
    IDT_LIST: 0 GB 32 KB 0.00%
    Generating files from /home/yc/zephyrproject/zephyr/build/zephyr/zephyr.elf for board: nrf52840dk

    west flash
    -- west flash: rebuilding
    ninja: no work to do.
    -- west flash: using runner nrfjprog
    -- runners.nrfjprog: reset after flashing requested
    FATAL ERROR: Unable to find a board; is the board connected?

    Then I tried to hold the IF BOOT/RESET button and unplug/plug the USB cable to reboot. The board has no change.

    I'm wondering how I can flash the board back to MCUBoot mode or other program so that I can use west flash.

    Thanks!

Related