Sharing large buffers between A5 and M4

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

Sharing large buffers between A5 and M4

Jump to solution
1,096 Views
rbarris
Contributor I

Say a userspace process on Linux on the A5 downloads a large sigl file into memory (DDR3).  I make the assumption that because this is Linux, there is an MMU active, the the underlying physical memory backing the allocation may not be contiguous..

what's involved in enabling the M4 to look into that buffer and play back the signal through the DAC?

Is there a path whereby the process on A5 side can explicitly allocate a chunk of contiguous memory that is linearly mapped, populate it, and then inform the M4 where it is in physical RAM.

I am sure I have some faulty assumptions here; the underlying idea is can I have both processors able to access a single large buffer in DDR3.

0 Kudos
1 Solution
671 Views
timesyssupport
Senior Contributor II

This question was also answered here:

Sharing large buffers between A5 and M4 in Vybrid VF6xx

MCC can be used to share data between the M4 and A5 core. The implementation defaults to using SRAM to store buffers, with buffer size of 1kB. Source modifications to MCC can be made if you wish to change the location of the base address of shared memory, max number of buffers used, or the buffer size.

Regards,

Timesys Support

View solution in original post

0 Kudos
4 Replies
671 Views
rbarris
Contributor I

Aha, I am new to the community board and I posted in the wrong section.  This was a question relating to Vybrid VF6xx which has an ARM A5 and M4 core on chip.

0 Kudos
671 Views
karina_valencia
NXP Apps Support
NXP Apps Support

timesyssupport can you help on this case?

0 Kudos
672 Views
timesyssupport
Senior Contributor II

This question was also answered here:

Sharing large buffers between A5 and M4 in Vybrid VF6xx

MCC can be used to share data between the M4 and A5 core. The implementation defaults to using SRAM to store buffers, with buffer size of 1kB. Source modifications to MCC can be made if you wish to change the location of the base address of shared memory, max number of buffers used, or the buffer size.

Regards,

Timesys Support

0 Kudos
671 Views
TomE
Specialist II

What is an "A5" and what is an "M4". What part are you using? Are these ColdFire parts?

Read up about "mmap()" for mapping memory and files to each other.

We have a compressed file that contains bitmaps that is in the flash filesystem. We call "system()" to run the decompressor and send it to a file on "/tmp", whih is a RAM-based filesystem. Then we "mmap()" that into the application space so it can read it directly rather than reading it as a file..

You normally have hardware handled by drivers, so you'd then send the data down to the driver via a system call.

Look at how the /dev/fb framebuffer device drivers work

Otherwise, if what you call the "M4" has direct access to the same memory as th other CPU (running Linux) then you probably want to send the physical addresses of the blocks of memory to the other CPU. Normally this is done by drivers and not the application though.

Doesn't the linux distribution already come with support for your hardware and examples of how to use it?

A better architecture would be to reserve a fixed block of the physical memory that the "M4" knows about, and then map that memory into driver space or possibly even into.

Google should be your friend here.

Tom

0 Kudos