Failed to flash with nRF Connect

Hello.

Thank you very much for releasing nRF Connect SDK v3.0.0-preview1.

I quickly tried the sample program, and while the build was successful, I encountered an issue with the flash operation.
The error is as follows:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "C:\ncs\toolchains\8bd3ff36a2\opt\bin\Scripts\west.exe\__main__.py", line 7, in <module>
File "C:\ncs\toolchains\8bd3ff36a2\opt\bin\Lib\site-packages\west\app\main.py", line 1085, in main
app.run(argv or sys.argv[1:])
File "C:\ncs\toolchains\8bd3ff36a2\opt\bin\Lib\site-packages\west\app\main.py", line 244, in run
self.run_command(argv, early_args)
File "C:\ncs\toolchains\8bd3ff36a2\opt\bin\Lib\site-packages\west\app\main.py", line 505, in run_command
self.run_extension(args.command, argv)
File "C:\ncs\toolchains\8bd3ff36a2\opt\bin\Lib\site-packages\west\app\main.py", line 623, in run_extension
self.cmd = self.extensions[name].factory()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ncs\toolchains\8bd3ff36a2\opt\bin\Lib\site-packages\west\commands.py", line 546, in __call__
mod = _commands_module_from_file(self.py_file)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ncs\toolchains\8bd3ff36a2\opt\bin\Lib\site-packages\west\commands.py", line 701, in _commands_module_from_file
spec.loader.exec_module(mod)
File "<frozen importlib._bootstrap_external>", line 995, in exec_module
File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
File "C:\ncs\v3.0.0-preview1\zephyr\scripts\west_commands\flash.py", line 11, in <module>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

In the "jlink.py" file, the "ProgramFiles(x86)" environment variable could not be found.
However, of course, the environment variable exists.
I created a simple Python script as shown below and executed it on the same PC, and the "ProgramFiles(x86)" environment variable was found.

Fullscreen
1
2
3
4
import os
for key, value in os.environ.items():
print(f"{key}: {value}")
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Fullscreen
1
2
3
4
5
6
..
PROGRAMDATA: C:\ProgramData
PROGRAMFILES: C:\Program Files
PROGRAMFILES(X86): C:\Program Files (x86)
PROGRAMW6432: C:\Program Files
..
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

I also added the same code to the "jlink.py" file, but it still couldn't find the "ProgramFiles(x86)" environment variable.

Fullscreen
1
2
3
4
5
..
PROGRAMDATA: C:\ProgramData
PROGRAMFILES: C:\Program Files
PROGRAMW6432: C:\Program Files
..
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

This seems to be more of a Python-related question than an nRF Connect SDK issue, but what could be causing this discrepancy?

Thanks for reading.

a.da

P.S.
By the way, as a side note, my security software flagged the following files included in SDK Toolchain v3.0.0-preview1.
I hope this is just a false positive.

  • arm-zephyr-eabi-objcopy.exe
  • arm-zephyr-eabi-readelf.exe