Look into MCC (MultiCore Communication). If you are using Linux on the A5, there is a driver for that. If you are using MQX on the M4, there is a library for that, too.
MCC, out of the box, doesn't use DDR. It uses part of the on-chip dual-port memory. If you want to use DDR, you'll have to modify the sources for that on both sides.