CMake Error at C:/ncs/v2.9.0/zephyr/cmake/modules/boards.cmake:196 (message): Error finding board: nrf52833dk

Hi guys, I am using the SDK v2.9.0 and the toolchains b620d30767. To add the build configuration for the sample peripheral_uart, the console print some error log.The log as below:

uilding peripheral_uart

-- west build: generating a build system
Loading Zephyr module(s) (Zephyr base): sysbuild_default
-- Found Python3: C:/ncs/toolchains/b620d30767/opt/bin/python.exe (found suitable version "3.12.4", minimum required is "3.8") found components: Interpreter
-- Cache files will be written to: C:/ncs/v2.9.0/zephyr/.cache
-- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
CMake Error at C:/ncs/v2.9.0/zephyr/cmake/modules/boards.cmake:196 (message):
Error finding board: nrf52833dk

Error message: Traceback (most recent call last):

File "C:\ncs\v2.9.0\zephyr\scripts\list_boards.py", line 469, in <module>
dump_v2_boards(args)
File "C:\ncs\v2.9.0\zephyr\scripts\list_boards.py", line 416, in dump_v2_boards
boards = find_v2_boards(args)
^^^^^^^^^^^^^^^^^^^^
File "C:\ncs\v2.9.0\zephyr\scripts\list_boards.py", line 341, in find_v2_boards
b, e = load_v2_boards(args.board, board_yml, systems)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ncs\v2.9.0\zephyr\scripts\list_boards.py", line 230, in load_v2_boards
b = yaml.load(f.read(), Loader=SafeLoader)
^^^^^^^^

UnicodeDecodeError: 'gbk' codec can't decode byte 0xa2 in position 46:
illegal multibyte sequence

Call Stack (most recent call first):
cmake/modules/sysbuild_default.cmake:15 (include)
C:/ncs/v2.9.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:75 (include)
C:/ncs/v2.9.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
C:/ncs/v2.9.0/zephyr/share/sysbuild-package/cmake/SysbuildConfig.cmake:8 (include)
template/CMakeLists.txt:10 (find_package)


-- Configuring incomplete, errors occurred!
See also "C:/ncs/v2.9.0/nrf/samples/bluetooth/peripheral_uart/build_6/CMakeFiles/CMakeOutput.log".
FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\b620d30767\opt\bin\cmake.EXE' -DWEST_PYTHON=C:/ncs/toolchains/b620d30767/opt/bin/python.exe '-Bc:\ncs\v2.9.0\nrf\samples\bluetooth\peripheral_uart\build_6' -GNinja -DBOARD=nrf52833dk/nrf52820 -DNCS_TOOLCHAIN_VERSION=NONE '-SC:\ncs\v2.9.0\zephyr\share\sysbuild' '-DAPP_DIR:PATH=c:\ncs\v2.9.0\nrf\samples\bluetooth\peripheral_uart'

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

Could you help me to fix it? thank you!the window

Parents
  • In my case, it is the language settings of windows10 which make this error.

    I think it a bug of some tools in toolchains. When I select a system locale other than English (in window settings).

    Some apps of toolchains may not work correctly. After I make the "Current system locale" in "Region Settings" page to ”English(United States)“,

    the error disappeared.

Reply
  • In my case, it is the language settings of windows10 which make this error.

    I think it a bug of some tools in toolchains. When I select a system locale other than English (in window settings).

    Some apps of toolchains may not work correctly. After I make the "Current system locale" in "Region Settings" page to ”English(United States)“,

    the error disappeared.

Children
  • Hello  

    I know this issue about NCS v2.9.0 from other DevZone ticket, but I forget where is it.

    I only remember the solution.

    In Windows PC for Chinese language, we have to modify `v2.9.0\zephyr\scripts\list_boards.py`

    from:

    with board_yml.open('r') as f:

    to:

    with board_yml.open('r', encoding='utf-8') as f:

    This was fixed in NCS v3.0.0.


    However, when I try NCS v3.1.0 and build Matter samples, something like this issue comes again:

    CMake Warning at D:/ncs/v3.1.0/zephyr/CMakeLists.txt:2232 (message):
      __ASSERT() statements are globally ENABLED
    
    
    Traceback (most recent call last):
      File "D:\ncs\v3.1.0\modules\lib\matter\scripts\codegen_paths.py", line 90, in <module>
        main(auto_envvar_prefix='CHIP')
      File "D:\ncs\toolchains\b8b84efebd\opt\bin\Lib\site-packages\click\core.py", line 1130, in __call__
        return self.main(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "D:\ncs\toolchains\b8b84efebd\opt\bin\Lib\site-packages\click\core.py", line 1055, in main
        rv = self.invoke(ctx)
             ^^^^^^^^^^^^^^^^
      File "D:\ncs\toolchains\b8b84efebd\opt\bin\Lib\site-packages\click\core.py", line 1404, in invoke
        return ctx.invoke(self.callback, **ctx.params)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "D:\ncs\toolchains\b8b84efebd\opt\bin\Lib\site-packages\click\core.py", line 760, in invoke
        return __callback(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "D:\ncs\v3.1.0\modules\lib\matter\scripts\codegen_paths.py", line 80, in main
        for expanded in expand_path_for_idl(CreateParser().parse(open(idl, "rt").read()), p):
                                                                 ^^^^^^^^^^^^^^^^^^^^^^
    UnicodeDecodeError: 'gbk' codec can't decode byte 0x99 in position 12457: illegal multibyte sequence
    CMake Error at D:/ncs/v3.1.0/modules/lib/matter/build/chip/chip_codegen.cmake:66 (add_custom_command):
      add_custom_command Wrong syntax.  A TARGET or OUTPUT must be specified.
    Call Stack (most recent call first):
      D:/ncs/v3.1.0/modules/lib/matter/src/app/chip_data_model.cmake:114 (chip_codegen)
      D:/ncs/v3.1.0/nrf/samples/matter/common/cmake/data_model.cmake:20 (chip_configure_data_model)
      CMakeLists.txt:43 (ncs_configure_data_model)
    
    
    -- Configuring incomplete, errors occurred!
    See also "D:/ncs/v3.1.0/nrf/samples/matter/light_bulb/build/light_bulb/CMakeFiles/CMakeOutput.log".
    See also "D:/ncs/v3.1.0/nrf/samples/matter/light_bulb/build/light_bulb/CMakeFiles/CMakeError.log".
    CMake Error at cmake/modules/sysbuild_extensions.cmake:530 (message):
      CMake configure failed for Zephyr project: light_bulb
    
      Location: D:/ncs/v3.1.0/nrf/samples/matter/light_bulb
    Call Stack (most recent call first):
      cmake/modules/sysbuild_images.cmake:43 (ExternalZephyrProject_Cmake)
      cmake/modules/sysbuild_default.cmake:21 (include)
      D:/ncs/v3.1.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:75 (include)
      D:/ncs/v3.1.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
      D:/ncs/v3.1.0/zephyr/share/sysbuild-package/cmake/SysbuildConfig.cmake:8 (include)
      template/CMakeLists.txt:10 (find_package)

    This also affect v3.1.1


    After some exploration, I also fixed this issue.

    In `v3.1.1\modules\lib\matter\scripts\codegen_paths.py` line 80

    Modify from:

    for expanded in expand_path_for_idl(CreateParser().parse(open(idl, "rt").read()), p):

    to:

    for expanded in expand_path_for_idl(CreateParser().parse(open(idl, "rt", encoding="utf-8").read()), p):

    And also in `v3.1.1\modules\lib\matter\scripts\codegen.py` line 119

    Modify from:

    idl_tree = CreateParser().parse(open(idl_path, "rt").read(), file_name=idl_path)

    to:

    idl_tree = CreateParser().parse(open(idl_path, "rt", encoding="utf-8").read(), file_name=idl_path)


    Please raise a Jira ticket internally to fix this issue. It may affect all the users who has Windows system using double byte characters coding (Chinese, Japanese, Korean...)

Related