I only see polling and interrupt demos for the ecspi on the Cortex-M4 side of the iMX7. I was wondering if you had a DMA version?
Possibly answering my own question it looks like the iMX7 has a single SDMA controller and the device-tree shows Linux has taken complete ownership of it. Does this mean the Cortex-M4 is completely incapable of using DMA?
I only see polling and interrupt demos for the ecspi on the Cortex-M4 side of the iMX7. I was wondering if you had a DMA version?
We do not have DMA controller driver on freeRTOS for M4.
Possibly answering my own question it looks like the iMX7 has a single SDMA controller and the device-tree shows Linux has taken complete ownership of it. Does this mean the Cortex-M4 is completely incapable of using DMA?
At a time only one core can utilize the resource. If A7 acquires the DMA controller M4 cannot use it and vice versa.
Using DMA controller from M4 side, will effect all other peripherals using DMA channels on A7 side.
Also note that the ECSPI has a rather large FIFO, which makes the interrupt load really not that big of a deal, especially for the M4 core…
This is the upshot of my investigation (I haven’t gotten it working yet) into the imx7 SDMA: It appears really powerful, but very complicated to get started. The imx.6 appears to use the same SDMA engine. The SDMA essentially has its own microprocessor that can be programmed in assembly language. I could not find a compiler for it - but read of someone writing their own. The manual for the sdma is over 200 pages long - I could not find any white paper on how to really use it. I concluded it is just too complicated and no simple examples of how to use as of April or 2017 - so my way to avoid having to use it will be to just have a fast interrupt do what I would have had it do - the A7 is fast enough, it shouldn’t be a problem. The SDMA is a common resource available to any of the 3 processors - I found 2 c files related to a linux use of it, but I think that code was part of a larger set of code I couldn’t find. My guess is only users of million lot quantities who have in house NXP support really have it working - for the rest of us, I recommend use the lightening speed of the A7 to avoid having to learn it
Note that our Linux BSP running on the two A7’s makes use of SDMA for ECSPI. The question above was about Cortex-M4. You can find the driver in drivers/dma/imx-sdma.c. As mentioned above, the FreeRTOS BSP does not have a SDMA driver. Hence using SDMA outside of Linux requires writing your own driver… I do not have experience with the IP, and judging from the Linux driver it seems not to be an entirely trivial IP. The SDMA controller also needs a firmware to be loaded on startup (see sdma_load_firmware
).