Fail to run the IPC Service-icmsg sample on nRF5340 DK

Hi Support team,


I tried to run the IPC Service-icmsg sample(l\zephyr\samples\subsys\ipc\ipc_service\icmsg) on the nRF5340 DK but failed.
I opened the sample in VS code and created build configuration with default settings as below screenshot. Not selecting 'Use sysbuild', and build succeed, two images were generated. After I flashed to the target, only one log was printed on the application console, and nothing on the network console, please see the screenshot below.

My questions are:
1 without using 'Use sysbuild', the remote image also can be generated and flashed to the network core? this is different from the sample of 'Multicore Hello World application', which use the sysbuild to generate a merged image and flash to two cores.
2 How can I run this IPC Service-icmsg sample on nRF5340 DK? need to set something in somewhere?

BTW, I saw a similar tick and no one answered it in the DevZone(devzone.nordicsemi.com/.../ipc-service-sample-with-icmsg-backend-not-working).

Thank you very much.

    

Parents
  • Hi Yanpeng,

    I opened the sample in VS code and created build configuration with default settings as below screenshot. Not selecting 'Use sysbuild', and build succeed, two images were generated. After I flashed to the target, only one log was printed on the application console, and nothing on the network console, please see the screenshot below.

    I tried to reproduce this, but didn't get your issue.

    In NCS v2.5.0, I built icmsg for nrf5340dk_nrf5340_cpuapp without sysbuild, and icmsg_remote for nrf5340dk_nrf5340_cpunet, without sysbuild. I connected to both cores over UART in the VS Code extension, and got output on both sides:

    Could it be that there's something with the Serial Terminal configuration? Could you try rebuilding, and testing through the serial terminals through the "Connected Devices" tab?

    Regarding sysbuild, I have to admit that it is new to me as well. I've never used it. All multi-image builds I have done have been through the use of child images. But if I understand correctly, this will slowly be replaced by sysbuild. I see that there have been sysbuild-related changes to this sample in NCS v2.5.0:

    https://github.com/zephyrproject-rtos/zephyr/commit/19cc0fe099d2f252d7410aaa29cb4569f18917e2

    I realise I might not have answered your question entirely. Is this sufficient information for now? Let me know if you still can't get output on the network core.

    Best regards,

    Raoul

  • Hi Raoul,

    Thanks for your reply.
    I realized there is no need for 'sysbuild' in this sample because the project 'remote' was included as an external project in the /icmsg/CMakeLists.txt as below:

    The reason why it cannot run successfully may be that my steps are wrong. I listed my steps below, could you help check it?


    1 Open the sample in the VS Code.
           The sample includes two projects, one is 'icmsg', and another is 'remote' which is located in 'icmsg' as a sub-directory.
           I only need open one VS code to open 'icmsg', no need to open 'icmsg' and 'remote' separately in two VS codes, is it right?
    2 In one VS code, I use the default build configuration as below: (Only one build configuration for 'cpuapp'.)
              

    3 Start build, I can see both two images for the application core and the network core can be generated.

             

    4 I use two 'Serail Terminal in nRF Connect for Desktop' to connect the application core with 'COM5', and the network core with 'COM6', but only can see one log on COM5 as described in previously.

    5 Closed the 'Serail Terminal' and used the serial terminals in 'Connected Devices' tab of VS code, the result is the same. Only one log was printed from the application core, but nothing from the network core.

    Thank you very much.

Reply
  • Hi Raoul,

    Thanks for your reply.
    I realized there is no need for 'sysbuild' in this sample because the project 'remote' was included as an external project in the /icmsg/CMakeLists.txt as below:

    The reason why it cannot run successfully may be that my steps are wrong. I listed my steps below, could you help check it?


    1 Open the sample in the VS Code.
           The sample includes two projects, one is 'icmsg', and another is 'remote' which is located in 'icmsg' as a sub-directory.
           I only need open one VS code to open 'icmsg', no need to open 'icmsg' and 'remote' separately in two VS codes, is it right?
    2 In one VS code, I use the default build configuration as below: (Only one build configuration for 'cpuapp'.)
              

    3 Start build, I can see both two images for the application core and the network core can be generated.

             

    4 I use two 'Serail Terminal in nRF Connect for Desktop' to connect the application core with 'COM5', and the network core with 'COM6', but only can see one log on COM5 as described in previously.

    5 Closed the 'Serail Terminal' and used the serial terminals in 'Connected Devices' tab of VS code, the result is the same. Only one log was printed from the application core, but nothing from the network core.

    Thank you very much.

Children
  • Hi again,

    In my case, I did actually open/add two separate NCS applications in my VS Code window, and built and flashed them both separately - with the build configurations I mentioned in my last reply.

    Would you mind trying this? Unfortunately I'm a bit busy at the moment so I'm trying to save some time. If that doesn't work for you, please let me know, and I'll take a closer look at the CMake config etc. that you shared!

    Best regards,

    Raoul

  • Hi Raoul,

    I add the 'remote' as a separate application in the VS code, and can compile both 'icmsg' and 'remote' separately, but the result is the same.

    Actually, the 'remote' is a sub-directory under 'icmsg' and was added as an ExternalProject in \icmsg\CMakeLists.txt, so it is the same to build 'icmsg' only or build 'icmsg' and 'remote' separately.

    In the 'ACTIONS->Flash' tab, I can only flash two images at the same time, How did you flash two images separately?

    To get more information, I added some logs in the \icmsg\src\main.c and found logs before 'k_sem_take(&bound_sem, K_FOREVER)' can be printed, but after that, the system on application core seems blocked by semaphore and no any logs.

    Is there a dependency on the boot sequence of the application core and the network core? for example, need to start the network core first?

    In my case, I only can flash both images at the same time. 

    Thank you very much.

  • And could you attach your application projects here? I can try to run it to see the result.

  • Hi again,

    I try to set breakpoints and run the debug. I found the main() in the network core was not starting.
    The main() in the application core went to _sleep after the code k_sem_take(&bound_sem, K_FOREVER), please see the below screenshot.

    Maybe the network core was not brought up before the application core went to sleep? I don't know if this is the reason there is no log printed from the Network core console.

  • I can run the sample successfully now. I'd like to put a summary here:


    1. The project 'icmsg' is for the app-core and has a subdirectory 'remote' for net-core.
    With the default build (without sysbuild) can build two images for two cores. The reason for not using sysbuild and can build two images is that in the CMakeLists.txt, the 'remote' was added as an ExternalProject.
    2. When Flash, in my case, only the app-core image was flashed successfully, we can know this by the 'read' in the tool 'nRF Connect for Desktop'.'Programmer'.
    3. In this situation, I open the 'remote' project separately in the VS code and flash the net-core image separately.

    After that, I can see the traces on the net-core.

Related