SPI slave: multiple TRANS_DONE interrupts
Posted: Mon Jul 23, 2018 12:12 pm
Hello.
We use ESP-WROOM-32 module (ESP32 rev 0) and ESP-IDF v3.1/
We use SPI in slave mode.
We have encountered the following issue.
We continuously launch SPI transfers from master
(at least 300 times per second).
We have tested two different transfer sizes
(64 bytes with and without DMA, 1536 bytes with DMA).
When necessay amount of data is clocked into ESP32,
interrupt SPI_TRANS_DONE_INT occurs more than once:
a) at least twice after full packet is transferred but before CS signal rises.
b) and at least once after CS signal rises.
So there are at least two extra interrupts.
We consider it is not normal.
And maybe that wouldn't bother us,
but we have to fill transfer queue continuously with outgoing packets.
Because of above-mentioned extra interrupts
at least two transfer descriptors are lost by the SPI driver on each actual SPI transfer
(on each interrupt new transfer descriptor is taken from the queue,
but only the last transfer really occurs).
We tried to find a workaround.
And we processed only one interrupt of the group and ignored all others.
But in this case after some (random) time of operation
SPI slave starst failing to receive packets from master
(only first byte of the transfer is received).
What can be done to fix it?
Best regards,
Pavel
We use ESP-WROOM-32 module (ESP32 rev 0) and ESP-IDF v3.1/
We use SPI in slave mode.
We have encountered the following issue.
We continuously launch SPI transfers from master
(at least 300 times per second).
We have tested two different transfer sizes
(64 bytes with and without DMA, 1536 bytes with DMA).
When necessay amount of data is clocked into ESP32,
interrupt SPI_TRANS_DONE_INT occurs more than once:
a) at least twice after full packet is transferred but before CS signal rises.
b) and at least once after CS signal rises.
So there are at least two extra interrupts.
We consider it is not normal.
And maybe that wouldn't bother us,
but we have to fill transfer queue continuously with outgoing packets.
Because of above-mentioned extra interrupts
at least two transfer descriptors are lost by the SPI driver on each actual SPI transfer
(on each interrupt new transfer descriptor is taken from the queue,
but only the last transfer really occurs).
We tried to find a workaround.
And we processed only one interrupt of the group and ignored all others.
But in this case after some (random) time of operation
SPI slave starst failing to receive packets from master
(only first byte of the transfer is received).
What can be done to fix it?
Best regards,
Pavel