This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RTOS crash with SPI interrupts on Concerto

I enabled SPI interrupts using the following functions under RTOS before calling BIOS_start():

IntRegister(INT_SSI0, SSI0IntHandler);
IntEnable(INT_SSI0);
SSIIntEnable(SSI0_BASE,SSI_RXFF|SSI_RXOR);
SSIIntRegister(SSI0_BASE, SSI0IntHandler);

When the interrupt is triggered I get the following crash:

ti.sysbios.family.arm.m3.Hwi: line 1124: E_noIsr: id = 23, pc = 00211068
Exception occurred in background thread at PC = 0x00211068.
Core 0: Exception occurred in ThreadType_Task.
Task name: {empty-instance-name}, handle: 0x200244d8.
Task stack base: 0x20024528.
Task stack size: 0x400.
R0 = 0x200248c4  R8  = 0xffffffff
R1 = 0x00216740  R9  = 0xffffffff
R2 = 0x00000000  R10 = 0x00216b88
R3 = 0x00000008  R11 = 0x00216ce0
R4 = 0x00000390  R12 = 0x200248c4
R5 = 0x00000090  SP(R13) = 0x20024848
R6 = 0x000001f4  LR(R14) = 0x00211067
R7 = 0xffffffff  PC(R15) = 0x00211068
PSR = 0x4100f000
ICSR = 0x00423817
MMFSR = 0x00
BFSR = 0x00
UFSR = 0x0000
HFSR = 0x00000000
DFSR = 0x00000000
MMAR = 0xe000ed34
BFAR = 0xe000ed38
AFSR = 0x00000000
Terminating execution...

Are there RTOS specific functions I need to call to make this work, such as: Hwi_Params_init, Hwi_create?

There are no examples that use SPI interrupts for RTOS.

Thanks

  • The latest T-RTOS (1.10.00.23) has SPI support for Concerto. There is a driver and a loopback example that shows how to use it.

    http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/tirtos/index.html

    Todd

  • I looked at C:\ti\tirtos_1_10_00_23\packages\examples\spiloopback.c.  I'm not sure how the two spi transfer modes are implemented:

    /*!
    * @brief
    *
    * SPI transfer mode determines the whether the SPI controller operates
    * synchronously or asynchronously. In ::SPI_MODE_BLOCKING mode SPI_transfer()
    * blocks code execution until the SPI transaction has completed. In
    * ::SPI_MODE_CALLBACK SPI_transfer() does not block code execution and instead
    * calls a ::SPI_CallbackFxn callback function when the transaction has
    * completed.
    */
    typedef enum SPI_TransferMode {
    /*!
    * SPI_transfer() blocks execution. This mode can only be used when called
    * within a Task context
    */
    SPI_MODE_BLOCKING,
    /*!
    * SPI_transfer() does not block code execution and will call a
    * ::SPI_CallbackFxn. This mode can be used in a Task, Swi, or Hwi context.
    */
    SPI_MODE_CALLBACK
    } SPI_TransferMode;

    Does SPI_MODE_BLOCKING yield to other tasks when used inside a task.  Are these two modes implemented behind the scenes with fifo hardware interrupts, or do they use polling behind the scenes?

  • SPI_MODE_BLOCKING puts the calling Task into a blocked state; allowing lower priority tasks to run. Currently, its DMA driven (utilizing the SPI FIFOs) and it generates an interrupt when the transfer has completed.

    SPI_MODE_CALLBACK, does exactly the same thing, but it doesn't block the Task's execution for the duration of the transfer. Instead, you will need to provide a callback function so your application can be notified when the transfer finished.