nRF5340 Multicore application configuration problem

Hi all

I've tried to build the nRF5340: Multicore application on different host platforms using the nRF Connect SDK v2.1.0. It worked without any problems on Windows and Linux but failed to build on a Mac with macOS 12. nRF Connect for Desktop was used on all machines to install the Toolchain Manager.

The failed build turned out to be caused by KConfig warnings in the build process of the child image, the parent image build process seemed fine. The only difference between the child image and the parent image build process seemed to be the "Found Python3: ..." prompt, where the parent image showed the path to the version of Python in the installed NCS toolchain and the child image showed the path to the host version of Python. I assume that that's what causes problems in the subsequent build steps.

I'm not used to CMake, but a solution that seems to work is to include the following line in the CMakeLists.txt in the cpunet folder (which is the child image):

set(WEST_PYTHON <path_to_ncs_python>)

With this addition, the build also works on macOS for both the parent and the child image.

Has anybody experienced a similar problem and/or knows a better solution?

Parents
  • Hi, 

    Good to know you fix the issue. I think that is a good solution. 

    Regards,
    Amanda

  • Hi,

    What is the python version on the Mac host? Could you upload the complete log? Do you install NCS by Toolchain or manually?  Have a look Required Python dependencies

    -Amanda

  • NCS was installed using the Toolchain Manager.

    The Python version of the host is 3.10.5, while the Python version of the toolchain is 3.9.6. I suppose the version itself is not the problem, but the installed packages.

    I could install all Python dependencies on my host Python environment, but IMO that would not solve the root of the problem. The problem is that the build process of the parent image uses the toolchain's Python environment (as it should be), while the child image detects the one of the host.

    Which log would you like to have a look at?

  • Hi, 

    Is it possible to install Python v 3.9.6 on the host to see it can help or not? 

    "Found Python3: ..." prompt, where the parent image showed the path to the version of Python in the installed NCS toolchain and the child image showed the path to the host version of Python.

    I would like to see the log when it stop building the project regarding this part. 

    -Amanda

  • Hi,

    I can't downgrade Python from v 3.10.5 on the host. Although I could also install v 3.9.6, but IMO that would not help, as the build process picks the Python version from the wrong path.

    Following the log part of the child process:

    === child image rpc_host - CPUNET begin ===
    loading initial cache file /Users/noah/Projects/MA-ESW2202/code/rpc_host/build/rpc_host/child_image_preload.cmake
    Loading Zephyr default modules (Zephyr base).
    -- Application: /opt/nordic/ncs/v2.1.0/nrf/samples/bluetooth/rpc_host
    -- Found Python3: /Users/noah/.pyenv/shims/python3.10 (found suitable exact version "3.10.5") found components: Interpreter 
    -- Cache files will be written to: /Users/noah/Library/Caches/zephyr
    -- Zephyr version: 3.1.99 (/opt/nordic/ncs/v2.1.0/zephyr)
    -- Board: nrf5340dk_nrf5340_cpunet
    -- Found host-tools: zephyr 0.14.1 (/opt/nordic/ncs/toolchains/v2.1.0/opt/zephyr-sdk)
    -- Found dtc: /opt/nordic/ncs/toolchains/v2.1.0/bin/dtc (found suitable version "1.6.1", minimum required is "1.4.6")
    -- Found toolchain: zephyr 0.14.1 (/opt/nordic/ncs/toolchains/v2.1.0/opt/zephyr-sdk)
    -- Found BOARD.dts: /opt/nordic/ncs/v2.1.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpunet.dts
    -- Generated zephyr.dts: /Users/noah/Projects/MA-ESW2202/code/rpc_host/build/rpc_host/zephyr/zephyr.dts
    -- Generated devicetree_unfixed.h: /Users/noah/Projects/MA-ESW2202/code/rpc_host/build/rpc_host/zephyr/include/generated/devicetree_unfixed.h
    -- Generated device_extern.h: /Users/noah/Projects/MA-ESW2202/code/rpc_host/build/rpc_host/zephyr/include/generated/device_extern.h
    -- Including generated dts.cmake file: /Users/noah/Projects/MA-ESW2202/code/rpc_host/build/rpc_host/zephyr/dts.cmake
    
    /opt/nordic/ncs/v2.1.0/nrf/samples/bluetooth/rpc_host/prj.conf:8: warning: attempt to assign the value 'y' to the undefined symbol BT_RPC
    
    /opt/nordic/ncs/v2.1.0/nrf/samples/bluetooth/rpc_host/prj.conf:9: warning: attempt to assign the value 'y' to the undefined symbol BT_RPC_HOST
    
    /opt/nordic/ncs/v2.1.0/nrf/samples/bluetooth/rpc_host/prj.conf:32: warning: attempt to assign the value '4096' to the undefined symbol NRF_RPC_THREAD_STACK_SIZE
    
    /opt/nordic/ncs/v2.1.0/nrf/subsys/partition_manager/partition_manager_enabled.conf:7: warning: attempt to assign the value 'y' to the undefined symbol PARTITION_MANAGER_ENABLED
    
    warning: HAS_NORDIC_DRIVERS (defined at modules/hal_nordic/Kconfig:11) has direct dependencies 0 with value n, but is currently being y-selected by the following symbols:
     - SOC_SERIES_NRF53X (defined at soc/arm/nordic_nrf/nrf53/Kconfig.series:6), with value y, direct dependencies <choice> (value: y), and select condition <choice> (value: y)
    
    warning: HAS_NRFX (defined at modules/hal_nordic/nrfx/Kconfig:4) has direct dependencies 0 with value n, but is currently being y-selected by the following symbols:
     - SOC_SERIES_NRF53X (defined at soc/arm/nordic_nrf/nrf53/Kconfig.series:6), with value y, direct dependencies <choice> (value: y), and select condition <choice> (value: y)
    
    warning: NRFX_CLOCK (defined at modules/hal_nordic/nrfx/Kconfig:14) has direct dependencies HAS_NRFX && 0 with value n, but is currently being y-selected by the following symbols:
     - CLOCK_CONTROL_NRF (defined at drivers/clock_control/Kconfig.nrf:13), with value y, direct dependencies DT_HAS_NORDIC_NRF_CLOCK_ENABLED && CLOCK_CONTROL (value: y), and select condition !CLOCK_CONTROL_NRF_FORCE_ALT && DT_HAS_NORDIC_NRF_CLOCK_ENABLED && CLOCK_CONTROL (value: y)
    
    warning: NRFX_CLOCK_LFXO_TWO_STAGE_ENABLED (defined at modules/hal_nordic/nrfx/Kconfig:18) has direct dependencies NRFX_CLOCK && HAS_NRFX && 0 with value n, but is currently being y-selected by the following symbols:
     - CLOCK_CONTROL_NRF_K32SRC_XTAL (defined at drivers/clock_control/Kconfig.nrf:36), with value y, direct dependencies <choice CLOCK_CONTROL_NRF_SOURCE> (value: y), and select condition !SOC_SERIES_BSIM_NRFXX && !CLOCK_CONTROL_NRF_FORCE_ALT && <choice CLOCK_CONTROL_NRF_SOURCE> (value: y)
    
    warning: NRFX_DPPI (defined at modules/hal_nordic/nrfx/Kconfig:26) has direct dependencies HAS_NRFX && 0 with value n, but is currently being y-selected by the following symbols:
     - UART_ENHANCED_POLL_OUT (defined at drivers/serial/Kconfig.nrfx:422), with value y, direct dependencies (UART_0_ENHANCED_POLL_OUT || UART_1_ENHANCED_POLL_OUT || UART_2_ENHANCED_POLL_OUT || UART_3_ENHANCED_POLL_OUT) && UART_NRFX && SERIAL (value: y), and select condition HAS_HW_NRF_DPPIC && (UART_0_ENHANCED_POLL_OUT || UART_1_ENHANCED_POLL_OUT || UART_2_ENHANCED_POLL_OUT || UART_3_ENHANCED_POLL_OUT) && UART_NRFX && SERIAL (value: y)
    
    warning: NRFX_GPIOTE (defined at modules/hal_nordic/nrfx/Kconfig:63) has direct dependencies HAS_NRFX && 0 with value n, but is currently being y-selected by the following symbols:
     - GPIO_NRFX (defined at drivers/gpio/Kconfig.nrfx:4), with value y, direct dependencies DT_HAS_NORDIC_NRF_GPIO_ENABLED && GPIO (value: y), and select condition DT_HAS_NORDIC_NRF_GPIO_ENABLED && GPIO (value: y)
    
    warning: NRFX_NVMC (defined at modules/hal_nordic/nrfx/Kconfig:93) has direct dependencies (n || n || y || n) && HAS_NRFX && 0 with value n, but is currently being y-selected by the following symbols:
     - SOC_FLASH_NRF (defined at drivers/flash/Kconfig.nrf:10), with value y, direct dependencies (DT_HAS_NORDIC_NRF51_FLASH_CONTROLLER_ENABLED || DT_HAS_NORDIC_NRF52_FLASH_CONTROLLER_ENABLED || DT_HAS_NORDIC_NRF53_FLASH_CONTROLLER_ENABLED || DT_HAS_NORDIC_NRF91_FLASH_CONTROLLER_ENABLED) && !FLASH_NRF_FORCE_ALT && FLASH (value: y), and select condition (DT_HAS_NORDIC_NRF51_FLASH_CONTROLLER_ENABLED || DT_HAS_NORDIC_NRF52_FLASH_CONTROLLER_ENABLED || DT_HAS_NORDIC_NRF53_FLASH_CONTROLLER_ENABLED || DT_HAS_NORDIC_NRF91_FLASH_CONTROLLER_ENABLED) && !FLASH_NRF_FORCE_ALT && FLASH (value: y)
    
    error: Aborting due to Kconfig warnings
    
    Parsing /opt/nordic/ncs/v2.1.0/zephyr/Kconfig
    Loaded configuration '/opt/nordic/ncs/v2.1.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpunet_defconfig'
    Merged configuration '/opt/nordic/ncs/v2.1.0/nrf/samples/bluetooth/rpc_host/prj.conf'
    Merged configuration '/opt/nordic/ncs/v2.1.0/nrf/subsys/partition_manager/partition_manager_enabled.conf'
    CMake Error at /opt/nordic/ncs/v2.1.0/zephyr/cmake/modules/kconfig.cmake:293 (message):
      command failed with return code: 1
    Call Stack (most recent call first):
      /opt/nordic/ncs/v2.1.0/zephyr/cmake/modules/zephyr_default.cmake:121 (include)
      /opt/nordic/ncs/v2.1.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
      /opt/nordic/ncs/v2.1.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
      CMakeLists.txt:8 (find_package)
    
    
    -- Configuring incomplete, errors occurred!
    CMake Error at /opt/nordic/ncs/v2.1.0/nrf/cmake/multi_image.cmake:409 (message):
      CMake generation for rpc_host failed, aborting.  Command: 1
    Call Stack (most recent call first):
      /opt/nordic/ncs/v2.1.0/nrf/cmake/multi_image.cmake:150 (add_child_image_from_source)
      /opt/nordic/ncs/v2.1.0/nrf/samples/CMakeLists.txt:151 (add_child_image)
    
    
    -- Configuring incomplete, errors occurred!

    Thanks for your help!

  • Hi, 

    Thanks for reporting the issue. I have forwarded it to the team. Sorry for the inconvenience. 

    -Amanda 

Reply Children
  • Not yet. I would contact the team again. 

    -Amanda H.

  • Hi, 

    Sorry for the delay. Get the following information from the team:

    I think the issue is not which or how many pythons are installed but which of them are available in PATH in the environment that is used to build. It could be a solution to ensure that the offending python installation is not set in the environment (PATH / PYTHONHOME...).

    Is this a terminal in VSCode? Is this a terminal started by the toolchain manager?

    • If it's just a standalone terminal from the system then try to use one started from the toolchain manager.
    • If it was from toolchain manager, try to use VSCode

    Regards,

    Amamda H.

  • Hi,

    Thank you for your answer.

    I agree with the first part, that the problem is not "which or how many pythons are installed". But if the PATH variable was the problem, the build process should already fail when building the parent image as far as I'm aware, but it doesn't. The parent image builds fine (and picks up the toolchain's python), but the child image doesn't, because it picks up a different python (the one of the system).

    I can't remove the system's python from the PATH variable, it is needed there.

    The terminal is from VScode, where the build process is started from within the nRF Connect SDK plugin.

    I was able to termporarily get it to work:

    In the CMakeLists.txt of the child image's build folder, the symbol PYTHON_PREFER_EXECUTABLE was set to the system's python. I can set this symbol to the path of the toolchain's python to ensure that the child image also picks up the correct python version by passing this symbol from the parent's CMakeLists.txt (in the project folder, not the project's build folder) to the child image (as described here).

    I don't know why this symbol would be set wrong, maybe this helps to pin down the problem.

  • Thanks for the solution. I would forward to the team to investigate the issue.

    -Amanda H.

Related