2015-01-12 07:00 AM
Hello,
I'm trying to do a very basic thing, emulate a USB flash drive through an Olimex P407 board. Real data is stored on a micro sd card. I used STM32CubeMX for the first time to generate the code (I used it for pin planning only so far). The USB part seems to work not that bad, but the SD card driver is unusable so far. Using non DMA calls I get CRC FAIL error, and using DMA, I get a DATA TIMOUT when checking for completion. If I remove the completion check, then I get RSP TIMEOUT errors. Are there known bugs in the HAL SD card driver ? Thomas.2015-01-12 07:19 AM
Please repost this Cube-related question in the dedicated ''software tools'' sub-forum.
https://my.st.com/public/STe2ecommunities/mcu/Lists/STM32Java/AllItems.aspx JW2015-01-13 02:55 AM
Hello,
Can you please share your configuration file (STM32CubeMX .ioc file). STM32CubeMX is responsible for generating the initialization code only. Do you think the problem encountered comes from this initialization code or rather from the underlying Cube library code (or from the application code itself) ? Thanks in advance for your feedback2015-01-14 12:52 AM
Hello,
Thanks for your reply. I attached the file. I'm guessing there is something wrong with DMA configuration, but there is no explanation on how to configure it (or I didn't find it ...). Thomas. ________________ Attachments : test.ioc : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0up&d=%2Fa%2F0X0000000bfX%2FVDF1Di01s.L9.8xSRSkWEWQNC1hRnCeMsqSfTlTNj00&asPdf=false2015-01-16 01:04 AM
Hello,
Any advice ? Thomas.2015-01-16 01:35 AM
Thomas,
I would like to give you an advice, but it depends whether you're an hobbyist, or a professional. Let give give both of them: * If you're an hobbyist, drop the HAL, go back to Peripheral Lib or stay at register level (only include stm32f4xx.h). The RM of the chip describe the process of initializing SDCards and you can learn the rest on the internet (eg. http://elm-chan.org/docs/mmc/mmc_e.html). Take the time to understand how SD work, it is really interesting, and write the code yourself. DMA and SDIO are not so complicated, and you will find support on this forum. * If you're a professional, the same advice apply, and you have the additional opportunity to hire a consultant. By the way, there are few people that can help you on HAL, mainly because it is new, and also because it has not been warmly received by experienced STM32 people (I let you search for endless debates / flamewars on the very same forum). BR2015-01-16 02:48 AM
Hello,
I'm a professional, but this is a small side project, and I cannot afford to spend more than a few days at max on it. If it doesn't work, then we'll just drop it (and it would cost us some money too). I'm pretty sure the solution is not that far, probably just a few things to tweak in the DMA or something. I just need to mount the micro SD card as a USB pen drive on an olimex STM32-H407 board. Thomas.2015-01-16 02:53 AM
I'm downloading STM32F4 standard peripheral Library ... I guess the STM32F407 is fully supported, and I hope to find an exemple project not too far from what I need.
Thomas.2015-01-16 07:08 AM
Hello,
There was a project in the std lib that uses uSD Card to emulate a USB pen drive. I based my design on this exemple project and it is working now. Thomas.