MQX 4.0.2 k64 DSPI dma howto

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

MQX 4.0.2 k64 DSPI dma howto

1,007 Views
paullau
Contributor II

when porting from MQX 4.0.2 for K60 to MQX 4.0.2 for K64, we hit a problem.

Apparently, the BSP for K64 has DSPI1 dma turned off (Vs K60 with DSPI1 dma turned on).

Since we rely on the DSPI1 dma in our app, here are some questions regarding the K64 port:

in twrk64F120m.h, the BSP_DSPI1_DMA_RX_SOURCE, BSP_DSPI1_DMA_TX_SOURCE are not the same as in twrk60f120m.h

#define BSP_DSPI1_DMA_RX_CHANNEL        (2)

#define BSP_DSPI1_DMA_TX_CHANNEL        (3)

#define BSP_DSPI1_DMA_RX_SOURCE         (16)          // was 18 in twrk60f120m.h

#define BSP_DSPI1_DMA_TX_SOURCE         (16)          // was 19 in twrk60f120m.h

If I need to enable DMA on DSPI1,

1) can I use any number other than 16 in RX_SOUCE, TX_SOURCE?

2) do I need different number for RX_SOURCE and TX_SOURCE?

3) what does the number mean anyway? Does it tie to IRQ assignment or DMS source id as described in the K64 Hardware Reference Manual?

If so, is there other porting of the MQX BSP that need to be modified to match with the RX_SOURCE and TX_SOURCE?

5 Replies

649 Views
paullau
Contributor II

Hi Manuel,

I have been off the project for a while, so please bear with me if my recollection does not serve you well.

From what I remember, moving from K60 to K64, NXP (was Freescale) changed the hardware such that one of the 2 DSPxx is full duplex (with 2 DMA channels, 1 for Rx and 1 for Tx), while the other one can only be selected as either Rx or Tx DMA. This is a Silicon decision and cannot be reversed.  So our work around was to swap our Hardware peripheral to use the one that has 2 DMA channels assigned for the one that really needs it.  The newer BSP does not address the issue because there is a hardware difference (downgrade in this respect) moving up to K64 

Best regards,

Paul

0 Kudos

649 Views
m4l490n
Contributor V

paullau‌ thanks for replying.

After posting my question to you I started to dive a little bit more in the documentation and I found the why, which coincides with what you are saying. I'm going to document it here in case someone else stumbles upon this thread.

(This may be different for other MCUs but you can search for the name of the chapters and sections in the respective reference manual.)

  This information is well buried in the 1835 pages of the K64 Reference manual as if NXP was trying to hide it. There is no reference to this information on Chapter 22 eDMA which I think it should be when it talks about the DMA architecture and mentions the "sources". Anyway, you have to go to section 3.3.9 DMA request multiplexer configuration where it's a table called DMA request sources where the numbers for the sources are defined.

According to this table, the source number for both Transmit and Receive for SPI1 is 16 which corresponds with that definition in the code. In this table, you can find the source numbers for all peripherals thus eliminating the mistery of those numbers.

This could be found really easily if it was referenced in the DMA chapter of the document. The chapter just mentions the "sources" but it is up to you to find them.

I hope this helps somebody else.

0 Kudos

649 Views
soledad
NXP Employee
NXP Employee

hi,

Please try using the MQX for the TWRK64F120M or MQX for the FRDM-K64F you can download it from the next link : MQX: Freescale MQX™ Software Solutions


Have a great day,
Regards
Sol
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

649 Views
paullau
Contributor II

This does not answer my question yet. In fact, the MQX 4.0.2 BSP for K64 is where I start off before hitting the problem.

My question is more on how I can specify the proper MQX dspi dma parameters so that it will work on our hardware,

and if there are other area in MQX source that I need to adjust in order to match with the parameters I specified here.

0 Kudos

649 Views
m4l490n
Contributor V

paullau‌ did you find a solution for this? Here I am 5 years later with the exact same question.

soledad‌ or danielchen@fsl could you please help with this, I will appreciate it.

0 Kudos