Skip to main content
Graduate II
June 2, 2020
Question

rpmsg_client_sample linux kernel module loads automatically ?

  • June 2, 2020
  • 2 replies
  • 1035 views

STM32MP1Cube 1.1.0

Case:

  1. unload /remove the module rpmsg_client_sample 
  2. check lsmod the module is not loaded.
  3. start the M4 with OpenAMP raw example

4. the rpmsg_client_sample  is automatically loaded.

Questions:

  1. what is the mechanism behind how is this module loaded ?
  2. How prevent this and manual load rpmsg_client_sample 
  3. How to replace this module with a custom module to interact with the M4 code?
    This topic has been closed for replies.

    2 replies

    Technical Moderator
    June 3, 2020

    Hi @debugging​ 

    Find below answer from expert :

    1. what is the mechanism behind how is this module loaded ?
    2. How prevent this and manual load rpmsg_client_sample 

    There are two mechanism involved

    • automatic module loading is based on modeprobe. You can have a look at https://wiki.gentoo.org/wiki/Kernel_Modules for details.
      • RPMG bus mechanism that probes drivers registered if the name service defined matches. The principle is that on an end-point creation the cortex-M4 sends a “name service announcement�? message to the Linux. The RPMsg bus ( in Linux Kernel) checks for a Linux driver that supports this service name. If yes it probes the driver.  
    1. How to replace this module with a custom module to interact with the M4 code?

    I would suggest you to use the rpmsg_tty driver instead that creates a virtual UART communication between Linux application and the Cortex-M4

    Olivier

    debuggingAuthor
    Graduate II
    June 5, 2020

    @OliverG,

    Many thanks. So I the driver rpmsg_client_sample must be removed when when building the kernel., correct?

    Is there an easy way to find the drivers that match a certain “name service announcement" before starting a kernel build or at runtime ?

    Thanks

    Technical Moderator
    June 8, 2020

    Hi @debugging​ 

    registered drivers are listed in : /sys/bus/rpmsg/drivers

    But to know associated services you need to dig into the code.

    Olivier