nRF5340: about the sample 'IPC Service' build

Hi Support team,


I can run the sample 'IPC service' successfully with the default build, which can print the bidirectional throughput on consoles of the app-core and net-core.
But when I want to try the unidirectional throughout from app-core to net-core with:

    west build -p -b nrf5340dk_nrf5340_cpuapp -- -DCONF_FILE=prj_icmsg.conf -DOVERLAY_CONFIG=overlay-cpuapp-sending.conf

The build has failed:

-- Found Python3: C:/ncs/toolchains/c57af46cb7/opt/bin/python.exe (found suitable version "3.8.2", minimum required is "3.8") found components: Interpreter 
-- Cache files will be written to: C:/ncs/v2.5.0/zephyr/.cache
-- Zephyr version: 3.4.99 (C:/ncs/v2.5.0/zephyr)
-- Found west (found suitable version "1.1.0", minimum required is "0.14.0")
-- Board: nrf5340dk_nrf5340_cpuapp
-- Found host-tools: zephyr 0.16.1 (C:/ncs/toolchains/c57af46cb7/opt/zephyr-sdk)
-- Found toolchain: zephyr 0.16.1 (C:/ncs/toolchains/c57af46cb7/opt/zephyr-sdk)
-- Found Dtc: C:/ncs/toolchains/c57af46cb7/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6") 
-- Found BOARD.dts: C:/ncs/v2.5.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp.dts
-- Found devicetree overlay: .overlay
<command-line>: fatal error: .overlay: No such file or directory
compilation terminated.
CMake Error at C:/ncs/v2.5.0/zephyr/cmake/modules/extensions.cmake:3885 (message):
  failed to preprocess devicetree files (error code 1):
  C:/ncs/v2.5.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp.dts;.overlay
Call Stack (most recent call first):
  C:/ncs/v2.5.0/zephyr/cmake/modules/dts.cmake:226 (zephyr_dt_preprocess)
  C:/ncs/v2.5.0/zephyr/cmake/modules/zephyr_default.cmake:129 (include)
  C:/ncs/v2.5.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
  C:/ncs/v2.5.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
  CMakeLists.txt:27 (find_package)


-- Configuring incomplete, errors occurred!

Could you help me with the below questions:
1. For the IPC communication between app-core and net-core on nRF5340, which IPC backend (RPMSG and ICMSG) should be used or what are the differences?
     I see in the prj.conf, the configurations are different:
        For the ICMSG:

     CONFIG_IPC_SERVICE=y
     CONFIG_IPC_SERVICE_LOG_LEVEL_INF=y
     CONFIG_IPC_SERVICE_BACKEND_ICMSG=y
     CONFIG_MBOX=y

        For the RPMSG:

CONFIG_IPC_SERVICE=y
CONFIG_OPENAMP=y
CONFIG_OPENAMP_SLAVE=n  // or CONFIG_OPENAMP_MASTER=n
CONFIG_IPC_SERVICE_LOG_LEVEL_INF=y
CONFIG_IPC_SERVICE_BACKEND_RPMSG=y
CONFIG_MBOX=y

        Why there is no OPENAMP configuration for ICMSG?

2. From the above error info, seems the .overlay can not be found. But there is an overlay file in the sample: \ncs\v2.5.0\nrf\samples\ipc\ipc_service\icmsg.overlay.
Could you help see the error reason and give some hints for the building?

Thank you very much.

Best regards,
Yanpeng Wu

Parents
  • IPC is the service native from Zephyr RTOS and OPENAMP is on the high level. For RPMSG and OPENAMP they still need to use IPC.

    Regarding the build errors, I recommend you to do a prestine build with the configurations you suggested. I was able to see the error you mentioned when I built the bidirectional sample first and changed the command to build it with uni directional. It failed. After removing the build directory and doing the prestine build again, it worked. Please give it a try. 

    Building ipc_service
    west build --build-dir c:/ncs/v2.5.0/nrf/samples/ipc/ipc_service/build c:/ncs/v2.5.0/nrf/samples/ipc/ipc_service --pristine --board nrf5340dk_nrf5340_cpuapp --no-sysbuild -- -DNCS_TOOLCHAIN_VERSION=NONE -DCONF_FILE=c:/ncs/v2.5.0/nrf/samples/ipc/ipc_service/prj_icmsg.conf -DEXTRA_CONF_FILE=overlay-cpuapp-sending.conf -DBOARD_ROOT=c:/ncs/v2.5.0/nrf/samples/ipc/ipc_service
    
    -- west build: generating a build system
    Loading Zephyr default modules (Zephyr base).
    -- Application: C:/ncs/v2.5.0/nrf/samples/ipc/ipc_service
    -- CMake version: 3.20.5
    -- Found Python3: C:/ncs/toolchains/c57af46cb7/opt/bin/python.exe (found suitable version "3.8.2", minimum required is "3.8") found components: Interpreter 
    -- Cache files will be written to: C:/ncs/v2.5.0/zephyr/.cache
    -- Zephyr version: 3.4.99 (C:/ncs/v2.5.0/zephyr)
    -- Found west (found suitable version "1.1.0", minimum required is "0.14.0")
    -- Board: nrf5340dk_nrf5340_cpuapp
    -- Found host-tools: zephyr 0.16.1 (C:/ncs/toolchains/c57af46cb7/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.16.1 (C:/ncs/toolchains/c57af46cb7/opt/zephyr-sdk)
    -- Found Dtc: C:/ncs/toolchains/c57af46cb7/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6") 
    -- Found BOARD.dts: C:/ncs/v2.5.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp.dts
    -- Found devicetree overlay: icmsg.overlay
    -- Generated zephyr.dts: C:/ncs/v2.5.0/nrf/samples/ipc/ipc_service/build/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: C:/ncs/v2.5.0/nrf/samples/ipc/ipc_service/build/zephyr/include/generated/devicetree_generated.h
    -- Including generated dts.cmake file: C:/ncs/v2.5.0/nrf/samples/ipc/ipc_service/build/zephyr/dts.cmake
    Parsing C:/ncs/v2.5.0/nrf/samples/ipc/ipc_service/Kconfig
    Loaded configuration 'C:/ncs/v2.5.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp_defconfig'
    Merged configuration 'c:/ncs/v2.5.0/nrf/samples/ipc/ipc_service/prj_icmsg.conf'
    Merged configuration 'C:/ncs/v2.5.0/nrf/samples/ipc/ipc_service/boards/nrf5340dk_nrf5340_cpuapp_icmsg.conf'
    Merged configuration 'C:/ncs/v2.5.0/nrf/samples/ipc/ipc_service/overlay-cpuapp-sending.conf'
    Configuration saved to 'C:/ncs/v2.5.0/nrf/samples/ipc/ipc_service/build/zephyr/.config'
    Kconfig header saved to 'C:/ncs/v2.5.0/nrf/samples/ipc/ipc_service/build/zephyr/include/generated/autoconf.h'
    -- Found GnuLd: c:/ncs/toolchains/c57af46cb7/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/c57af46cb7/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
    
    === child image remote - remote begin ===
    loading initial cache file C:/ncs/v2.5.0/nrf/samples/ipc/ipc_service/build/remote/child_image_preload.cmake
    Loading Zephyr default modules (Zephyr base).
    -- Application: C:/ncs/v2.5.0/nrf/samples/ipc/ipc_service/remote
    -- CMake version: 3.20.5
    -- Found Python3: C:/ncs/toolchains/c57af46cb7/opt/bin/python.exe (found suitable version "3.8.2", minimum required is "3.8") found components: Interpreter 
    -- Cache files will be written to: C:/ncs/v2.5.0/zephyr/.cache
    -- Zephyr version: 3.4.99 (C:/ncs/v2.5.0/zephyr)
    -- Found west (found suitable version "1.1.0", minimum required is "0.14.0")
    -- Board: nrf5340dk_nrf5340_cpunet
    -- Found host-tools: zephyr 0.16.1 (C:/ncs/toolchains/c57af46cb7/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.16.1 (C:/ncs/toolchains/c57af46cb7/opt/zephyr-sdk)
    -- Found Dtc: C:/ncs/toolchains/c57af46cb7/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6") 
    -- Found BOARD.dts: C:/ncs/v2.5.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpunet.dts
    -- Found devicetree overlay: icmsg.overlay
    -- Generated zephyr.dts: C:/ncs/v2.5.0/nrf/samples/ipc/ipc_service/build/remote/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: C:/ncs/v2.5.0/nrf/samples/ipc/ipc_service/build/remote/zephyr/include/generated/devicetree_generated.h
    -- Including generated dts.cmake file: C:/ncs/v2.5.0/nrf/samples/ipc/ipc_service/build/remote/zephyr/dts.cmake
    Parsing C:/ncs/v2.5.0/nrf/samples/ipc/ipc_service/remote/Kconfig
    Loaded configuration 'C:/ncs/v2.5.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpunet_defconfig'
    Merged configuration 'c:/ncs/v2.5.0/nrf/samples/ipc/ipc_service/prj_icmsg.conf'
    Merged configuration 'C:/ncs/v2.5.0/nrf/subsys/partition_manager/partition_manager_enabled.conf'
    Configuration saved to 'C:/ncs/v2.5.0/nrf/samples/ipc/ipc_service/build/remote/zephyr/.config'
    Kconfig header saved to 'C:/ncs/v2.5.0/nrf/samples/ipc/ipc_service/build/remote/zephyr/include/generated/autoconf.h'
    -- Found GnuLd: c:/ncs/toolchains/c57af46cb7/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/c57af46cb7/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/ncs/v2.5.0/nrf/samples/ipc/ipc_service/build/remote
    === child image remote - remote end ===
    
    Dropping partition 'rpmsg_nrf53_sram' since its size is 0.
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/ncs/v2.5.0/nrf/samples/ipc/ipc_service/build
    -- west build: building application
    [2/152] Generating include/generated/version.h
    -- Zephyr version: 3.4.99 (C:/ncs/v2.5.0/zephyr), build: v3.4.99-ncs1
    [150/152] Linking C executable zephyr\zephyr.elf
    Memory region         Used Size  Region Size  %age Used
               FLASH:       38000 B       256 KB     14.50%
                 RAM:       13052 B        64 KB     19.92%
               SRAM1:          0 GB        64 KB      0.00%
            IDT_LIST:          0 GB         2 KB      0.00%
    [7/166] Generating include/generated/version.h
    -- Zephyr version: 3.4.99 (C:/ncs/v2.5.0/zephyr), build: v3.4.99-ncs1
    [161/166] Linking C executable zephyr\zephyr.elf
    Memory region         Used Size  Region Size  %age Used
    
               FLASH:       41232 B         1 MB      3.93%
    
                 RAM:       15172 B       512 KB      2.89%
    
            IDT_LIST:          0 GB         2 KB      0.00%
    
    [166/166] Generating zephyr/merged_domains.hex
     *  Terminal will be reused by tasks, press any key to close it. 

  • Hi Susheel,

    Thank you for the reply.
    I followed your suggestion, deleted the build directory, and did the pristine build with the below command in the 'nRF Connect' terminal in VS code:

    west build --build-dir c:/ncs/v2.5.0/nrf/samples/ipc/ipc_service/build c:/ncs/v2.5.0/nrf/samples/ipc/ipc_service --pristine --board nrf5340dk_nrf5340_cpuapp --no-sysbuild -- -DNCS_TOOLCHAIN_VERSION=NONE -DCONF_FILE=c:/ncs/v2.5.0/nrf/samples/ipc/ipc_service/prj_icmsg.conf -DEXTRA_CONF_FILE=overlay-cpuapp-sending.conf -DBOARD_ROOT=c:/ncs/v2.5.0/nrf/samples/ipc/ipc_service

    But the same error occurs:

    PS C:\ncs\v2.5.0\nrf\samples\ipc\ipc_service> 
    PS C:\ncs\v2.5.0\nrf\samples\ipc\ipc_service> 
    PS C:\ncs\v2.5.0\nrf\samples\ipc\ipc_service> west build --build-dir c:/ncs/v2.5.0/nrf/samples/ipc/ipc_service/build c:/ncs/v2.5.0/nrf/samples/ipc/ipc_service --pristine --board nrf5340dk_nrf5340_cpuapp --no-sysbuild -- -DNCS_TOOLCHAIN_VERSION=NONE -DCONF_FILE=c:/ncs/v2.5.0/nrf/samples/ipc/ipc_service/prj_icmsg.conf -DEXTRA_CONF_FILE=overlay-cpuapp-sending.conf -DBOARD_ROOT=c:/ncs/v2.5.0/nrf/samples/ipc/ipc_service
    -- west build: generating a build system
    Loading Zephyr default modules (Zephyr base).
    -- Application: C:/ncs/v2.5.0/nrf/samples/ipc/ipc_service
    -- CMake version: 3.20.5
    -- Found Python3: C:/ncs/toolchains/c57af46cb7/opt/bin/python.exe (found suitable version "3.8.2", minimum required is "3.8") found components: Interpreter 
    -- Cache files will be written to: C:/ncs/v2.5.0/zephyr/.cache
    -- Zephyr version: 3.4.99 (C:/ncs/v2.5.0/zephyr)
    -- Found west (found suitable version "1.1.0", minimum required is "0.14.0")
    CMake Warning at C:/ncs/v2.5.0/zephyr/cmake/modules/boards.cmake:92 (message):
      BOARD_ROOT element without a 'boards' subdirectory:
    
      c:
    
      Hints:
    
        - if your board directory is '/foo/bar/boards/<ARCH>/my_board' then add '/foo/bar' to BOARD_ROOT, not the entire board directory
        - if in doubt, use absolute paths
    Call Stack (most recent call first):
      C:/ncs/v2.5.0/zephyr/cmake/modules/zephyr_default.cmake:129 (include)
      C:/ncs/v2.5.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
      C:/ncs/v2.5.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
      CMakeLists.txt:27 (find_package)
    
    
    -- Board: nrf5340dk_nrf5340_cpuapp
    -- Found host-tools: zephyr 0.16.1 (C:/ncs/toolchains/c57af46cb7/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.16.1 (C:/ncs/toolchains/c57af46cb7/opt/zephyr-sdk)
    -- Found Dtc: C:/ncs/toolchains/c57af46cb7/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6") 
    -- Found BOARD.dts: C:/ncs/v2.5.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp.dts
    -- Found devicetree overlay: .overlay
    <command-line>: fatal error: .overlay: No such file or directory
    compilation terminated.
    CMake Error at C:/ncs/v2.5.0/zephyr/cmake/modules/extensions.cmake:3885 (message):
      failed to preprocess devicetree files (error code 1):
      C:/ncs/v2.5.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp.dts;.overlay
    Call Stack (most recent call first):
      C:/ncs/v2.5.0/zephyr/cmake/modules/dts.cmake:226 (zephyr_dt_preprocess)
      C:/ncs/v2.5.0/zephyr/cmake/modules/zephyr_default.cmake:129 (include)
      C:/ncs/v2.5.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
      C:/ncs/v2.5.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
      CMakeLists.txt:27 (find_package)
    
    
    -- Configuring incomplete, errors occurred!
    ←[91mFATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\c57af46cb7\opt\bin\cmake.EXE' -DWEST_PYTHON=C:/ncs/toolchains/c57af46cb7/opt/bin/python.exe '-Bc:\ncs\v2.5.0\nrf\samples\ipc\ipc_service\build' -GNinja -DBOARD=nrf5340dk_nrf5340_cpuapp -DNCS_TOOLCHAIN_VERSION=NONE -DCONF_FILE=c: /ncs/v2.5.0/nrf/samples/ipc/ipc_service/prj_icmsg.conf -DEXTRA_CONF_FILE=overlay-cpuapp-sending .conf -DBOARD_ROOT=c: /ncs/v2.5.0/nrf/samples/ipc/ipc_service '-Sc:\ncs\v2.5.0\nrf\samples\ipc\ipc_service'
    ←[0m
    PS C:\ncs\v2.5.0\nrf\samples\ipc\ipc_service>

    In addition, I'm still confused about RPMSG/ICMSG, why in the configuration of RPMSG has 'CONFIG_OPENAMP=y
    CONFIG_OPENAMP_SLAVE=n // or CONFIG_OPENAMP_MASTER=n', but RPMSG does not have these two items? Thank you very much.

    Best regards,
    Yanpeng Wu

  • Yanpengwu said:
    In addition, I'm still confused about RPMSG/ICMSG, why in the configuration of RPMSG has 'CONFIG_OPENAMP=y

    I think it is just a mistake. I removed openamp in prj.conf for RPMSG and the project still builds without openamp.

    Something is wrong with your setup.

    Mine says in the log

    -- Found BOARD.dts: C:/ncs/v2.5.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp.dts
    -- Found devicetree overlay: icmsg.overlay

    and your says in the log

    -- Found BOARD.dts: C:/ncs/v2.5.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp.dts
    -- Found devicetree overlay: .overlay
    <command-line>: fatal error: .overlay: No such file or directory

    Where is the build finding .overlay in your build?

Reply
  • Yanpengwu said:
    In addition, I'm still confused about RPMSG/ICMSG, why in the configuration of RPMSG has 'CONFIG_OPENAMP=y

    I think it is just a mistake. I removed openamp in prj.conf for RPMSG and the project still builds without openamp.

    Something is wrong with your setup.

    Mine says in the log

    -- Found BOARD.dts: C:/ncs/v2.5.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp.dts
    -- Found devicetree overlay: icmsg.overlay

    and your says in the log

    -- Found BOARD.dts: C:/ncs/v2.5.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp.dts
    -- Found devicetree overlay: .overlay
    <command-line>: fatal error: .overlay: No such file or directory

    Where is the build finding .overlay in your build?

Children
Related