DMA MUX on MK02FN128VFM10

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

DMA MUX on MK02FN128VFM10

跳至解决方案
921 次查看
bloatedwarthog
Contributor I

I have been working on getting Example 7.1.5 from this document:  http://cache.freescale.com/files/32bit/doc/quick_ref_guide/KQRUG.pdf  working on our MK02.

I have the PIT configured and working, but whenever I try to reference the DMA MUX registers for either read or write operations, I get a hard fault. The register I'm trying to access is DMAMUX_CHCFG0 at address 0x40021000.

Reading section 21.3 of this manual:  http://cache.freescale.com/files/microcontrollers/doc/ref_manual/K02P64M100SFARM.pdf  says that the address is at the location I'm trying to access. I'm a little confused why even trying to access the location causes a hard fault.  In any case, I'm wondering if you could ask around and find out if anyone has this sample running on the MK02. I want to do exactly what the sample does which is read the ADC at a particular frequency and DMA the results to a block of memory.

The code I'm using is literally as simple as:

     uint8_t test = DMAMUX_CHCFG0;

    LOG_DEBUG1("DMAMUX_CHCFG0: %x\n", test);

I've also looked at the definitions from the mac7100.h file used by Keil. That defines the config register as DMAMUX_CHCONFIG0 at address 0xFC084000. This doesn't match the hardware docs I have so I assume it is referencing a different chip. Just for fun I tried accessing the register but got the same result.

Anyway, thanks in advance for any clues you can provide.

标签 (1)
标记 (2)
0 项奖励
回复
1 解答
726 次查看
EarlOrlando
Senior Contributor II

Hello,

Is the clock gating for the DMAMUX enabled? Please be sure that the field DMAMUX in the register SIM_SCGC6 is enabled before to write/read in the DMAMUX_CHCFGn register.

Best regards,

Earl.

在原帖中查看解决方案

2 回复数
727 次查看
EarlOrlando
Senior Contributor II

Hello,

Is the clock gating for the DMAMUX enabled? Please be sure that the field DMAMUX in the register SIM_SCGC6 is enabled before to write/read in the DMAMUX_CHCFGn register.

Best regards,

Earl.

726 次查看
bloatedwarthog
Contributor I

Thanks Earl. That was it. For everyone else, here's the working snippet:

SIM_WR_SCGC6_DMAMUX(SIM, 1);

uint8_t test = DMAMUX_CHCFG0;

LOG_DEBUG1("DMAMUX_CHCFG0: %x\n", test);

0 项奖励
回复