NETMF 4.4 SDIO driver

Hello,
As in my last post I am trying to develop a SDIO driver for the STM32F407 netmf 4.4
I’ve run into a roadblock and I am hoping someone can suggest something I am missing
or give me a kick in the rear.

I am using a GHI sdcard module wire wrapped to a STM32F407 DISVOVERY board. I used the
STMCubeX software to generate a MDK project, I build it and it works just great. Life is good :slight_smile:
I can initialize the card, read and write blocks etc.

So … I create a new driver in netmf 4.4 following the great instructions I found about netmf interop.
The driver integrates into netmf all well and good, however the code to initialize the sdcard fails.
The initial CMD0 works fine (go to idle) however the next command CMD8 (query voltages) fails
with a timeout.

When I create the CubeX version I use the exact same RCC setup that is used in the netmf bootstrap code. Again the
cubeX version works fine and the exact same CubeX code ported to netmf fails.

At the point netmf is performing the first access to the sdcard I check the RCC and SDIO registers and see they are
all set correctly in each case however the netmf version still fails.

I am completely out of ideas of what is different between the same 2 platforms. Identical hardware just a different
startup.

My gut tells me its a timing problem but I cannot see a difference to explain it. Both systems have a 48MHz clock
although the netmf uses a much higher system clock than the cube version.

Any ideas would be greatly appreciated. thanks!
dale

1 Like

It looks like I had a misconfigured clock line. All is working now.
When I have this running I will post it and offer it for inclusion into 4.4
Not sure why it appeared to be working in the cubeX version, but I will figure
it out someday. “No pain no gain” … cheers

2 Likes

Interesting ! Just wondering. Do you use DMA IO?

hey!
Did you manage to have it fixed? I am in the same dilemma. Using netmf 4.4 on my STM32F4Discovery and I thought Sd card support would be an inherent feature. I see that there is a driver (SD_BL_driver.cpp) in DeviceCode\Drivers\BlockStorage\SD

I am using a microsd card module but standard netmf code doesnt work (Using FileStream to open and write to files etc). I get a CLR_E_NOT_SUPPORTED exception.

Any hints?

You will need to link in the Filesystem and fat_fs code as well.

The driver for SD card that comes with the 4.4 distribution is an SPI
port version of the SD card. I am looking for SDIO code.

I have a version from the ST CubeMX program that generated the SDIO
code needed and I adapted it to net mf however it only works
in the debugger. At full speed the sd card times out. I am sure I have
some sort of timing problem, that is why I am looking for any other netmf SDIO
implementation so I can gather any clues of what is going wrong.

cheers

@ RobvanSchelven - No, I am just trying to get it to work with polling more for now.
cheers