MQX 2 SPI Channel Operate by DMA problem

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

MQX 2 SPI Channel Operate by DMA problem

644 Views
mehmetduman
Contributor I

Hi,

We use two spi channels, spi1: for display driver, spi2: for flash memory. All spi channel use DMA.

While send data from internal ram to flash memory by spi2 port, spi1 port operates properly, but  while send data from external ram connected by flexbus to flash memory by spi2, spi1 port stopped and never will be work until restart device.

We update LCD by spi1 every 200mS with 5040bytes data.

We write 512 byte data to flash memory every 200mS.

SPI1: use number 2, 3, 4, 7 pins.

SPI2: use number 140, 141, 142, 143, 144 pins

Device:  MK60FX512VLQ12

MQX version: 4.2.0

user config:

#define MQX_CPU                 PSP_CPU_MK60DF120M

/* BSPCFG_ENABLE_LEGACY_II2C_SLAVE is the flag to enable interrupt driven i2c
   slave driver.
   If it's enabled, the driver will register interrupt handler to corresponding
   I2C SDA pin muxing port vector, and please make sure your application would not
   register handler on same interrupt vector.
*/
#define BSPCFG_ENABLE_LEGACY_II2C_SLAVE     0

/* MGCT: <generated_code> */
#define BSPCFG_ENET_SRAM_BUF                      1

#define BSPCFG_ENABLE_I2C0                        0

/* BSPCFG_ENABLE_LEGACY_II2C_SLAVE is the flag to enable interrupt driven i2c
** slave driver.
** If it's enabled, the driver will register interrupt handler to corresponding
** I2C SDA pin muxing port vector, and please make sure your application would not
** register handler on same interrupt vector. */
#define BSPCFG_ENABLE_LEGACY_II2C_SLAVE           0
#define BSPCFG_ENABLE_RTCDEV                      1
#define BSPCFG_ENABLE_SPI1                        1
#define BSPCFG_DSPI1_USE_DMA                      1
#define BSPCFG_ENABLE_SPI2                        1
#define BSPCFG_DSPI2_USE_DMA                      1
#define BSPCFG_ENABLE_IODEBUG                     1
#define BSPCFG_HAS_SRAM_POOL                      1

#define BSPCFG_ENABLE_ITTYD                       1
#define BSPCFG_SCI3_QUEUE_SIZE                    256

#define BSPCFG_ENABLE_ITTYE                       1
#define BSPCFG_SCI4_QUEUE_SIZE                    256

#define BSPCFG_ENABLE_ITTYF                       1
#define BSPCFG_SCI5_QUEUE_SIZE                    256

#define BSP_DEFAULT_IO_CHANNEL                    "iodebug:"

#define MQX_USE_IDLE_TASK                         1

#define MQX_USE_EVENTS                            0
#define MQX_USE_MESSAGES                          0
#define MQX_USE_SEMAPHORES                        0

#define MQX_USE_LOGS                              0
#define MQX_USE_LWLOGS                            0
#define MQX_LWLOG_TIME_STAMP_IN_TICKS             0
#define MQX_TIMER_USES_TICKS_ONLY                 0

#define MQX_TASK_DESTRUCTION                      1

#define MQX_KERNEL_LOGGING                        0

#define MQXCFG_ENABLE_FP                          1
#define MQX_INCLUDE_FLOATING_POINT_IO             1
#define MQX_ENABLE_LOW_POWER                      0

#define RTCSCFG_ENABLE_ICMP                       1
#define RTCSCFG_ENABLE_SNMP                       0
#define RTCSCFG_ENABLE_UDP                        1
#define RTCSCFG_ENABLE_TCP                        1
#define RTCSCFG_ENABLE_STATS                      1
#define RTCSCFG_ENABLE_GATEWAYS                   1

Tags (3)
0 Kudos
1 Reply

380 Views
Carlos_Musich
NXP Employee
NXP Employee

Hi Mehmet,

As you mentioned that you are also using Flexbus I think that your problem could be related to a known issue described in 'MQX_Release_Notes.pdf'.

SPI 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 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.

Regards,

Carlos