MQX K60 SPI Slow, interrupt mode still calling polled functions

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

MQX K60 SPI Slow, interrupt mode still calling polled functions

Jump to solution
641 Views
shelves
Contributor I

Hi,

 

I'm using the Kinetis Tower K60N512 board. I have run the LTC ADC board examples using the SPI ioctrl command. However, even if you set the mode to be interrupt, the MQX SPI int routine still calls the MQX polled functions for every character. This is slowing my performance.

 

Does anyone have an example of using the interrupt function to just read, or just write. The ioctrl read/write functions are not fast enough for me.

0 Kudos
1 Solution
360 Views
DavidS
NXP Employee
NXP Employee

Hi Shelves,

I updated the MQX3.8/mqx/examples/spi/spic as follows to operate in the either polled (the default setting) or interrupt mode.

    #if ! BSPCFG_ENABLE_SPI2 && ! BSPCFG_ENABLE_ISPI2
        #error This application requires BSPCFG_ENABLE_SPI2 or BSPCFG_ENABLE_ISPI2 defined non-zero in user_config.h. Please recompile kernel with this option.
    #endif
    #if BSPCFG_ENABLE_SPI2
       #define TEST_CHANNEL_POLLED  "spi2:"
 #endif
    #if BSPCFG_ENABLE_ISPI2
        #define TEST_CHANNEL_INT    "ispi2:"
    #endif

 

In my user_config.h I have the following:

#define BSPCFG_ENABLE_ISPI2                       1

 

Always recompiler the RTOS after any change to user_config.h.

 

Please note that IOCTL calls always are accomplished via a polled method.  The inerrupt is used when the fread/fwrite() functions are called.  Please look at the memory_int.c functions as reference.

 

Hope this helps.

Regards,

David

 

 

View solution in original post

0 Kudos
2 Replies
361 Views
DavidS
NXP Employee
NXP Employee

Hi Shelves,

I updated the MQX3.8/mqx/examples/spi/spic as follows to operate in the either polled (the default setting) or interrupt mode.

    #if ! BSPCFG_ENABLE_SPI2 && ! BSPCFG_ENABLE_ISPI2
        #error This application requires BSPCFG_ENABLE_SPI2 or BSPCFG_ENABLE_ISPI2 defined non-zero in user_config.h. Please recompile kernel with this option.
    #endif
    #if BSPCFG_ENABLE_SPI2
       #define TEST_CHANNEL_POLLED  "spi2:"
 #endif
    #if BSPCFG_ENABLE_ISPI2
        #define TEST_CHANNEL_INT    "ispi2:"
    #endif

 

In my user_config.h I have the following:

#define BSPCFG_ENABLE_ISPI2                       1

 

Always recompiler the RTOS after any change to user_config.h.

 

Please note that IOCTL calls always are accomplished via a polled method.  The inerrupt is used when the fread/fwrite() functions are called.  Please look at the memory_int.c functions as reference.

 

Hope this helps.

Regards,

David

 

 

0 Kudos
360 Views
c0170
Senior Contributor III

Hello shelves,

 

Unfortunately, I have not any example which could help you.  However, this is known issue and SPI driver is going to be redesigned in MQX 4.0.

 

Regards,

MartinK

0 Kudos