Committed.
Giovanni
SDMMC2 on STM32F7 Discovery Topic is solved
- Giovanni
- Site Admin
- Posts: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
-
- Posts: 18
- Joined: Thu May 18, 2017 11:57 am
- Has thanked: 1 time
- Been thanked: 6 times
Re: SDMMC2 on STM32F7 Discovery
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.
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
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
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
-
- Posts: 18
- Joined: Thu May 18, 2017 11:57 am
- Has thanked: 1 time
- Been thanked: 6 times
Re: SDMMC2 on STM32F7 Discovery
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...
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...
-
- Posts: 18
- Joined: Thu May 18, 2017 11:57 am
- Has thanked: 1 time
- Been thanked: 6 times
Re: SDMMC2 on STM32F7 Discovery
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.
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
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
What did you set your local SDCConfig to?
Dave
-
- Posts: 18
- Joined: Thu May 18, 2017 11:57 am
- Has thanked: 1 time
- Been thanked: 6 times
- Giovanni
- Site Admin
- Posts: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
-
- Posts: 18
- Joined: Thu May 18, 2017 11:57 am
- Has thanked: 1 time
- Been thanked: 6 times
Re: SDMMC2 on STM32F7 Discovery
Correct... The basic demo (which works) is here: https://github.com/nanoframework/nf-int ... CLR/main.c
Who is online
Users browsing this forum: No registered users and 54 guests