← index #1650Issue #1642
Related · high · value 1.063
QUERY · ISSUE

stm32: Implement Asynchronous SPI Slave

openby ryannathansopened 2015-11-26updated 2017-10-24
enhancementport-stm32

This issue is to implement asynchronous sending and receiving on the SPI when configured as a slave - instead of blocking and waiting for whenever a clock is provided from the master. SPI (read and write) should probably have a configurable buffer like uart rx currently does. When the master clocks, the contents of the send buffer should be clocked out and whatever the master is sending should be clocked in to the read buffer (if exists). The user should probably be able to choose between blocking and non-blocking modes as mentioned in #1533.

Related: #1642 (async uart tx)

Bug with existing implementation:
Currently when reading SPI as a slave, the function blocks until the specified number of bytes is received or the timeout occurs. If the timeout occurs an exception is raised (OS: 116) #1414 . An exception shouldn't be raised. Whatever data was read should be returned, just as the uart read currently does.

As a result of not having asynchronous read/writes and with the existing quirky behaviors, spi slave mode seems rather unusable.

CANDIDATE · ISSUE

stm32: Implement Asynchronous UART TX

openby ryannathansopened 2015-11-24updated 2018-02-17
enhancementport-stm32

I am attempting to write large blocks (eg: 2048 bytes) of data to the UART at low baudrates whilst attempting to execute other code. I've discovered that the UART TX is actually blocking until the write is completed. This is a bit of a pain...

This issue is for creating an asynchronous write option for UART. Related to #1533

Probably either interrupt or DMA driven. Should ideally behave like the UART RX does, with a definable buffer in python code, or block as it currently does.

Reading related issues it seems like #1422 has had some success using DMA. Personally, I don't require the callback as I'm not streaming from a file, just an existing bytearray in memory.

I haven't had a chance to read the huge threads on some of the issues I've found so I'm not 100% up to date yet...

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied