Search found 7 matches

by donquichotte
Tue Jan 07, 2020 10:27 am
Forum: Bug Reports
Topic: SPIv3 issues
Replies: 21
Views: 29223

Re: SPIv3 issues


I am unable to reproduce this one, are 4 operations sufficient to trigger it? how many are "few" ?

It typically happens after hundreds of exchanges on my hardware, I am still trying to find a good way to reproduce it.

Why CSUSP at all, other than on spiStop? I guess it would have to do with ...
by donquichotte
Mon Jan 06, 2020 11:25 am
Forum: Bug Reports
Topic: SPIv3 issues
Replies: 21
Views: 29223

Re: SPIv3 issues

I checked out the fresh changes.

After a few exchanges, the driver gets stuck in

Code: Select all

while ((spip->spi->CR1 & SPI_CR1_CSTART) != 0) 


with OVR set in IER.

If spi_lld_wait_complete() just resets IFCR, i.e. the line above is commented, the driver appears to work.
by donquichotte
Fri Jan 03, 2020 4:46 pm
Forum: ChibiOS/HAL
Topic: MMC_SPI subsystem on STM32H743ZI
Replies: 9
Views: 8694

Re: MMC_SPI subsystem on STM32H743ZI

> I think there is no need to clear SUSPC, it is the interrupt flag and is not used, re-starting SPI is done using CSTART (which is cleared by SUSPC).

[1], p2220 says "[CSTART] is cleared by hardware when End of Transfer (EOT) flag is set", does that not mean that we don't have to clear it in ...
by donquichotte
Fri Jan 03, 2020 8:50 am
Forum: ChibiOS/HAL
Topic: MMC_SPI subsystem on STM32H743ZI
Replies: 9
Views: 8694

Re: MMC_SPI subsystem on STM32H743ZI

The issue was that in spi_lld_serve_dma_rx_interrupt() in spi_lld.c, the SPI driver was suspended with spip->spi->CR1 |= SPI_CR1_CSUSP, but never unsuspended by setting SUSPC in IFCR.

Is that expected behaviour? I now never suspend SPI. The other way would be to wake SPI up at the start of spi_lld ...
by donquichotte
Mon Dec 30, 2019 5:11 pm
Forum: ChibiOS/HAL
Topic: MMC_SPI subsystem on STM32H743ZI
Replies: 9
Views: 8694

Re: MMC_SPI subsystem on STM32H743ZI

Thanks Giovanni.

I figured out some more issues which I will put here in case someone runs into the same problem:

1) In order to initialize the SD card, one needs to generate the clock pulse train with NSS pulled high. Change to software slave-select management:
ChibiOS/os/hal/ports/STM32/LLD ...
by donquichotte
Fri Dec 27, 2019 4:05 pm
Forum: ChibiOS/HAL
Topic: MMC_SPI subsystem on STM32H743ZI
Replies: 9
Views: 8694

Re: MMC_SPI subsystem on STM32H743ZI

Thank you for your response.

It appears that the whole issue is a configuration problem, I forgot to set SPI_CFG1_DSIZE_VALUE(7) in the SPI driver config. Now the correct number of clock pulses are emitted, DMA works fine and spiIgnore() returns.

Now spiReceive() blocks sometimes, but I am sure ...
by donquichotte
Tue Dec 24, 2019 2:29 pm
Forum: ChibiOS/HAL
Topic: MMC_SPI subsystem on STM32H743ZI
Replies: 9
Views: 8694

MMC_SPI subsystem on STM32H743ZI

Dear all,

I am trying to use the MMC_SPI subsystem on an STM32H743ZI.

The application gets stuck in mmcConnect()/spiIgnore()/osalSuspendS(), just after spiIgnore(mmcp->config->spip, 16);

The call to osalSuspendS() just never returns. CS and the clock frequency behave as expected.

One weird thing ...