Page 3 of 3
Re: SDMMC2 on STM32F7 Discovery
Posted: Sat Jan 20, 2018 12:17 pm
by Giovanni
Committed.
Giovanni
Re: SDMMC2 on STM32F7 Discovery
Posted: Wed Aug 29, 2018 1:18 pm
by networkfusion
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.
Re: SDMMC2 on STM32F7 Discovery
Posted: Wed Aug 29, 2018 1:40 pm
by dflogeras
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
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
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
Re: SDMMC2 on STM32F7 Discovery
Posted: Thu Aug 30, 2018 2:31 pm
by networkfusion
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.cgood luck with the move...
Re: SDMMC2 on STM32F7 Discovery
Posted: Thu Aug 30, 2018 10:38 pm
by networkfusion
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.
Re: SDMMC2 on STM32F7 Discovery
Posted: Wed Sep 05, 2018 4:54 pm
by dflogeras
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
Re: SDMMC2 on STM32F7 Discovery
Posted: Thu Sep 06, 2018 10:50 am
by networkfusion
Nothing... I just set it as above...
Re: SDMMC2 on STM32F7 Discovery
Posted: Thu Sep 06, 2018 12:25 pm
by Giovanni
So, SDC_CFG is not initialized? all zeroes?
Giovanni
Re: SDMMC2 on STM32F7 Discovery
Posted: Thu Sep 06, 2018 8:56 pm
by networkfusion