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
Solved! Go to Solution.
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)
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
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
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)
I have applied the MQX 4.2.0.2 patch with no change in behavior.