SDMMC2 on STM32F7 Discovery Topic is solved

Report here problems in any of ChibiOS components. This forum is NOT for support.
User avatar
Giovanni
Site Admin
Posts: 11312
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 412 times
Been thanked: 342 times
Contact:

Re: SDMMC2 on STM32F7 Discovery

Postby Giovanni » Sat Jan 20, 2018 12:17 pm

Committed.

Giovanni

networkfusion
Posts: 12
Joined: Thu May 18, 2017 11:57 am
Been thanked: 2 times

Re: SDMMC2 on STM32F7 Discovery

Postby networkfusion » Wed Aug 29, 2018 1:18 pm

Hi dflogeras,

Do you have any demo code for this? I am struggling to get it to work with the same board...

At the moment it just freezes when trying to mount...


TIA.

dflogeras
Posts: 165
Joined: Tue Sep 03, 2013 8:16 pm
Has thanked: 1 time
Been thanked: 5 times

Re: SDMMC2 on STM32F7 Discovery

Postby dflogeras » Wed Aug 29, 2018 1:40 pm

Hi,

I don't have anything right now that is easily boiled down. It is coupled to a bunch of my own stuff that would take more time to pull out than I have at this moment. I'm about to move house and all my development boards/equipment are packed up so I couldn't test anyway.

From what I recall, once Giovanni made the aforementioned changes (which are included in 18.2.1 IIRC), it worked out-of-box without any trickery. You have to remember to set

Code: Select all

#define STM32_SDC_SDMMC2 TRUE

in mcuconf.h, and of course use SDCD2 object when initializing the sdc subsystem (sdcStart(), sdcConnect(), etc. ).

Also, you instruct the fatfs bindings to use that device with

Code: Select all

#define FATFS_HAL_DEVICE SDCD2

I put a define in my halconf.h, otherwise it assumes SDCD1.

I also recall editing ffconf.h to support my card, since it had a DOS partition table on it, and the default assumes a whole disk filesystem (the way windows formats them). I believe the relevant settings were FF_VOLUMES and FF_MULTI_PARTITION, but that may not be your issue.

Sorry that's all I can say for now. With good luck, I'll be unpacked over the weekend and could pare down a basic demo, maybe we could even put it in testhal for others.

Let me know how you make out.

regards,
Dave

networkfusion
Posts: 12
Joined: Thu May 18, 2017 11:57 am
Been thanked: 2 times

Re: SDMMC2 on STM32F7 Discovery

Postby networkfusion » Thu Aug 30, 2018 2:31 pm

Thanks Dave, although I am still struggling and have depleted all options.

Just to be sure, did you make it work with STM32_DMA_STREAM_ID(2, 5) as in the first post, or was it STM32_DMA_STREAM_ID(2, 0) like in the current demos mcuconfig.h


My code is at https://github.com/nanoframework/nf-int ... CLR/main.c


good luck with the move...

networkfusion
Posts: 12
Joined: Thu May 18, 2017 11:57 am
Been thanked: 2 times

Re: SDMMC2 on STM32F7 Discovery

Postby networkfusion » Thu Aug 30, 2018 10:38 pm

I finally found the issue, in the demos it uses:

sdcStart(&SDCD2, NULL);

I changed this to be

static SDCConfig SDC_CFG;
sdcStart(&SDCD2, &SDC_CFG);

and it now works fine... I wonder if this is a bug...

Thanks for your input.

dflogeras
Posts: 165
Joined: Tue Sep 03, 2013 8:16 pm
Has thanked: 1 time
Been thanked: 5 times

Re: SDMMC2 on STM32F7 Discovery

Postby dflogeras » Wed Sep 05, 2018 4:54 pm

Interesting. If you leave that parameter NULL, it chooses the default SDCConfig, which in 18.2.1 is to use 4bit interface. Perhaps your card cannot handle that? It worked that way for me.

What did you set your local SDCConfig to?

Dave

networkfusion
Posts: 12
Joined: Thu May 18, 2017 11:57 am
Been thanked: 2 times

Re: SDMMC2 on STM32F7 Discovery

Postby networkfusion » Thu Sep 06, 2018 10:50 am

Nothing... I just set it as above...

User avatar
Giovanni
Site Admin
Posts: 11312
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 412 times
Been thanked: 342 times
Contact:

Re: SDMMC2 on STM32F7 Discovery

Postby Giovanni » Thu Sep 06, 2018 12:25 pm

So, SDC_CFG is not initialized? all zeroes?

Giovanni

networkfusion
Posts: 12
Joined: Thu May 18, 2017 11:57 am
Been thanked: 2 times

Re: SDMMC2 on STM32F7 Discovery

Postby networkfusion » Thu Sep 06, 2018 8:56 pm

Correct... The basic demo (which works) is here: https://github.com/nanoframework/nf-int ... CLR/main.c


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 1 guest