Search found 21 matches

by fvantienen
Wed May 21, 2025 10:43 am
Forum: Bug Reports
Topic: STM32 SPIv2 v2 driver reset
Replies: 2
Views: 14246

STM32 SPIv2 v2 driver reset

For the STM32F7 I noticed that the v2 driver didn't function properly, when the lld_disable was called from the lld_start and the state was not SPI_STOP. This is because both CR1 and CR2 are fully reset, which somehow leads to wrong clock pulses being send.

In order to fix this only the SPE should ...
by fvantienen
Mon May 09, 2022 3:16 pm
Forum: Bug Reports
Topic: STM32H743 SPI
Replies: 13
Views: 17612

Re: STM32H743 SPI

I am sampling with 100MSPS so that should not be the problem. I have an STM32H743 with STM32_ENFORCE_H7_REV_XY. Will look into this problem more later, currently switched to V1 where the glitches only occur outside the SS.

Btw I'm not using polled mode at all.
by fvantienen
Mon May 09, 2022 3:13 pm
Forum: STM32 Support
Topic: Where to start STM32H7 support
Replies: 231
Views: 229220

Re: Where to start STM32H7 support

I finally figured out what was actually causing the problem and why I had to force a 25MHz clock for the SDC. It all had to do with a too low 'STM32_SDC_SDMMC_READ_TIMEOUT' and 'STM32_SDC_SDMMC_WRITE_TIMEOUT', which by default are 1000000. Not sure how to actually calculate the proper values, but I ...
by fvantienen
Mon May 02, 2022 3:40 pm
Forum: Bug Reports
Topic: STM32H743 SPI
Replies: 13
Views: 17612

Re: STM32H743 SPI

No I'm not using polled exchange and I checked that if I set it before the spiSelect everything works fine, but if I set it after the spiSelect it doesn't work. I can't actually look at see what happens on the SPI1 bus with an analyser. But I guess that it might either be a timing issue where the ...
by fvantienen
Mon May 02, 2022 2:51 pm
Forum: Bug Reports
Topic: STM32H743 SPI
Replies: 13
Views: 17612

Re: STM32H743 SPI

Ok figured out sort of why it wasn't working. It all has to do with

Code: Select all

SPI_CR1_SPE
. If you set it at then end of spi_lld_configure it works (this is done in v1 as well). Not sure why or what is wrong exactly, but this might give you some ideas and/or solutions.
by fvantienen
Mon May 02, 2022 2:25 pm
Forum: Bug Reports
Topic: STM32H743 SPI
Replies: 13
Views: 17612

Re: STM32H743 SPI

I will try to verify that caching problem and see if I set up everything correctly with your suggestions.

Currently ran into some other problem with the SPI V2 driver. Somehow it didn't work with SPID1 and if I debugged correctly I think each SPI transaction is just timing out without an interrupt ...
by fvantienen
Fri Apr 29, 2022 6:55 pm
Forum: Bug Reports
Topic: STM32H743 SPI
Replies: 13
Views: 17612

Re: STM32H743 SPI

Another weird thing I noticed is that when I do SPI transactions using non-cached memory, I still sometimes get incorrect memory.

#define STM32_NOCACHE_ENABLE TRUE
#define STM32_NOCACHE_MPU_REGION MPU_REGION_6
#define STM32_NOCACHE_RBAR 0x24000000U
#define STM32_NOCACHE_RASR MPU_RASR_SIZE_64K
&#46 ...
by fvantienen
Fri Apr 29, 2022 10:58 am
Forum: Bug Reports
Topic: STM32H743 SPI
Replies: 13
Views: 17612

Re: STM32H743 SPI

Ok I figured out where the clock pulse is generated and it is in:
spip->spi->CR1 &= ~SPI_CR1_SPE;

I haven't really looked into the SPI manuals from STM32. But doesn't this have to do with the SPI_CFG2_CPOL? Similarly the MOSI also generates a spike, but that is before the CS, so less of a problem ...
by fvantienen
Tue Apr 26, 2022 2:34 pm
Forum: Bug Reports
Topic: STM32H743 SPI
Replies: 13
Views: 17612

Re: STM32H743 SPI

Screenshot 2022-04-26 at 15.31.03.png
First transfer using spi V1

Screenshot 2022-04-26 at 15.31.44.png
Second (and later) transfer using spi V1

Based on my above tests I think that the problem for V1 is inside the spiStart as it is generating a spike before the CS. This might give an ...
by fvantienen
Tue Apr 26, 2022 2:12 pm
Forum: Bug Reports
Topic: STM32H743 SPI
Replies: 13
Views: 17612

STM32H743 SPI

With the spi_v2 driver using DMA in SPI4 I get some weird extra pulse in the clock signal while using spiExchange.

#define STM32_SPI_SPI4_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 3)
#define STM32_SPI_SPI4_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 4)

SPIConfig spi_cfg = {
false, // no circular buffer
#if ...