KSDK-1.1 SPI DMA

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

KSDK-1.1 SPI DMA

917 Views
oaf
Contributor IV

I'm using KDS-2.0.0 and KSDK-1.1.0.

When adding a spi (fsl_dspi) device to my project I could set IRQ priorities and vector, but how do I enable DMA?

I see there is two different initialization functions:

    1. DSPI_DRV_MasterInit

    2. DSPI_DRV_EdmaMasterInit

 

I have not found out how to make PEx to use the DMA type. In Cpu.c the DSPI_DRV_MasterInit() is called.

 

Should I in my own code:

     1. DSPI_DRV_MasterDeinit()

         DSPI_DRV_EdmaMasterInit()

     2. Just call DSPI_DRV_EdmaMasterInit()

Labels (1)
0 Kudos
5 Replies

572 Views
oaf
Contributor IV

Ok, and then I suppose I should ask the bean to NOT initialize the device?

0 Kudos

572 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hi Ole,

There are two ways.

1) select "Auto initialization" , then writhe the initialize function of  EDMA_SPI   to the main function.

2) Do not initialization the device ,  you can checked the " Components_Init()" function like this :

pastedImage_1.png

So , you need write initialize code refer to your need to the main function.

In a word,  check the driver function "Description",  then select you need .

pastedImage_3.png

Hope it helps

Alice

0 Kudos

572 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hi Ole,

You can configuration the spi_dma  on here:

pastedImage_0.png

and the related  spi_dma function are  these :

Hope it helps

Alice

0 Kudos

572 Views
oaf
Contributor IV

Well maybe I was a bit unclear, the PEx setup is OK but

When using IRQ:

    DSPI_DRV_MasterInit() should be used

When using DMA:

    DSPI_DRV_Edma_MasterInit() should be used

When I open the generated source file Cpu.c it calls the DSPI_DRV_MasterInit(),

so my question is how should I make Cpu.c to call DSPI_DRV_Edma_MasterInit()?

0 Kudos

572 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Ole,

In generate code , the function "DSPI_DRV_EdmaMasterInit"  can not auto show on  cpu.c file.

You can directly drag it to the place you want , like this :

pastedImage_0.png

Hope it helps

Alice

0 Kudos