[riot-notifications] [RIOT-OS/RIOT] STM32_common/SPI: Reduce the overhead in the DMA hot path (#14097)

MrKevinWeiss notifications at github.com
Tue May 19 12:17:16 CEST 2020


It seems like there is a problem.
I used the nucleo-f411re connected to PHiLIP in echo mode (so the expected behaviour is to echo bytes back after received and the initial response will be 0x7F).

It appears that a byte is stuck in the send register when using the DMA so there is some sort of one byte offset.

Could it be something to do with the DMA filling the tx or rx buffer and not being reset after the transmission. I had a problem like that in another project and the only way that I could clear the DMA and spi fifo was to shut down the periph clock...

<details><summary>With PR on nucleo-f411re</summary>

```
2020-05-19 11:04:28,326 #  send 123456789
2020-05-19 11:04:28,329 # Sent bytes
2020-05-19 11:04:28,337 #    0    1    2    3    4    5    6    7    8 
2020-05-19 11:04:28,346 #   0x31 0x32 0x33 0x34 0x35 0x36 0x37 0x38 0x39
2020-05-19 11:04:28,354 #     1    2    3    4    5    6    7    8    9 
2020-05-19 11:04:28,355 # 
2020-05-19 11:04:28,359 # Received bytes
2020-05-19 11:04:28,367 #    0    1    2    3    4    5    6    7    8 
2020-05-19 11:04:28,375 #   0x38 0x7f 0x31 0x32 0x33 0x34 0x35 0x36 0x37
2020-05-19 11:04:28,382 #     8   ??    1    2    3    4    5    6    7 
```
</details>

<details><summary>Master without dma on nucleo-f411re</summary>

```
2020-05-19 11:05:58,102 # main(): This is init 0 0 0 0 4
2020-05-19 11:05:58,112 # SPI_DEV(0) initialized: mode: 0, clk: 0, cs_port: 0, cs_pin: 4
send 123456789 4
2020-05-19 11:06:00,822 #  send 123456789
2020-05-19 11:06:00,825 # Sent bytes
2020-05-19 11:06:00,832 #    0    1    2    3    4    5    6    7    8 
2020-05-19 11:06:00,840 #   0x31 0x32 0x33 0x34 0x35 0x36 0x37 0x38 0x39
2020-05-19 11:06:00,847 #     1    2    3    4    5    6    7    8    9 
2020-05-19 11:06:00,848 # 
2020-05-19 11:06:00,852 # Received bytes
2020-05-19 11:06:00,859 #    0    1    2    3    4    5    6    7    8 
2020-05-19 11:06:00,867 #   0x7f 0x31 0x32 0x33 0x34 0x35 0x36 0x37 0x38
2020-05-19 11:06:00,874 #    ??    1    2    3    4    5    6    7    8 
2020-05-19 11:06:00,875 # 
```
</details>


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/14097#issuecomment-630726914
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20200519/d88d0c3b/attachment.htm>


More information about the notifications mailing list