cancel
Showing results for 
Search instead for 
Did you mean: 

Shared memory access from the A7’s linux user space.

JSpra
Associate III

What is the best mechanism to access shared memory from the A7’s linux user space? I have tried using mmap and was successful at reading shared memory; however, I get memory exceptions when attempting to write. Could it be that I can only write to this memory in kernel space?

I can find documentation for the M4 processor and how to define shared memory in linker script. No luck with linux doc's other than “remoteproc�? and “rpmsg�? documentation, neither give clear instruction on how this is done.

Could you please refer me to some documentation that could help me get a better understanding on how this is done.

Thanks in advance!

2 REPLIES 2
PatrickF
ST Employee

Hello,

did you find this https://wiki.st.com/stm32mpu/wiki/Exchanging_buffers_with_the_coprocessor ?

and more specifically this example: https://wiki.st.com/stm32mpu/wiki/How_to_exchange_large_data_buffers_with_the_coprocessor_-_example

Regards

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Patrick,

Thanks, this was great help! So is the answer to my question is to use DMA to access memory on the A7's side of the shared memory, ie dma_alloc_writecombine?

I need to get a better understanding of DMA and Cache Coherence, so I guess it's time to do that. I think using rpsmg-sdb-mod is the best approach in the long run: however, I also would like to get an understanding how the shared memory actually works.

Please let me know if I'm on the correct track here,

Thanks for your help!

John