Kinetis K10 SAI/I2S + DMA RX

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

Kinetis K10 SAI/I2S + DMA RX

Jump to solution
884 Views
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.

Labels (1)
0 Kudos
1 Solution
426 Views
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.


View solution in original post

0 Kudos
2 Replies
427 Views
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 Kudos
426 Views
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 Kudos