[MCUXpresso VS Code + NXP Matter v1.4.0_2_1] Build Failure in light-switch-combo-app due to codegen.

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

[MCUXpresso VS Code + NXP Matter v1.4.0_2_1] Build Failure in light-switch-combo-app due to codegen.

51件の閲覧回数
Nokhysh
Contributor I

Hello NXP Support Team,

While building the NXP Matter light-switch-combo-app in the MCUXpresso VS Code environment on Windows, the build fails during the code generation step (scripts/codegen.py) with a UnicodeDecodeError ('cp932'). ZAP generation succeeds; only the codegen step fails. Could you advise on the root cause and the recommended fix?

Environment

  • OS: Windows 11 (Japanese locale, default code page cp932)

  • Tooling: MCUXpresso VS Code (standard Matter setup)

  • Python: 3.10 (C:\nxp_matter_v1_4_0_2_1\venv\Scripts\python.exe)

  • Example: examples/light-switch-combo-app (Wi-Fi/Combo)

  • Matter repository (NXP fork): https://github.com/NXP/matter

  • Release in use: v1.4.0_2_1 (local path name: nxp_matter_v1_4_0_2_1)

  • Inputs:

    • IDL: light-switch-combo-matter-wifi.matter

    • ZAP: light-switch-combo-matter-wifi.zap

  • ZAP CLI: log shows zap version: 2024.10.24 (generation succeeds)

Reproduction Steps

  1. Set up NXP Matter v1.4.0_2_1 on Windows 11.

  2. Build examples/light-switch-combo-app from MCUXpresso VS Code.

  3. During ninja, the following codegen step fails.

Failing command (invoked by ninja)

C:\nxp_matter_v1_4_0_2_1\venv\Scripts\python.exe C:/nxp_matter_v1_4_0_2_1/scripts/codegen.py \
--generator cpp-app \
--output-dir C:/nxp_matter_v1_4_0_2_1/examples/light-switch-combo-app/nxp/debug/gen/app-codegen/cpp-app \
--expected-outputs C:/nxp_matter_v1_4_0_2_1/examples/light-switch-combo-app/nxp/debug/gen/app-codegen/cpp-app/expected.outputs \
C:/nxp_matter_v1_4_0_2_1/examples/light-switch-combo-app/light-switch-combo-common/light-switch-combo-matter-wifi.matter

Error excerpt

INFO    Parsing idl from .../light-switch-combo-matter-wifi.matter
...
UnicodeDecodeError: 'cp932' codec can't decode byte 0x99 in position 11484: illegal multibyte sequence

(ZAP generation completes and produces zap-generated/*.h, *.cpp.)

Initial Analysis

  • codegen.py seems to read the .matter file via open(..., "rt") using the default locale encoding (cp932 on Japanese Windows). If the file is UTF-8, certain bytes (e.g., 0x99) cannot be decoded under cp932, causing the exception.

  • Only the .matter → C++ path fails; ZAP generation is unaffected.

Questions

  1. Is UTF-8 the expected encoding for .matter files on Windows (non-UTF-8 locales)?

  2. Will scripts/codegen.py be updated to explicitly specify encoding="utf-8" when reading the IDL?

  3. Is there an officially recommended workaround (e.g., PYTHONUTF8=1, chcp 65001 before build, converting .matter to UTF-8 w/o BOM) until a fix lands?

  4. Is this specific to v1.4.0_2_1? If a fix is planned for a future release, could you share the timeline?

Tried Workarounds (results)

  • chcp 65001: no change (Python’s default file encoding may still follow locale/implementation)

  • PYTHONUTF8=1: not yet confirmed (would like official guidance)

  • Re-saving the .matter file as UTF-8 (no BOM): likely to help, but we prefer an official, maintainable approach.

Best regards,
Naoki Hayashi

0 件の賞賛
返信
1 返信

13件の閲覧回数
Christine_Li
NXP TechSupport
NXP TechSupport

Hi, @Nokhysh 

I will check and reply to you ASAP.

 

Best regards,

Christine.

0 件の賞賛
返信