Configure a nrf5340 ble peripheral with a customized net core based on the ipc_radio sample under sdk v3.0.2.

Hi,

I would like to create a project for a BLE peripheral for nrf5340 based on a standard sample like "peripheral LBS" und nrfConnect SDK v3.0.2 with modifications both in app core as well as in the net core application.

Of course, the original LBS sample itself is building and running as expected on my nrf5340dk. But as soon as I try to copy the ipc_radio code into a child_image sub folder and adjust the CMakeList.txt and sysbuild.cmake in a similar way that I used for earlier projects (in 2.x versions of the nrf connect sdk) the system tries to build not two, but three parts - my app core code, the code of ipc_radio from the sdk sample directories and additionally the code I copied into the child_image sub folder... and fails to build. 

How do I need to setup my build configuration and the config and CMake files to make the system build the lbs app code and the ipc_radio code from my subdirectory only and not use the sdk's version of ipc_radio anymore?

Being new to sdk v3.x I use this lbs sample for getting to know the behavior of the system, before I go into my "real" project in which I want to create a custom BLE peripheral with modifications and extensions to the ipc_radio code on the net core side.

Your advice is greatly appreciated.

Thanks,

Jens

  • Dear Kenneth, 

    you probably are right, that there is no other sample having a sysbuild/ipc_radio directory under the project folder.

    What I do not understand, however, is the configuration part: Why are the samples, when built for nrf5430 using the SDK provided files for the net core? There seem to be no obvious parameters leading to this usage. So: What I need to know is, how to prevent this default usage and make the system build from the local configs and sources only. This should be some kind of config setting or something in CMakeLists.txt or similar. 

    => How do I deactivate building the net core from the SDK and activate sysbuild for using local files - or better "preferring" local files, if they are present. This behavior might work in the throughput sample for the one config contained, but the default in prj.conf from the SDK is not that terribly different ... so I do not know for sure, if the sample even uses this local prj.conf. For me it definitely does not take any sources form the local directory.

    In my old projects I explicitly configured the use of my local files by sysbuild.cmake files etc... but if I do this in sdk v3.0.2 sysbuild seems to try to build ipc_radio from the sdk and additionally my local copy leading to errors because this does not really make sense.

    I do not see any hint in the documentation how to explicitly deactivate this behavior.

    All advice to overcome this behavior is very welcome.

    Thanks, 

    Jens

  • I'm trying to achieve similar thing, except in my case I'm mostly satisdied with "stock" ipc_radio, except I would like to enable CONFIG_IPM_CONSOLE_SENDER on cpunet and RECEIVER on cpuapp.

    Enabling this in config does not initialize anything and it seems extra code is needed (like in zephyr/tests/drivers/ipm/).

    But I don't know how customize source code for ipc_radio. Likely it's not possible and "stock" ipc_radio needs to be disabled in sysbuild (default for NRF_DEFAULT_IPC_RADIO changed to n in Kconfig.sysbuild) and instead external image with modified ipc_radio added to sysbuild.cmake, like in  https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/lessons/lesson-8-sysbuild/topic/exercise-2-adding-custom-image/, in ex:


    set(IMAGE_NAME "ipc_radio")
    
    ExternalZephyrProject_Add(
      APPLICATION ${IMAGE_NAME}
      SOURCE_DIR ${APP_DIR}/${IMAGE_NAME}
      BOARD pan1783_evb/nrf5340/cpunet
    )
    
    set_property(GLOBAL APPEND PROPERTY PM_CPUNET_IMAGES ${IMAGE_NAME})
    set_property(GLOBAL PROPERTY DOMAIN_APP_CPUNET ${IMAGE_NAME})
    set(CPUNET_PM_DOMAIN_DYNAMIC_PARTITION ${IMAGE_NAME} CACHE INTERNAL "")
    
    add_overlay_config(
      ${IMAGE_NAME}
      ${APP_DIR}/${IMAGE_NAME}/overlay-bt_hci_ipc.conf
    )
    
    sysbuild_add_dependencies(CONFIGURE ${DEFAULT_IMAGE} ${IMAGE_NAME})
    sysbuild_add_dependencies(FLASH ${DEFAULT_IMAGE} ${IMAGE_NAME})
    

    And it appears to compile it just so perhaps will work for you, try it out. In my case custom image buids fine but then sysbuild fails anyway:
     
    ninja: error: 'net_provision.hex', needed by 'merged_CPUNET.hex', missing and no known rule to make it
    FATAL ERROR: command exited with status 1: /home/maciek/.nrfutil/sdks/toolchains/c5be9c56c7/usr/local/bin/cmake --build /home/maciek/Projects/ESA-PAD/rh-software/Firmware/build

    I would like to see some example with custom cpunet app AND secureboot on cpunet.
Related