Dear @joel_mcm
Data Exchange Mechanism
To access shared memory you will need a driver on the Linux side. Rpmsg is already there, so this is the most straight-forward choice. However, you could write your own simple driver which does nothing but accessing a shared memory area.
The RPMSG buffer size can be modified in the Linux rpmsg driver:
arm/mach-imx/imx_rpmsg.c. Look for the constant RPMSG_BUF_SIZE
.
Afaik the default buffer size is 512 bytes (not 256).
Available DRAM for the M4
There is 2MB of DRAM reserved to be used by the M4:
0x8FE_00000 - 0x8FFF_FFFF
A small share of this is reserved for the rpmsg library (initialized from the Linux side), and therefore cannot be used for other purposes:0x8FFF_0000 - 0x8FFF_0FFF
and
0x8FFF_8000 - 0x8FFF_8FFF
Additional Considerations
Note that the memory selection does hugely influence your application performance. Accessing the tightly coupled memory (TCM) from the M4 can be done in 1-2 CPU cycles. Accessing the OCRAM takes roughly 10-20 cycles, and the DRAM is even slower.
With this background, my approach would basically be:
- place all the code in the TCM
- place as much of the variables you use also into the TCM - especially variables which you access more than once.
- sample the ADC data in a loop and apply the decimation filter after each sample (maybe this is a way to reduce the size of the mentioned 8x4096 floating point buffer?)
- Transfer the decimated data to the A7 core (which means copying the data to the DRAM), using rpmsg or a customized protocol for shared memory.
Regards, Andy