STM32 SPI using DMA
#43154
Replies: 1 comment 2 replies
-
So my first issue was incorrect dmas-setting. I had not set the request ID correctly to 3 that is correct according to the ref manual. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've been struggling with SPI for a few days and thought I'd ask here.
I have a display connected through 1-line SPI so I naturally need to send things quickly on that line.
So far I've not been using DMA and I've noticed that it is rather slow.
Looking at the signals I can see a ~2us gap between every byte sent and it seems to be overhead of some form in the LL driver.
Before trying to figure out if I can decrease that time I thought I'd try DMA instead but I can't get it to run properly.
I've enabled DMA:
CONFIG_SPI_STM32_DMA=y
I'm using SPI3 on a STM32L452, it is connected to DMA2, channel 1 and 2.
I've configured it like this:
&spi3 {
pinctrl-0 = <&spi3_sck_pc10_custom &spi3_mosi_pc12_custom>;
status = "okay";
cs-gpios = <&gpioa 15 GPIO_ACTIVE_LOW>;
dmas = <&dma2 2 3 0x20440>,
<&dma2 1 3 0x20480>;
dma-names = "tx", "rx";
..........
};
I've also enabled DMA2.
&dma2{
status = "okay";
};
What's happening is a timeout from "wait_dma_rx_tx_done" and I can confirm that the dma_callback is never called.
Anyone have any ideas what I'm doing wrong?
Edit: Changed the DMA config and now there's at least something happening even though it isnät working fully. Will report back.
Beta Was this translation helpful? Give feedback.
All reactions