Can't DMA to off-chip Memory

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

Can't DMA to off-chip Memory

Jump to solution
2,118 Views
pmt
Contributor V

Hello,

I have written an DMA SPI driver in MQX (but not MQX's driver), however I can't get the DMA to write to externally configured (FlexBus) SRAM.  Writes to internal memory works fine.  I'm using the K60 processor.

I'm sure there is a protection bit somewhere preventing this, but given the number of peripherals that could effect this (SIM, Flexbus, DMA, Crossbar Swtich, MPU, AIPS), I wanted to put this question to the group in the hopes someone would just know.  I have FBSEL set to allow off-chip code and data access.  Non-DMA off-chip access works fine.

Thanks!

PMT

0 Kudos
Reply
1 Solution
1,868 Views
pmt
Contributor V

Problem found.  DMA does not interact with cache.  Cache flushes are needed when DMA'ing into cacheable regions.

View solution in original post

0 Kudos
Reply
2 Replies
1,868 Views
soledad
NXP Employee
NXP Employee

Hi,

MQX 4.0.2 Kinetis BSPs are prepared for use with DMA. Make sure that you enable DMA for SPI modules in your user configuration. In user config.h, make sure you configure:

  BSPCFG_DSPI0_USE_DMA 1

  BSPCFG_DSPI1_USE_DMA 1

  BSPCFG_DSPI2_USE_DMA 1

build time options. Then build BSP with these configuration. For source code effects, check init_spi.c in the /mqx/source/bsp/

Regards

Sol

0 Kudos
Reply
1,869 Views
pmt
Contributor V

Problem found.  DMA does not interact with cache.  Cache flushes are needed when DMA'ing into cacheable regions.

0 Kudos
Reply