Access eMMC from M4 (and RAM)

Hi,
I need to load a database (~10MB) from the filesystem (e.g. eMMC) within my M4 program. Is this possible? Can i access the eMMC from the M4 without disturbing the Linux OS running on the A7 cores? It would be okay to store the database on a separate partition. And another quite basic question: It seems that the M4 shares the RAM with the A7. Is this correct? How many RAM can the M4 use? Regards

hi @qojote

Hi, I need to load a database (~10MB) from the filesystem (e.g. eMMC) within my M4 program. Is this possible?
What you mean with loading a database? What are you doing with this database?

Can i access the eMMC from the M4 without disturbing the Linux OS running on the A7 cores? It would be okay to store the database on a separate partition.
It should be possible with the correct driver. However NXP does not provide the driver.Please have a look here.

And another quite basic question: It seems that the M4 shares the RAM with the A7. Is this correct? How many RAM can the M4 use?
The memory Layout of the A7 and m5 Cpu is explained here.

The database is stored on the eMMC and loading means to read the content from ‘disk’ into the memory (RAM). The database contains calibration values and i need to access them fast.

Thanks for the link. The linked post says that one would need a driver but noone provides it. I guess it means that i cannot acces the eMMC. Maybe the SD card approach could work for me.

Again thanks for the information.

All peripherals are shared between the cores, so in theory you can access the eMMC from the M4 core. However, since Linux is already accessing it, it would need to synchronize with Linux (e.g. set a semaphore to prevent the M4 from interferieren in the middle of a command). File systems etc, are not designed to be accessed from two independent stacks. But this could probably be worked around by using separate partitions. On the M4 side we do not have drivers from eMMC access. All in all this would be a non-trivial endeavour.

What I suggest to do is using a proxy (daemon) on the Linux side which loads the data on request. You can use RPmsg to listen for commands from the M4 core, and load/store the file when required.

Almost the whole address space is shared, so you can use any amount from the M4 side. Just make sure that Linux is not using that particular area. We carve out 2MiB of memory at the end of the first 256MiB in U-Boot, see board/toradex/colibri_imx7/colibri_imx7.c. You can increase that amount if necessary. Note that this area of DDR memory is uncached from the M4 side and therefor not well suited for code execution.