Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: write-only SPI.cpp DMA transfers are not working #280

Open
RudolphRiedel opened this issue Dec 29, 2020 · 0 comments
Open

Bug: write-only SPI.cpp DMA transfers are not working #280

RudolphRiedel opened this issue Dec 29, 2020 · 0 comments

Comments

@RudolphRiedel
Copy link

RudolphRiedel commented Dec 29, 2020

As I wrote here: adafruit/Adafruit_ZeroDMA#24
write-only transfers with
https://github.com/adafruit/ArduinoCore-samd/blob/master/libraries/SPI/SPI.cpp
are currently not working.

The issue is that the receiver needs to be disabled in the SERCOM units but SPI.cpp is not directly writing to the SERCOM unit, it is using https://github.com/adafruit/ArduinoCore-samd/blob/master/cores/arduino/SERCOM.cpp and SERCOM.cpp currently has no methods implemented to disable and re-enable the transceiver.

As a workaround I allowed the DMA to overwrite my output buffer with the incoming "data":
SPI.transfer( ((uint8_t *) &EVE_dma_buffer[0])+1, ((uint8_t *) &EVE_dma_buffer[0]), (((EVE_dma_buffer_index)*4)-1), false );

But only after I ran into the issue that this write-only transfers are appear to be working while killing following SPI.transfer(0x00) calls.

I suggest to not allow write-only transfers untill these actually do work to not let others fall into this trap.
This could be done by not allowing a NULL pointer for rxbuff.

I fixed my issue with a workaround but after that I went back to use ZeroDMA instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant