Page 1 of 1

STM32 F4: SDIO & SPI1 on the same DMA stream

Posted: Tue Jul 02, 2013 5:12 am
by Abhishek
Hello,

I faced a problem while building a UI application using the ChibiOS/GFX library, whenever I used the touchscreen [the TSC IC is connected on SPI1], I couldn't read from the SD Card as long as the touch screen was on. The application was freezing randomly, and while debugging, I found that FS_DISK_ERR was occurring. As long as I was not using the touchscreen, I could read from the SD card fine.

I later traced the problem to both the SPI1_TX and SDIO sharing the same DMA stream STM32_DMA_STREAM_ID(2, 3).

The issue was resolved, in my case, by changing in sdc_lld.h:

Code: Select all

#define STM32_SDC_SDIO_DMA_STREAM           STM32_DMA_STREAM_ID(2, 3)

to

Code: Select all

#define STM32_SDC_SDIO_DMA_STREAM           STM32_DMA_STREAM_ID(2, 6)


Regards
Abhishek

Re: STM32 F4: SDIO & SPI1 on the same DMA stream

Posted: Tue Jul 02, 2013 12:27 pm
by Giovanni
Hi,

Assertions enabled would have revealed that, it is always a good idea to keep debug options at TRUE while developing.

Giovanni

Re: STM32 F4: SDIO & SPI1 on the same DMA stream

Posted: Wed Jul 03, 2013 7:20 am
by alexblack
Hi,
This is a common problem with limited resources. I was very annoyed at the STM, as before designing the device I has to carefully choose which devices to use which functions to avoid conflict. No flexibility!

Re: STM32 F4: SDIO & SPI1 on the same DMA stream

Posted: Wed Jul 03, 2013 7:35 am
by Tectu
alexblack wrote:Hi,
This is a common problem with limited resources. I was very annoyed at the STM, as before designing the device I has to carefully choose which devices to use which functions to avoid conflict. No flexibility!

Do you have experiences with any alternatives? I am currently evaluating a project where I'd literally need all the peripherals of the STM32F407 and I don't have to tell you how this is not going to work out...


~ Tectu

Re: STM32 F4: SDIO & SPI1 on the same DMA stream

Posted: Wed Jul 03, 2013 7:57 am
by Giovanni
SPC5 devices have 16 DMA channels and a DMA-MUX that allows to associate any DMA channel to any peripheral. I would like to see that kind flexibility on the STM32 too. It would really not that hard to do.

Giovanni

Re: STM32 F4: SDIO & SPI1 on the same DMA stream

Posted: Thu Jul 04, 2013 1:24 pm
by alexblack
Hi,
Tectu wrote:Do you have experiences with any alternatives?
I am currently evaluating a project where I'd literally need all the peripherals of the STM32F407 and I don't have to tell you how this is not going to work out...
~ Tectu

I tried Atmel AT91SAM9XE512. It has individual DMA channel for every peripheral (in theory, I have not studied it well enough).
About using all peripherals on STM32 I think it is possible only with low peripherals speed and some restrictions, because not only DMA and bandwith resources for all peripherals is not enough, also it does not have enough pins, even in BGA176.