Accessing my kernel rpmsg buffer from user space

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Accessing my kernel rpmsg buffer from user space

Jump to solution
2,141 Views
ababatola
Contributor III

Hi,

I have been able to communicate between my imx8mp MPU and the MCU.  However, I want to access the data in the shared memory from the user space.  Is there an example for this?

I would also like to ask if the imx_rpmsg_pinpong.c device driver can be extended to handle linux Userspace I/O for the communication between the kernel space and the user space.

Thanks

Labels (1)
Tags (3)
0 Kudos
Reply
1 Solution
2,083 Views
hector_delgado
NXP TechSupport
NXP TechSupport

Hi @ababatola ,

I hope you're doing well! Sorry for the late reply.

I'd recommend taking a look at the rpmsg_lite_str_echo_rtos multicore example found in the i.MX 8M Plus SDK. It's a simple application which allows you to send a message from the Cortex A to the Cortex M and then M4 displays what is received, and echoes back the same message as an acknowledgement. 

You can build and download the SDK from https://mcuxpresso.nxp.com/

Let me know if this works for you.

Best regards,
Hector.

View solution in original post

0 Kudos
Reply
2 Replies
2,084 Views
hector_delgado
NXP TechSupport
NXP TechSupport

Hi @ababatola ,

I hope you're doing well! Sorry for the late reply.

I'd recommend taking a look at the rpmsg_lite_str_echo_rtos multicore example found in the i.MX 8M Plus SDK. It's a simple application which allows you to send a message from the Cortex A to the Cortex M and then M4 displays what is received, and echoes back the same message as an acknowledgement. 

You can build and download the SDK from https://mcuxpresso.nxp.com/

Let me know if this works for you.

Best regards,
Hector.

0 Kudos
Reply
128 Views
EANGJS
Contributor I
Hi,
I am also looking at the same issue. The example you provided works with the kernel module.
However, I am actually looking for a example userspace application. Could you provide a sample C program i can run on the linux side within userspace.
Thanks!
0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-1745199%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EAccessing%20my%20kernel%20rpmsg%20buffer%20from%20user%20space%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1745199%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3EI%20have%20been%20able%20to%20communicate%20between%20my%20imx8mp%20MPU%20and%20the%20MCU.%26nbsp%3B%20However%2C%20I%20want%20to%20access%20the%20data%20in%20the%20shared%20memory%20from%20the%20user%20space.%26nbsp%3B%20Is%20there%20an%20example%20for%20this%3F%3C%2FP%3E%3CP%3EI%20would%20also%20like%20to%20ask%20if%20the%20imx_rpmsg_pinpong.c%20device%20driver%20can%20be%20extended%20to%20handle%20linux%20Userspace%20I%2FO%20for%20the%20communication%20between%20the%20kernel%20space%20and%20the%20user%20space.%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1745199%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3Ei.MX%208M%20%7C%20i.MX%208M%20Mini%20%7C%20i.MX%208M%20Nano%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2388071%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Accessing%20my%20kernel%20rpmsg%20buffer%20from%20user%20space%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2388071%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EHi%2C%3CBR%20%2F%3EI%20am%20also%20looking%20at%20the%20same%20issue.%20The%20example%20you%20provided%20works%20with%20the%20kernel%20module.%3CBR%20%2F%3EHowever%2C%20I%20am%20actually%20looking%20for%20a%20example%20userspace%20application.%20Could%20you%20provide%20a%20sample%20C%20program%20i%20can%20run%20on%20the%20linux%20side%20within%20userspace.%3CBR%20%2F%3EThanks!%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1749773%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Accessing%20my%20kernel%20rpmsg%20buffer%20from%20user%20space%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1749773%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F215623%22%20target%3D%22_blank%22%3E%40ababatola%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%0A%3CP%3EI%20hope%20you're%20doing%20well!%20Sorry%20for%20the%20late%20reply.%3C%2FP%3E%0A%3CP%3EI'd%20recommend%20taking%20a%20look%20at%20the%20rpmsg_lite_str_echo_rtos%20multicore%20example%20found%20in%20the%20i.MX%208M%20Plus%20SDK.%20It's%20a%20simple%20application%20which%20allows%20you%20to%20send%20a%20message%20from%20the%20Cortex%20A%20to%20the%20Cortex%20M%20and%20then%26nbsp%3BM4%20displays%20what%20is%20received%2C%20and%20echoes%20back%20the%20same%20message%20as%20an%20acknowledgement.%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20can%20build%20and%20download%20the%20SDK%20from%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fmcuxpresso.nxp.com%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fmcuxpresso.nxp.com%2F%3C%2FA%3E%3C%2FP%3E%0A%3CP%3ELet%20me%20know%20if%20this%20works%20for%20you.%3C%2FP%3E%0A%3CP%3EBest%20regards%2C%3CBR%20%2F%3EHector.%3C%2FP%3E%3C%2FLINGO-BODY%3E