Hi Niranjan,
To do this you must handle M4 application as a Linux Kernel Module (LKM).
The following post shows a good example of an application than runs as a LKM.
Running RPMsg Demo Applications for Multicore Communication with IMX6SX and IMX7D
To add your custom LKM to munuconfig and to be built with the whole kernel you may look for general Linux literature.
2 good references are the following books:
Title: Linux Driver development for Embedded Processors
Author: Alberto Liberal de los Rios
Title: Embedded Linux Primer
Author: Christopher Hallinan
Best regards,
Carlos
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------