Can't DMA to off-chip Memory

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Can't DMA to off-chip Memory

跳至解决方案
2,112 次查看
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

标记 (4)
0 项奖励
回复
1 解答
1,862 次查看
pmt
Contributor V

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

在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,862 次查看
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 项奖励
回复
1,863 次查看
pmt
Contributor V

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

0 项奖励
回复