zephyr: stm32 SPI problems with DMA and INTR set-up
I on my stm32f412 discovered that a SPI3 config related issues.
1st) the rx and tx dma channel must be the same 2nd) the comms to my lsm6ds3 sensor only works when the DMA and INTR config is disabled
my board dts:
// activate spi3 to access the LSM6DS3 and ADS1292
&spi3 {
pinctrl-0 = <&sensor_clk &sensor_miso &sensor_mosi>;
// chip select
// 0: PC9 -> MOV_SS
// 1: PB5 -> EEG_ADC_SS
cs-gpios = <&gpioc 9 GPIO_ACTIVE_LOW>, <&gpiob 5 GPIO_ACTIVE_LOW>;
// spi3 tx stream 5 on channel 0
// spi3 rx stream 2 on channel 0
dmas = <&dma1 5 0 0x440 0x03>, <&dma1 2 0 0x480 0x03>;
dma-names = "tx", "rx";
status = "okay";
lsm6ds3: lsm6ds3@0 {
compatible = "st,lsm6ds3";
label = "LSM6DS3";
reg = <0>;
spi-max-frequency = <10000000>;
// PC8 MOV interrupt 1 (MOV_INT1)
// PA8 MOV interrupt 2 (MOV_INT2)
int1-gpios = <&gpioc 8 GPIO_ACTIVE_HIGH>;
int2-gpios = <&gpioa 8 GPIO_ACTIVE_HIGH>;
};
ads1292: ads1292@1 {
compatible = "ti,ads1292";
label = "ADS1292";
reg = <1>;
spi-max-frequency = <2048000>;
// PB4 EEG data ready (EEG_ADC_DRDY)
drdy-gpios = <&gpiob 4 GPIO_ACTIVE_HIGH>;
};
};
the config
CONFIG_SPI=y
# CONFIG_SPI_STM32_INTERRUPT=y
# CONFIG_SPI_STM32_DMA=y
# CONFIG_SPI_ASYNC=y
As said the interrupt and/or dma option breaks my code. Means that the transfer to lsm6ds3 fails. Also the transfer to ads1292 fails from time to time.
When using different DMA channels the SPI driver complains with:
<err> dma_stm32: dma stream 0 is busy.
Any idea why only same dma channels for rx&tx are working?
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 17 (6 by maintainers)
@StefJar I’m moving this issue as “question” until we’re able to prove the issue actually lies in the driver. We’ll try to analyse your point meanwhile.