cannot flash hello_world, this time on Windows 11

My computer is running Windows 11. The board is an nRF9160-DK.  I'm working through VSCode environment. All nRF libraries are up to date according to RF Connect for Desktop v4.1.2.

I created a new application and used the hello_world template. Here is the code for hello_world.

/*
 * Copyright (c) 2012-2014 Wind River Systems, Inc.
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#include <zephyr/kernel.h>

int main(void)
{
    printk("Hello World! %s\n", CONFIG_BOARD);
    return 0;
}

The code compiles successfully by using the Build button in the Actions section of the UI.

Then I push the Flash button in the Actions section of the UI with the following output to the terminal window.

 *  Executing task: nRF Connect: Build: hello_world/build (active)

Building hello_world
C:\windows\system32\cmd.exe /d /s /c "west build --build-dir c:/nordicSemi/hello_world/build c:/nordicSemi/hello_world"

ninja: no work to do.
 *  Terminal will be reused by tasks, press any key to close it.

 *  Executing task: nRF Connect: Flash: hello_world/build (active)

Flashing build to 960025583
C:\windows\system32\cmd.exe /d /s /c "west flash -d c:\nordicSemi\hello_world\build --skip-rebuild --dev-id 960025583 --erase"

-- west flash: using runner nrfjprog
-- runners.nrfjprog: mass erase requested
-- runners.nrfjprog: Flashing file: c:\nordicSemi\hello_world\build\zephyr\zephyr.hex
[error] [ Worker] - Encountered unexpected debug port ID 6, expected 2
[error] [ Client] - Encountered error -5: Command read_device_info executed for 14 milliseconds with result -5
[error] [ Client] - Encountered error -5: Command read_memory_descriptors executed for 46 milliseconds with result -5
Failed to read device memories.
[error] [  nRF52] - Device memory generation failed.
[error] [ Worker] - Detected CPU core "235012351" does match expected CPU core "234881279"
ERROR: The --family option given with the command (or the default from
ERROR: nrfjprog.ini) does not match the device connected.
NOTE: For additional output, try running again with logging enabled (--log).
NOTE: Any generated log error messages will be displayed.
FATAL ERROR: command exited with status 18: nrfjprog --program 'c:\nordicSemi\hello_world\build\zephyr\zephyr.hex' --chiperase --verify -f NRF52 --snr 960025583

 *  The terminal process terminated with exit code: 18.
 *  Terminal will be reused by tasks, press any key to close it.

Parents
  • What is the target/board in your build configuration on gui in the VS code extension?

    If you're trying to flash the nRF52 on the board, there's a build target for that. (And you need to flip the PROG/DEBUG white switch SW10)

    If you're trying to flash the nRF9160, then there is a different target for that. (As well as a secure and nonsecure target)

    Based on your error, I could replicate this if I tried to flash the nRF52, and the nRF52 was the build target, but the switch was flipped to nRF91 for programming.

    EDIT: I see here that you were able to resolve, and build target was indeed the issue.

    Best wishes.

Reply
  • What is the target/board in your build configuration on gui in the VS code extension?

    If you're trying to flash the nRF52 on the board, there's a build target for that. (And you need to flip the PROG/DEBUG white switch SW10)

    If you're trying to flash the nRF9160, then there is a different target for that. (As well as a secure and nonsecure target)

    Based on your error, I could replicate this if I tried to flash the nRF52, and the nRF52 was the build target, but the switch was flipped to nRF91 for programming.

    EDIT: I see here that you were able to resolve, and build target was indeed the issue.

    Best wishes.

Children
No Data
Related