FRDM-K64F SAI fails to transmit (example project)

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

FRDM-K64F SAI fails to transmit (example project)

Jump to solution
1,194 Views
jacobjennings
Contributor III

I have attached a very simple PX KDSK1.3 project with only an SAI module added, which blocks during initialization on a call to SAI_DRV_TxSetIntCmd due to a continuously firing ISR. The call to SAI_DRV_SendDataDma in main never happens.

 

What would really help is a working example of double-buffered (largest buffer possible) I2S master receive and transmit via eDMA, which might also resolve Here's an example for using SAI w/EDMA without the SND API (K22)..

 

Thanks,

Jake

Labels (1)
Tags (3)
1 Solution
707 Views
jacobjennings
Contributor III

After bare metal, KSDK 1.3 driver, KSDK 1.3 HAL layer approaches failed, using the KSDK 2.0 driver, I have found success in transmitting data over SAI using EDMA on the FRDM-K64F. I have not made a register-level comparison between them to determine the core issue, and probably will not, preferring to migrate my existing code to KSDK 2.0 (can't wait for kinetis expert release!) I have attached the example project for posterity.

View solution in original post

0 Kudos
6 Replies
707 Views
jacobjennings
Contributor III

This question is marked "Assumed answered", I can't seem to figure out how to undo that.

0 Kudos
707 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi Jake,

I think the driver code is not used for DMA case, and you might have to implement it based on HAL driver, but so far there is no sai DMA ksdk demo available, I just have the bare metal code for your reference, you may find it in the attachment, please refer to sai_dma_test() in sai_test.c for details. This project is for K70, but should be helpful for K64.

Hope that helps,


Have a great day,
Kan

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

707 Views
jacobjennings
Contributor III

Thank you! This is a good start.

0 Kudos
707 Views
jacobjennings
Contributor III

Hello,

Based on the example provided, I attempted to replicate a similar setup using the SAI and EDMA HAL in KSDK1.3 directly for SAI transmit only today. I have attached my test project which produces a bit clock and (incorrect) frame clock, but does not seem to trigger the DMA channel to start moving data.

Capture.PNG

If anyone has experience with SAI I would appreciate any advice.

Thanks,

Jake

0 Kudos
707 Views
jacobjennings
Contributor III

Today, I extracted the "sai_dma_test" method from the validation code provided by Kan​ and set it up in a KDS project targeting the FRDM-K64 with only it's necessary dependencies, and I also set up UART to act as a terminal. I got the exact same results with this method as I got interfacing with the KSDK 1.3 SAI / EDMA HAL in my previous post. PTC1 remains low while PTC2, PTC3 show a valid frame sync and bit clock signal.

I have attached the complete KDS project demonstrating the issue.

Thanks,

Jake

0 Kudos
708 Views
jacobjennings
Contributor III

After bare metal, KSDK 1.3 driver, KSDK 1.3 HAL layer approaches failed, using the KSDK 2.0 driver, I have found success in transmitting data over SAI using EDMA on the FRDM-K64F. I have not made a register-level comparison between them to determine the core issue, and probably will not, preferring to migrate my existing code to KSDK 2.0 (can't wait for kinetis expert release!) I have attached the example project for posterity.

0 Kudos