Page 1 of 1

SPI Write Collision

Posted: Mon Oct 17, 2016 11:33 am
by Marco
Hi,

I found a bug in the AVR SPI driver.

When doing multiple multi-byte SPI write operations, the Write Collision Flag (WCOL) bit in SPI Status Register (SPSR) gets set.
This is caused by calling

Code: Select all

_spi_isr_code(spip);
while the transmission is still in progress.

Attached is a patch to fix this issue.

Marco

Re: SPI Write Collision

Posted: Mon Oct 17, 2016 11:54 am
by utzig
That patch doesn't seem to have been created against trunk. What version are you using?

Re: SPI Write Collision

Posted: Mon Oct 17, 2016 12:13 pm
by Marco
No i'm sorry. I'm using the git mirror at commit 11eb96e. (svn://svn.code.sf.net/p/chibios/svn/trunk@9759).

Attached is the patch created against trunk.

Re: SPI Write Collision

Posted: Mon Oct 17, 2016 12:18 pm
by utzig
Both patches apply the same changes.

Re: SPI Write Collision

Posted: Mon Oct 17, 2016 12:25 pm
by Marco
Yes, i just recreated the patch with TortoiseSVN on the SVN trunk. The changes are the same.

Re: SPI Write Collision

Posted: Mon Oct 17, 2016 1:02 pm
by utzig
The problem seemed to arrive from using patch on Mac OS X with CRLF line endings...

Applied, thanks!