cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeMX + STM32F407VGT6 + SDIO + atollic : has it even been tested ?

root
Associate II
Posted on January 12, 2015 at 16:00

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.
8 REPLIES 8
Posted on January 12, 2015 at 16:19

Please repost this Cube-related question in the dedicated ''software tools'' sub-forum.

https://my.st.com/public/STe2ecommunities/mcu/Lists/STM32Java/AllItems.aspx

JW
stm32cube-t
Senior III
Posted on January 13, 2015 at 11:55

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 feedback

root
Associate II
Posted on January 14, 2015 at 09:52

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=false
root
Associate II
Posted on January 16, 2015 at 10:04

Hello,

Any advice ?

Thomas.
stm322399
Senior
Posted on January 16, 2015 at 10:35

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).

BR

root
Associate II
Posted on January 16, 2015 at 11:48

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.
root
Associate II
Posted on January 16, 2015 at 11:53

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.
root
Associate II
Posted on January 16, 2015 at 16:08

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.