Kinetis K10 SAI/I2S + DMA RX

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

Kinetis K10 SAI/I2S + DMA RX

跳至解决方案
1,594 次查看
nlemoz
Contributor I

Hi Everyone,

Trying to get the kinetis K10 to do DMA with TX and RX.

I am using processor expert with mqxlite.

The chip is MK10DN64.

What works:

SSI_LDD TX and RX without DMA.

SSI_LDD TX with DMA.

What doesn;t work
SSI_LDD RX with DMA

I get buffers returned to me by the I2S driver but they are always completely filled with 0 even though GetReceivedDataNum returns the correct number of bytes.

I am using an 8 KHz 16 bit stereo stream.

The kinetis is generating the MCLK and the codec is generating bit and frame clocks.

The frame and bit clocks are shared between RX and TX.

I have not touched the driver code at all, just using what processor expert generates.

I've noticed that processor expert gives you a lot of latitude in choosing DMA settings even though many combinations will not work.

Does any body have any advice on which settings I might have configured incorrectly?

One other question....

Should this question be in the processor expert forum instead?

Thanks in Advance.

标签 (1)
0 项奖励
回复
1 解答
1,136 次查看
nlemoz
Contributor I

I've looked further into this and the issue seems to be caused by the I2S driver giving DMA the wrong source address for the receiver.

It should be 0x4002F0A0 but it tells the DMA that it's 0x4002F0A2.

The offending line is in the I2S init stuff and looks like this:

DescriptorAddressPtr->SourceAddress = (LDD_DMA_TAddress)(I2S_PDD_GetRxDataChannelRegAddress(I2S0_BASE_PTR, 0U) + 0x02UL);

The problem is that "+0x02UL" on the end.

Remove that and it seems to start working.

Now to find out whether it is my settings or a driver bug.


在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,137 次查看
nlemoz
Contributor I

I've looked further into this and the issue seems to be caused by the I2S driver giving DMA the wrong source address for the receiver.

It should be 0x4002F0A0 but it tells the DMA that it's 0x4002F0A2.

The offending line is in the I2S init stuff and looks like this:

DescriptorAddressPtr->SourceAddress = (LDD_DMA_TAddress)(I2S_PDD_GetRxDataChannelRegAddress(I2S0_BASE_PTR, 0U) + 0x02UL);

The problem is that "+0x02UL" on the end.

Remove that and it seems to start working.

Now to find out whether it is my settings or a driver bug.


0 项奖励
回复
1,136 次查看
Monica
Senior Contributor III

Nlemoz,

Sorry for the delay! Thanks a lot for sharing this workaround with Community, we're happy to have you as part of it!

Keep up the hard work :smileywink:

Best,

Monica,

0 项奖励
回复