Memory report fails

I am bringing up a brand new laptop for devlopment.

I downloaded and installesd nRF Connect, SDK 2.6.0, SDK 2.7.0 and SDK 2.8.0. The SDK 2.9.0 installation failed.

I ported a project from my old laptop and built it on the new laptop - the build was successful.

When I tried to run a memory report I got:

Command failed: west build -d c:\Users\kover\HomeSmart\VScode\lockbox\build -t footprint
Traceback (most recent call last):
  File "C:\ncs\v2.6.0\zephyr\scripts\footprint\size_report", line 30, in <module>
    from elftools.elf.elffile import ELFFile
  File "C:\ncs\toolchains\b620d30767\opt\bin\Lib\site-packages\elftools\elf\elffile.py", line 41, in <module>
    from ..dwarf.dwarfinfo import DWARFInfo, DebugSectionDescriptor, DwarfConfig
  File "C:\ncs\toolchains\b620d30767\opt\bin\Lib\site-packages\elftools\dwarf\dwarfinfo.py", line 17, in <module>
    from .structs import DWARFStructs
  File "C:\ncs\toolchains\b620d30767\opt\bin\Lib\site-packages\elftools\dwarf\structs.py", line 10, in <module>
    from logging.config import valid_ident
  File "<frozen zipimport>", line 259, in load_module
  File "logging\config.py", line 30, in <module>
  File "<frozen zipimport>", line 259, in load_module
  File "logging\handlers.py", line 26, in <module>
  File "<frozen zipimport>", line 259, in load_module
  File "socket.py", line 51, in <module>
ImportError: Module use of python312.dll conflicts with this version of Python.
FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\b620d30767\opt\bin\cmake.EXE' --build 'c:\Users\kover\HomeSmart\VScode\lockbox\build' --target footprint

Parents
  • I have the same issue. I have SDK 2.8.0 and 2.6.2 installed. When I build for 2.6.2, I receive the exact same error when trying to generate a memory report (ImportError: Module use of python312.dll conflicts with this version of Python). When I build for 2.8.0, generating a memory report works fine. Figured I would report my findings here as well to corroborate your findings. Hopefully Nordic can shed some light on this.

    Side note, I had to install 2.6.2 to do the Developer Academy training modules since 2.7.0+ isn't supported by some of the modules.

    Derek

  • Hey  

    If I need to open a new ticket for this, please let me know. It isn't my intention to hijack the original posters thread, but I believe they may be encountering the same issue I am seeing. My goal is to provide additional insight into the potential root cause.

    I was able to reproduce the issue following the steps below:

    1. Install nRF Connect SDK (and toolchain) v2.8.0 and then install nRF Connect SDK (and toolchain) v2.6.2 using VS Code's "Manage SDKs" and "Manage toolchains" 

    2. Under the nRF Connect section of VS Code (Ctrl + Alt + N), select Create a new application -> Copy a sample -> nRF Connect SDK v2.6.2 -> Blinky Sample

    3. Add a build configuration for your board. I used the nrf52840dk. Make sure the SDK and toolchain are set to 2.6.2 at the top of the build configuration page. Leave all other build configuration settings at their default values.

    4. Click the "Build Configuration" button and observe the output below.

    * Executing task: nRF Connect: Generate config nrf52840dk_nrf52840 for c:\nRFConSDK_Train\blinky
    
    Building blinky
    <Redacted because Devzone won't post this log with this line present>
    
    -- west build: generating a build system
    Loading Zephyr default modules (Zephyr base).
    -- Application: C:/nRFConSDK_Train/blinky
    -- CMake version: 3.21.0
    -- Found Python3: C:/ncs/toolchains/cf2149caf2/opt/bin/python.exe (found suitable version "3.9.13", minimum required is "3.8") found components: Interpreter
    -- Cache files will be written to: C:/ncs/v2.6.2/zephyr/.cache
    -- Zephyr version: 3.5.99 (C:/ncs/v2.6.2/zephyr)
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: nrf52840dk_nrf52840
    -- Found host-tools: zephyr 0.16.5 (C:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.16.5 (C:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk)
    -- Found Dtc: C:/ncs/toolchains/cf2149caf2/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
    -- Found BOARD.dts: C:/ncs/v2.6.2/zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840.dts
    -- Generated zephyr.dts: C:/nRFConSDK_Train/blinky/build/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: C:/nRFConSDK_Train/blinky/build/zephyr/include/generated/devicetree_generated.h
    -- Including generated dts.cmake file: C:/nRFConSDK_Train/blinky/build/zephyr/dts.cmake
    Parsing C:/ncs/v2.6.2/zephyr/Kconfig
    Loaded configuration 'C:/ncs/v2.6.2/zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840_defconfig'
    Merged configuration 'C:/nRFConSDK_Train/blinky/prj.conf'
    Configuration saved to 'C:/nRFConSDK_Train/blinky/build/zephyr/.config'
    Kconfig header saved to 'C:/nRFConSDK_Train/blinky/build/zephyr/include/generated/autoconf.h'
    -- Found GnuLd: c:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe (found version "2.38")
    -- The C compiler identification is GNU 12.2.0
    -- The CXX compiler identification is GNU 12.2.0
    -- The ASM compiler identification is GNU
    -- Found assembler: C:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/nRFConSDK_Train/blinky/build
    -- west build: building application
    [2/139] Generating include/generated/version.h
    -- Zephyr version: 3.5.99 (C:/ncs/v2.6.2/zephyr), build: v3.5.99-ncs1-2
    [139/139] Linking C executable zephyr\zephyr.elf
    Memory region Used Size Region Size %age Used
    FLASH: 21880 B 1 MB 2.09%
    RAM: 7552 B 256 KB 2.88%
    IDT_LIST: 0 GB 32 KB 0.00%
    * Terminal will be reused by tasks, press any key to close it.

    5. Now, navigate to nRF Connect (Ctrl+Alt+N), select your build configuration, then select Memory report under "Actions" and observe the error "Failed to generate memory reports" with the the following output:

    [12:15:01] nRF Command Line Tools 10.24.2 are up to date
    [12:15:13] =========== Toolchain validation report for nRF Connect SDK Toolchain v2.6.2 ===========
     Using the nRF Connect SDK v2.6.2 at c:\ncs\v2.6.2
    No issues were detected with the toolchain.
    <Redacted because Devzone won't post this log with this line present>
    [12:17:20] =========== Toolchain validation report for nRF Connect SDK Toolchain v2.6.2 ===========
     Using the nRF Connect SDK v2.6.2 at c:\ncs\v2.6.2
    No issues were detected with the toolchain.
    [12:17:56] Success.
    [12:28:52] Command failed: west build -d c:\nRFConSDK_Train\blinky\build -t footprint
    Traceback (most recent call last):
      File "C:\ncs\v2.6.2\zephyr\scripts\footprint\size_report", line 30, in <module>
        from elftools.elf.elffile import ELFFile
      File "C:\ncs\toolchains\2d382dcd92\opt\bin\Lib\site-packages\elftools\elf\elffile.py", line 41, in <module>
        from ..dwarf.dwarfinfo import DWARFInfo, DebugSectionDescriptor, DwarfConfig
      File "C:\ncs\toolchains\2d382dcd92\opt\bin\Lib\site-packages\elftools\dwarf\dwarfinfo.py", line 17, in <module>
        from .structs import DWARFStructs
      File "C:\ncs\toolchains\2d382dcd92\opt\bin\Lib\site-packages\elftools\dwarf\structs.py", line 10, in <module>
        from logging.config import valid_ident
      File "<frozen zipimport>", line 259, in load_module
      File "logging\config.py", line 30, in <module>
      File "<frozen zipimport>", line 259, in load_module
      File "logging\handlers.py", line 26, in <module>
      File "<frozen zipimport>", line 259, in load_module
      File "socket.py", line 51, in <module>
    ImportError: Module use of python312.dll conflicts with this version of Python.
    FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\2d382dcd92\opt\bin\cmake.EXE' --build 'c:\nRFConSDK_Train\blinky\build' --target footprint
    
    Command failed: west build -d c:\nRFConSDK_Train\blinky\build -t footprint
    Traceback (most recent call last):
      File "C:\ncs\v2.6.2\zephyr\scripts\footprint\size_report", line 30, in <module>
        from elftools.elf.elffile import ELFFile
      File "C:\ncs\toolchains\2d382dcd92\opt\bin\Lib\site-packages\elftools\elf\elffile.py", line 41, in <module>
        from ..dwarf.dwarfinfo import DWARFInfo, DebugSectionDescriptor, DwarfConfig
      File "C:\ncs\toolchains\2d382dcd92\opt\bin\Lib\site-packages\elftools\dwarf\dwarfinfo.py", line 17, in <module>
        from .structs import DWARFStructs
      File "C:\ncs\toolchains\2d382dcd92\opt\bin\Lib\site-packages\elftools\dwarf\structs.py", line 10, in <module>
        from logging.config import valid_ident
      File "<frozen zipimport>", line 259, in load_module
      File "logging\config.py", line 30, in <module>
      File "<frozen zipimport>", line 259, in load_module
      File "logging\handlers.py", line 26, in <module>
      File "<frozen zipimport>", line 259, in load_module
      File "socket.py", line 51, in <module>
    ImportError: Module use of python312.dll conflicts with this version of Python.
    FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\2d382dcd92\opt\bin\cmake.EXE' --build 'c:\nRFConSDK_Train\blinky\build' --target footprint

    What I suspect is happening is that the Memory Report defaults to pointing to the newer 2.8.0 toolchain even though the project was built using 2.6.2. See the following lines taken from the logs above.

    From the build log:

    Found Python3: C:/ncs/toolchains/cf2149caf2/opt/bin/python.exe

    From the memory report log:

     File "C:\ncs\toolchains\2d382dcd92\opt\bin\Lib\site-packages\elftools\elf\elffile.py", line 41 ...

    It appears the memory report is referencing elffile.py in toolchain directory 2d382dcd92 (presumably v2.8.0)  but the build script is referencing the toolchain directory cf2149caf2 (presumably v2.6.2).

    Question: Why is this happening and how can it be fixed or mitigated?

    Please note I am new to Zephyr so please forgive my ignorance on how these toolchains work.

    Thanks,

    Derek

Reply
  • Hey  

    If I need to open a new ticket for this, please let me know. It isn't my intention to hijack the original posters thread, but I believe they may be encountering the same issue I am seeing. My goal is to provide additional insight into the potential root cause.

    I was able to reproduce the issue following the steps below:

    1. Install nRF Connect SDK (and toolchain) v2.8.0 and then install nRF Connect SDK (and toolchain) v2.6.2 using VS Code's "Manage SDKs" and "Manage toolchains" 

    2. Under the nRF Connect section of VS Code (Ctrl + Alt + N), select Create a new application -> Copy a sample -> nRF Connect SDK v2.6.2 -> Blinky Sample

    3. Add a build configuration for your board. I used the nrf52840dk. Make sure the SDK and toolchain are set to 2.6.2 at the top of the build configuration page. Leave all other build configuration settings at their default values.

    4. Click the "Build Configuration" button and observe the output below.

    * Executing task: nRF Connect: Generate config nrf52840dk_nrf52840 for c:\nRFConSDK_Train\blinky
    
    Building blinky
    <Redacted because Devzone won't post this log with this line present>
    
    -- west build: generating a build system
    Loading Zephyr default modules (Zephyr base).
    -- Application: C:/nRFConSDK_Train/blinky
    -- CMake version: 3.21.0
    -- Found Python3: C:/ncs/toolchains/cf2149caf2/opt/bin/python.exe (found suitable version "3.9.13", minimum required is "3.8") found components: Interpreter
    -- Cache files will be written to: C:/ncs/v2.6.2/zephyr/.cache
    -- Zephyr version: 3.5.99 (C:/ncs/v2.6.2/zephyr)
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: nrf52840dk_nrf52840
    -- Found host-tools: zephyr 0.16.5 (C:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.16.5 (C:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk)
    -- Found Dtc: C:/ncs/toolchains/cf2149caf2/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
    -- Found BOARD.dts: C:/ncs/v2.6.2/zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840.dts
    -- Generated zephyr.dts: C:/nRFConSDK_Train/blinky/build/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: C:/nRFConSDK_Train/blinky/build/zephyr/include/generated/devicetree_generated.h
    -- Including generated dts.cmake file: C:/nRFConSDK_Train/blinky/build/zephyr/dts.cmake
    Parsing C:/ncs/v2.6.2/zephyr/Kconfig
    Loaded configuration 'C:/ncs/v2.6.2/zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840_defconfig'
    Merged configuration 'C:/nRFConSDK_Train/blinky/prj.conf'
    Configuration saved to 'C:/nRFConSDK_Train/blinky/build/zephyr/.config'
    Kconfig header saved to 'C:/nRFConSDK_Train/blinky/build/zephyr/include/generated/autoconf.h'
    -- Found GnuLd: c:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe (found version "2.38")
    -- The C compiler identification is GNU 12.2.0
    -- The CXX compiler identification is GNU 12.2.0
    -- The ASM compiler identification is GNU
    -- Found assembler: C:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/nRFConSDK_Train/blinky/build
    -- west build: building application
    [2/139] Generating include/generated/version.h
    -- Zephyr version: 3.5.99 (C:/ncs/v2.6.2/zephyr), build: v3.5.99-ncs1-2
    [139/139] Linking C executable zephyr\zephyr.elf
    Memory region Used Size Region Size %age Used
    FLASH: 21880 B 1 MB 2.09%
    RAM: 7552 B 256 KB 2.88%
    IDT_LIST: 0 GB 32 KB 0.00%
    * Terminal will be reused by tasks, press any key to close it.

    5. Now, navigate to nRF Connect (Ctrl+Alt+N), select your build configuration, then select Memory report under "Actions" and observe the error "Failed to generate memory reports" with the the following output:

    [12:15:01] nRF Command Line Tools 10.24.2 are up to date
    [12:15:13] =========== Toolchain validation report for nRF Connect SDK Toolchain v2.6.2 ===========
     Using the nRF Connect SDK v2.6.2 at c:\ncs\v2.6.2
    No issues were detected with the toolchain.
    <Redacted because Devzone won't post this log with this line present>
    [12:17:20] =========== Toolchain validation report for nRF Connect SDK Toolchain v2.6.2 ===========
     Using the nRF Connect SDK v2.6.2 at c:\ncs\v2.6.2
    No issues were detected with the toolchain.
    [12:17:56] Success.
    [12:28:52] Command failed: west build -d c:\nRFConSDK_Train\blinky\build -t footprint
    Traceback (most recent call last):
      File "C:\ncs\v2.6.2\zephyr\scripts\footprint\size_report", line 30, in <module>
        from elftools.elf.elffile import ELFFile
      File "C:\ncs\toolchains\2d382dcd92\opt\bin\Lib\site-packages\elftools\elf\elffile.py", line 41, in <module>
        from ..dwarf.dwarfinfo import DWARFInfo, DebugSectionDescriptor, DwarfConfig
      File "C:\ncs\toolchains\2d382dcd92\opt\bin\Lib\site-packages\elftools\dwarf\dwarfinfo.py", line 17, in <module>
        from .structs import DWARFStructs
      File "C:\ncs\toolchains\2d382dcd92\opt\bin\Lib\site-packages\elftools\dwarf\structs.py", line 10, in <module>
        from logging.config import valid_ident
      File "<frozen zipimport>", line 259, in load_module
      File "logging\config.py", line 30, in <module>
      File "<frozen zipimport>", line 259, in load_module
      File "logging\handlers.py", line 26, in <module>
      File "<frozen zipimport>", line 259, in load_module
      File "socket.py", line 51, in <module>
    ImportError: Module use of python312.dll conflicts with this version of Python.
    FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\2d382dcd92\opt\bin\cmake.EXE' --build 'c:\nRFConSDK_Train\blinky\build' --target footprint
    
    Command failed: west build -d c:\nRFConSDK_Train\blinky\build -t footprint
    Traceback (most recent call last):
      File "C:\ncs\v2.6.2\zephyr\scripts\footprint\size_report", line 30, in <module>
        from elftools.elf.elffile import ELFFile
      File "C:\ncs\toolchains\2d382dcd92\opt\bin\Lib\site-packages\elftools\elf\elffile.py", line 41, in <module>
        from ..dwarf.dwarfinfo import DWARFInfo, DebugSectionDescriptor, DwarfConfig
      File "C:\ncs\toolchains\2d382dcd92\opt\bin\Lib\site-packages\elftools\dwarf\dwarfinfo.py", line 17, in <module>
        from .structs import DWARFStructs
      File "C:\ncs\toolchains\2d382dcd92\opt\bin\Lib\site-packages\elftools\dwarf\structs.py", line 10, in <module>
        from logging.config import valid_ident
      File "<frozen zipimport>", line 259, in load_module
      File "logging\config.py", line 30, in <module>
      File "<frozen zipimport>", line 259, in load_module
      File "logging\handlers.py", line 26, in <module>
      File "<frozen zipimport>", line 259, in load_module
      File "socket.py", line 51, in <module>
    ImportError: Module use of python312.dll conflicts with this version of Python.
    FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\2d382dcd92\opt\bin\cmake.EXE' --build 'c:\nRFConSDK_Train\blinky\build' --target footprint

    What I suspect is happening is that the Memory Report defaults to pointing to the newer 2.8.0 toolchain even though the project was built using 2.6.2. See the following lines taken from the logs above.

    From the build log:

    Found Python3: C:/ncs/toolchains/cf2149caf2/opt/bin/python.exe

    From the memory report log:

     File "C:\ncs\toolchains\2d382dcd92\opt\bin\Lib\site-packages\elftools\elf\elffile.py", line 41 ...

    It appears the memory report is referencing elffile.py in toolchain directory 2d382dcd92 (presumably v2.8.0)  but the build script is referencing the toolchain directory cf2149caf2 (presumably v2.6.2).

    Question: Why is this happening and how can it be fixed or mitigated?

    Please note I am new to Zephyr so please forgive my ignorance on how these toolchains work.

    Thanks,

    Derek

Children
Related