Page 1 of 1

Cannot get MMC to work under stm32f107

Posted: Wed Sep 21, 2011 7:42 pm
by mabl
Hello,

today I tried to upgrade my Chibios Code from revision 3223 to trunk (3313). Everything works great - except the mmc_spi interface to my sd card. It's still the same user code, and the hal interface has not changed between those revisions - so it ought to work, right?

The execution of the Thread hangs indefinitely (other Threads continue to work). in spiIgnore after _spi_wait_s(spip) is called. I suppose the spi transfer interrrupt get's not called again, and therfore the thread is not unsuspended.

Any idea what could be causing this?

Re: Cannot get MMC to work under stm32f107

Posted: Wed Sep 21, 2011 7:52 pm
by Giovanni
Most driver were updated in latest revisions but MMC_SPI is exactly the same, if there is something in the HAL then it must be the SPI driver. Which SPI port are you using?

Giovanni

Re: Cannot get MMC to work under stm32f107

Posted: Wed Sep 21, 2011 7:54 pm
by mabl
It's the Olimex Board, so it's SPID3.

Re: Cannot get MMC to work under stm32f107

Posted: Wed Sep 21, 2011 8:04 pm
by Giovanni
Made some SVN digging, I corrected a defect in the new DMA helper driver in revision 3328, the defect affected DMA2 so SPID3 was affected too. Do you mind updating to the latest revision and give it a try?

Giovanni

Re: Cannot get MMC to work under stm32f107

Posted: Wed Sep 21, 2011 8:17 pm
by mabl
Hi Giovanni,

the problem is still there (as of rev 3378). I also just made a quick and dirty adaption of the f103-fatfs demo to my Olimex board - it shows exactly the same behavior.

Update: Added the Olimex STM32P107 demo

Re: Cannot get MMC to work under stm32f107

Posted: Wed Sep 21, 2011 8:25 pm
by Giovanni
OK, found the problem, it was caused by the integration of the new DMA infrastructure in the SPI driver and incidentally affected SPID3. Try the latest revision.

Edit: re-updated, rev 3380.

Giovanni

Re: Cannot get MMC to work under stm32f107

Posted: Wed Sep 21, 2011 8:31 pm
by mabl
Great! It works now. Thank you so much for the fast support!

Re: Cannot get MMC to work under stm32f107

Posted: Wed Sep 21, 2011 8:33 pm
by Giovanni
Good, note that I updated the file again, there were two instances.

Giovanni

Re: Cannot get MMC to work under stm32f107

Posted: Wed Sep 21, 2011 8:34 pm
by mabl
Thx for the hint.