K65 MQX 4.2 SPI0 DMA

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

K65 MQX 4.2 SPI0 DMA

Jump to solution
595 Views
Mike_d
Contributor IV

Hi,

I have a K64 FRDM with SPI0 and DSPI0 DMA enabled.  I can use the SPI port just fine with this but the same code does not work on the K65 TWR with SPI0 and DSPI0 DMA enabled.  What do I need to do to get this working?  It works on the K65 if I disable DSPI0 DMA.

Regards,

-Mike

1 Solution
422 Views
Mike_d
Contributor IV

The problem is in the board header file.

#define BSP_DSPI0_DMA_RX_SOURCE (16)
#define BSP_DSPI0_DMA_TX_SOURCE (17)

Should be...

#define BSP_DSPI0_DMA_RX_SOURCE (14)
#define BSP_DSPI0_DMA_TX_SOURCE (15)

View solution in original post

4 Replies
422 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi Mike

Please be aware the known limitations : DSPI issues related to the DMA usage.

When the DSPI uses the eDMA, it may transfer data incorrectly or fail when eDMA is used for another purpose. If the DSPI driver is the only user of the eDMA, it should operate correctly. This behavior is a result of the silicon design of the DSPI. DMA usage can be disabled in the DSPI driver by redefining the macro BSPCFG_DSPIx_USE_DMA to 0 in user_config.h

This known issue is documented in MQX_Release_Notes.pdf

Regards

Daniel

0 Kudos
422 Views
Mike_d
Contributor IV

Hi Daniel,

DSPI is the only user of the eDMA in this project.  It never sends anything out of the SPI bus and waits forever at 

/* block the task until completion of the background operation */
_lwsem_wait(&dspi_info_ptr->EVENT_IO_FINISHED);

If I do the same with the K64 it works.

Regards,

-Mike

0 Kudos
423 Views
Mike_d
Contributor IV

The problem is in the board header file.

#define BSP_DSPI0_DMA_RX_SOURCE (16)
#define BSP_DSPI0_DMA_TX_SOURCE (17)

Should be...

#define BSP_DSPI0_DMA_RX_SOURCE (14)
#define BSP_DSPI0_DMA_TX_SOURCE (15)

422 Views
Mike_d
Contributor IV

I have applied the MQX 4.2.0.2 patch with no change in behavior.

0 Kudos