MQX 4.0 SPI support

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

MQX 4.0 SPI support

Jump to solution
1,135 Views
igor-imx
Contributor IV

Hi Everyone

I've been working with MQX starting with version 3.7 and now have downloaded the latest 4.0 version.

In MQX 3.8 SPI drivers were DMA based, however when i have checked the code for in MQX 4.0 i noticed that there is no DMA support for SPI drivers anymore.

This is not a concern, per say, however, i just would like to know if there was a specific reason for removing DMA support form the SPI drivers.

Was it done because of some known issues with DMA/SPI combination or for some other reason?

The reason im asking is because i would like to use DMA based SPI transfers in our project.

Thank you

Igor

1 Solution
592 Views
pavel_chromy
NXP Employee
NXP Employee

Dear Igor,

it is not so that DMA support was "removed".

In fact, whole SPI driver framework was redesigned for better scalability and performance.

Legacy DSPI driver with DMA support behaves like an "interrupt" driver with a non-blocking behaviour, which means that it barely provided CPU offload, which is typically the primary reason for using DMA.

Since MQX 4.0 there is only a single API for new SPI driver, no matter whether the driver internally works as polled, interrupt or DMA. There is also a plan to provide SPI drivers with DMA support in the future.

If you plan to use SPI at low bitrates then the new DSPI driver with interrupts enabled lowers CPU usage. If you plan to use higher bitrates then the new driver provides better performance than the legacy one with comparable CPU usage.

Best regards,

  Pavel

View solution in original post

3 Replies
593 Views
pavel_chromy
NXP Employee
NXP Employee

Dear Igor,

it is not so that DMA support was "removed".

In fact, whole SPI driver framework was redesigned for better scalability and performance.

Legacy DSPI driver with DMA support behaves like an "interrupt" driver with a non-blocking behaviour, which means that it barely provided CPU offload, which is typically the primary reason for using DMA.

Since MQX 4.0 there is only a single API for new SPI driver, no matter whether the driver internally works as polled, interrupt or DMA. There is also a plan to provide SPI drivers with DMA support in the future.

If you plan to use SPI at low bitrates then the new DSPI driver with interrupts enabled lowers CPU usage. If you plan to use higher bitrates then the new driver provides better performance than the legacy one with comparable CPU usage.

Best regards,

  Pavel

592 Views
igor-imx
Contributor IV

Thank you very much Pavel.

0 Kudos
592 Views
lisa_tx
Contributor III

Hello Pavel,

I start to use MQX 3.8. I need to write my own SPI interrupt service routine. Under MQX 3.8, I had managed to do so with function calls _int_install_isr(), _bsp_dspi_io_init(), _bsp_int_init() as well as direct SPI register access. I need both SPI master and SPI slave. When I upgrade to MQX 4.0, my SPI slave code doesn't work. I have checked "Freescale MQX RTOS 4.0.1 Release Notes". For SPI I/O Driver, the release notes says "This driver supports master mode of operation." It doesn't mention if this SPI I/O driver supports SPI slave mode or not.

What is your suggestion?

Lisa

0 Kudos