unable to program Arduino Nano 33 BLE using JTAG

Hi,

I have a JLINK JTAG connected to Arduino Nano 33 BLE and able to connect and flash from JLINK application.

In NRF Connect I see the connection detected.

When trying to flash (Blinky) I have errors

Flashing build to 260111299
west flash -d d:\2023\projects\Nordic\blinky2\build --skip-rebuild -r nrfjprog --dev-id 260111299

-- west flash: using runner nrfjprog
FATAL ERROR: board arduino_nano_33_ble does not support runner nrfjprog
To fix, configure this runner in C:\ncs\v2.3.0\zephyr\boards\arm\arduino_nano_33_ble\board.cmake and rebuild.

How to configure board.cmake? I was trying to modify it but no change.

Kindly advice

I modify board.cmake and restarted, but no luck, no change

# SPDX-License-Identifier: Apache-2.0

board_runner_args(jlink "--device=nRF52840_xxAA" "--speed=4000")
board_runner_args(pyocd "--target=nrf52840" "--frequency=4000000")
board_runner_args(blackmagicprobe "--gdb-serial=/dev/ttyBmpGdb")
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake)
include(${ZEPHYR_BASE}/boards/common/blackmagicprobe.board.cmake)

  • Hello Jan,

    I see. However, I found some time to test now. 

    By just copying the board.cmake file from the nrf52840dk_nrf52840 board, I got the same build error as you posted. The reason is that "nrf5" is not part of the board name. This is checked in NCS\zephyr\boards\common\openocd-nrf5.board.cmake on line 11. 

    So to work around this, you also need to add this line:

    set(OPENOCD_NRF5_SUBFAMILY "nrf52")
    So I ended up with the following board.cmake file:
    # SPDX-License-Identifier: Apache-2.0
    
    set(OPENOCD_NRF5_SUBFAMILY "nrf52")
    board_runner_args(jlink "--device=nRF52840_xxAA" "--speed=4000")
    board_runner_args(pyocd "--target=nrf52840" "--frequency=4000000")
    include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)
    include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
    include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake)
    include(${ZEPHYR_BASE}/boards/common/openocd-nrf5.board.cmake)
    When using this, I could flash the nrf52840 dk with an application built for the arduino nano 33 BLE board, and it was flashed using nrfjprog.
    However, in general we recommend to keep the SDK pristine. So what I would suggest is that you copy the board files for the arduino nano out of the SDK, rename it to something custom, modify those local files, and then you can build for your "custom board". However, that is entirely up to you how you want to do it. 
    Best regards,
    Edvin
  •   

    Hi Edmin,

    Thanks, much appreciate your help. Hope the solution will serve other users as well.

    I will follow the "custom board" solution and follow it.

    Consider the case as resolved.

    Cheer,

    Jan

Related