Page 2 of 3
Re: stm32f4 SDIO setup
Posted: Wed Mar 11, 2015 9:28 am
by Giovanni
That means that there is a DMA conflict, you are using another driver that uses the same DMA channel, please verify in mcuconf.h.
Giovanni
Re: stm32f4 SDIO setup
Posted: Wed Mar 11, 2015 12:30 pm
by daviddawe1982
Yes it is using the same DMA stream as SPI1 TX = STM32_DMA_STREAM_ID(2, 3)
I have an lcd connceted to SPI1
Re: stm32f4 SDIO setup
Posted: Wed Mar 11, 2015 1:21 pm
by Giovanni
Some peripherals can be relocated on other DMA channels, see the STM32 RM in the DMA section, you can change mcuconf.h in order to do that.
Giovanni
Re: stm32f4 SDIO setup
Posted: Thu Mar 12, 2015 1:07 pm
by daviddawe1982
So I got the DMA working and now the code does not stop but i still can not connect to the card.
How can I see what the error is with sdcConnect??
Below is my test code and it is printing..
Card Inserted.
Connecting...
Failed.
Code: Select all
sdcStart(&SDCD1, &sdccfg);
gdispClear(Black);
if (!blkIsInserted(&SDCD1)) {
line1 = "Card not inserted, aborting.";
fheight1 = gdispGetFontMetric(font1, fontHeight)+2;
gdispFillStringBox(0, 0, widthB, fheight1, line1, font1, White, Black, justifyCenter);
}else{
line1 = "Card inserted.";
gdispFillStringBox(0, 0, widthB, fheight1, line1, font1, White, Black, justifyCenter);
}
line1 = "Connecting...";
fheight1 = gdispGetFontMetric(font1, fontHeight)+2;
gdispFillStringBox(0, (fheight1*2), widthB, fheight1, line1, font1, White, Black, justifyCenter);
if (sdcConnect(&SDCD1)) {
line1 = "Failed.";
gdispFillStringBox(0, (fheight1*3), widthB, fheight1, line1, font1, White, Black, justifyCenter);
}else{
line1 = "Connected.";
gdispFillStringBox(0, (fheight1*3), widthB, fheight1, line1, font1, White, Black, justifyCenter);
}
Re: stm32f4 SDIO setup
Posted: Thu Mar 12, 2015 1:28 pm
by Giovanni
The best way is to step into the sdcConnect() and see where it fails. Provide the point and the state of relevant variables in that section of code.
Giovanni
Re: stm32f4 SDIO setup
Posted: Thu Mar 12, 2015 2:35 pm
by daviddawe1982
It looks like it fails just after card 2.0 detection and hits
return HAL_FAILED;
Re: stm32f4 SDIO setup
Posted: Thu Mar 12, 2015 2:37 pm
by daviddawe1982
I also have long wires connecting the sd could that be a problem?
Re: stm32f4 SDIO setup
Posted: Thu Mar 12, 2015 2:41 pm
by Giovanni
Definitely, it alredy happened to some users. You need short wires, terminations, bypass caps etc.
Giovanni
Re: stm32f4 SDIO setup
Posted: Fri Mar 13, 2015 2:26 pm
by daviddawe1982
I have rebuilt my interface and now sdcConnect exits at Voltage detection..
Re: stm32f4 SDIO setup
Posted: Fri Mar 13, 2015 2:39 pm
by Giovanni
That would be the very first command sent. I think it is a problem at interface level, the board setup probably, you need to make sure that:
1) The SDIO pins are not connected to other thing on the board.
2) That each SDIO pin is configured correctly in board.h.
3) That each SDIO signal is assigned to only one pin (multiple pins would conflict internally).
Giovanni