Hello TI support community,
I am trying to modify (drivers/spi/spi-omap2-mcspi.c)
omap4 mcspi drivers in order to use interrupts instead of polling.
I use beaglebone black.
After I set CS active and enable channel 0 and interrupts,
I receive only two interrupts (in fact a pair):
- tx0_empty and after this I fill the tx buffer by writing in the
mcspi tx reg n-times
and then reset the flag in IRQSTATUS
- as a follow up to the actions taken for tx0_empty,
rx0_full interrupt is risen and I read the mcspi rx reg n-times
and reset the flag in IRQSTATUS.
After that no interrupt comes (neither of tx_empty, rx_full or EOT)
even if interrupts and channel0 are enabled and CS is active,
so I can not transfer remaining data.
FIFO is enabled and OMAP2_MCSPI_XFERLEVEL is setup accordingly (but similar happens if FIFO is disabled).
Note that if I want to transfer a message that needs only one pair
of interrupts,
then EOT interrupt comes, which is the expected behavior.
I used only transfer len less than DMA_MIN_BYTES (160) so dma is not used.
If I use the polling method to see if something is pending on channel0
everything works well (this is the default behavior in spi-omap2-mcspi.c
omap2_mcspi_txrx_pio()).
Another thing: If I set CS active and enable channel 0, then in IRQSTATUS is set
up TX0_EMPTY and after interrupts are enabled, TX0_EMPTY interrupt will occur.
But if I reset the TX0_EMPTY bit in IRQSTATUS before enabling interrupts
(as the am335x manual says in chapter 24.3.4.1 Interrupt-driven operation:
The interrupt status bit should always be reset after the channel is
enabled and before the event is enabled as an interrupt source) then
no interrupts will occur even if I enable interrupts after that.
Has anybody used omap4 mcspi in interrupt mode (without dma)?
Thank you and kind regards,
L-C. Duca