LPC55S69 SPI DMA Example doesn't function properly when changing Flexcomm port

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

LPC55S69 SPI DMA Example doesn't function properly when changing Flexcomm port

Jump to solution
247 Views
AveryDauben
Contributor II

When using the spi_dma_b2b example, I simply switched the SPI7 defines and clock source to SPI3, activated it's pins in the pin tool and it stops functioning. Here is the defines I changes, notice how the DMA channels are updated as well for Flexcomm 3.

#define EXAMPLE_SPI_MASTER SPI3
#define EXAMPLE_SPI_MASTER_IRQ FLEXCOMM3_IRQn
#define EXAMPLE_SPI_MASTER_CLK_SRC kCLOCK_Flexcomm3
#define EXAMPLE_SPI_MASTER_CLK_FREQ CLOCK_GetFlexCommClkFreq(3U)
#define EXAMPLE_SPI_SSEL 0
#define EXAMPLE_DMA DMA0
#define EXAMPLE_SPI_MASTER_RX_CHANNEL 10
#define EXAMPLE_SPI_MASTER_TX_CHANNEL 11
#define EXAMPLE_MASTER_SPI_SPOL kSPI_SpolActiveAllLow

Then I change this code for Flexcomm 3 as well:

/* attach 12 MHz clock to SPI3 */
CLOCK_AttachClk(kFRO12M_to_FLEXCOMM3);

/* reset FLEXCOMM for SPI */
RESET_PeripheralReset(kFC3_RST_SHIFT_RSTn);

At this point it stops working, so I believe something in the background is needing to be changed as well, but I'm not familiar with the SPI, DMA or SPI_DMA drivers.

Thank you for your help!

Labels (2)
Tags (3)
0 Kudos
Reply
1 Solution
207 Views
Habib_MS
NXP Employee
NXP Employee

Hello @AveryDauben,

The DMA has a separate DMA request for each Flexcomm, as shown in the following image:

Habib_MS_0-1744062424504.png


If you wish to modify the Flexcomm, it is essential to modify these channels. For example, channels 18 and 19 correspond to the Flexcomm 7 interface, which is why the macros are defined as follows:

#define EXAMPLE_SPI_MASTER_RX_CHANNEL 18
#define EXAMPLE_SPI_MASTER_TX_CHANNEL 19


Also, if you experience any issue, does not hesitate to let me know.

BR
Habib.

View solution in original post

0 Kudos
Reply
4 Replies
208 Views
Habib_MS
NXP Employee
NXP Employee

Hello @AveryDauben,

The DMA has a separate DMA request for each Flexcomm, as shown in the following image:

Habib_MS_0-1744062424504.png


If you wish to modify the Flexcomm, it is essential to modify these channels. For example, channels 18 and 19 correspond to the Flexcomm 7 interface, which is why the macros are defined as follows:

#define EXAMPLE_SPI_MASTER_RX_CHANNEL 18
#define EXAMPLE_SPI_MASTER_TX_CHANNEL 19


Also, if you experience any issue, does not hesitate to let me know.

BR
Habib.

0 Kudos
Reply
149 Views
AveryDauben
Contributor II
@Habib_MS

Hello,
could you please attach the file that you are looking at? The Dual-DMA usage pdf on the LPC55S6x page is not fully up-to-date. Thank you!
0 Kudos
Reply
64 Views
Habib_MS
NXP Employee
NXP Employee

Hello @AveryDauben,

The table was taken from the user manual, which you can find on this page:

Habib_MS_1-1744646940073.png

BR
Habib.

0 Kudos
Reply
186 Views
AveryDauben
Contributor II

Thank you, this fixed the issue. I must've had an outdated version of the DMA channels as FlexComm 2 and 3 aren't switched on this pdf.

0 Kudos
Reply