You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enter a peripheral driver for peripheral B (before the transfer to A completes)
Set peripheral B's chip select low
Send a byte to peripheral B
Set peripheral B's chip select high
On completion of the asynchronous transfer, set chip select high for peripheral A
In this sequence, an SPI transfer has started when the chip select for peripheral B is set low, which will cause peripheral B to receive incorrect data. It will also cause a contention between the MISO lines on peripheral A & B.
Typically synchronous SPI drivers manage the chip select without checking the state of the SPI peripheral. This will make it very difficult to make a driver-internal change to correct this behaviour.
Possible solutions:
An SPI peripheral can be configured as one of synchronous or asynchronous at any given time. A mechanism like acquire() will need to be used to prevent both from existing simultaneously.
The synchronous API can be deprecated
The synchronous API can be changed to require the chip select to be managed through the SPI peripheral (e.g. with a setCS() and clearCS() API). This would allow the SPI peripheral to block while waiting for asynchronous APIs to complete.
The text was updated successfully, but these errors were encountered:
Suppose the following sequence is executed:
In this sequence, an SPI transfer has started when the chip select for peripheral B is set low, which will cause peripheral B to receive incorrect data. It will also cause a contention between the MISO lines on peripheral A & B.
Typically synchronous SPI drivers manage the chip select without checking the state of the SPI peripheral. This will make it very difficult to make a driver-internal change to correct this behaviour.
Possible solutions:
acquire()
will need to be used to prevent both from existing simultaneously.The text was updated successfully, but these errors were encountered: