cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L4 and SPI problems

M4R10
Associate III

Hello,

I'm trying to connect my nucleo stm32L496zg with an external ASD (ADS1259) through SPI interface using DMA. So I connected MISO MOSI SCK and a pin used as interrupt for the End of conversion.

If I use SPI1 no problem, I can see continuously the conversions.

But with SPI2 and SPI3 it stop to convert after few conversions (I stop to receive end of conversions interrupt)

Code for SPI1,SPI2 and SPI3 is exactly the same except for the pin used.

So I tried the same thing with another nucleo stm32l432 with the same result: SPI1 works while SPI3 not (there's not spi2 on this board).

What can be the problem?

Thanks in advance

3 REPLIES 3
S.Ma
Principal

Changing spi checklist

Pins use and alternate function

Dma channel selection

Interrupt vectors and routine

Clock enabled for gpio, dma and spi.

M4R10
Associate III

I tried with a new nucleo stm32l432kc and here it works.

Probably my others nucleo are damaged or something but doesn't matter, I just throw them from the window :)

So now I have SPI1 and SPI3 working separately.

I tried to use both together with 2 external ADC and here we have a new problem.

After some conversion SPI1 or SPI3 stop to work.

I checked HAL_SPI_TransmitReceive_DMA result and sometimes I get HAL_Busy. Is that a problem?

Is there something to set/or to know when 2 SPI are used in the same time?

M4R10
Associate III

After more test I can summarize the problem in this way:

SPI1 only works

SPI3 only works

SPI1 & SPI3 together works for about 1 or 2 minutes. After that SPI1 stop to work but SPI3 continue to works.

I tried to exchange peripheral between SPI1 and SPI3 but doesn't matter. In any case (when use both SPI together) SPI1 stops

to work after a while