Skip to main content
Julien Bouille
Associate II
October 16, 2018
Solved

STM32 SDIO conflict with debuger opperations

  • October 16, 2018
  • 23 replies
  • 4071 views

Hi everybody,

i m facing issues interfacing High Speed SD memory cards.

With low speed type SD card everything look to work well. But when i use fast cards, i got error reads.

The thing is that only appen if the debug is running. Without the debuger attached to my board no problemes appen when using High speed sd cards.

Any one understand what could make the debugger interfer with the application ? Is there somekind of blocking events or interrupt or clock instability because of it that could make the sd card crash ?

tanks.

    This topic has been closed for replies.
    Best answer by Julien Bouille

    Probleme solved:

    The clock signal was a bit dirty. I added a filter at the end of the clock signal

    100ohm in series with 100pF connected to 3V3.

    It work now like a charm.

    Tanks you for helping :)

    23 replies

    Tesla DeLorean
    Guru
    October 16, 2018

    Don't memory view the SDIO/SDMMC FIFO, this will break things. See also Peripheral View.

    Polled mode has serious issues with interrupt and bus loading, use DMA, always.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Julien Bouille
    Associate II
    October 16, 2018

    Yes you are right i use polled SDIO mode.

    Maby i would be safer use DMA mode.

    Julien Bouille
    Associate II
    October 16, 2018

    i m now using the DMA to read the card.

    But there is still a probleme after few reads when debugger attached.

    I m suspecting EMC probleme.. dont know..

    Tesla DeLorean
    Guru
    October 16, 2018

    Whose debugger are you using? OpenOCD?

    Using Keil here, and really not suffering from issues on any of the F4, L4, F7 and H7 in current use, and working with bus speeds >60MHz >30MBps

    Would recommend pull-up resistors (33-47K) on D[0..3] and CMD pins close to socket.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    AvaTar
    Senior III
    October 17, 2018

    > But there is still a probleme after few reads when debugger attached.

    > I m suspecting EMC probleme.. dont know..

    I wouln't think so.

    EMI problems would manifest regardless of the debugger.

    Except you have both PCB tracks very close, and missing proper pull-ups on SDIO lines, as Clive suggested.

    Julien Bouille
    Associate II
    October 17, 2018

    I have tryed with and without pullup.

    I have shortened wires as much as possible, and added 3 capacitors close to 3v3. ( 10n, 100n and 100µ).

    I have got no probleme reading a class 1 sd card, when using class 10. It still crash after some reads.

    Julien Bouille
    Associate II
    October 17, 2018

    I supsected EMI because i have pointed that when probing clock signal, it was working longer without crashing.

    And also, when touching the card adapter with my hand while working, it was make things gooing beter too.

    Julien Bouille
    Associate II
    October 17, 2018

    The hardware i use is a Nucleo discovery board with a sd micro sd card adapter wired to it.

    Tesla DeLorean
    Guru
    October 17, 2018

    What board/chip are we talking about here, lets narrow things down a bit.

    For short traces you might want to back off on the slew rate, from say the VERY HIGH, to HIGH or MEDIUM settings.

    Here I've done writes and read back tests on the entire space of 200 and 400 GB cards, the run time here is quite significant.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Julien Bouille
    Associate II
    October 17, 2018

    STM32F446RE on discovery board.

    Even with lower clock rates the SDHC card refuse to work properly. Still no issues with the lowCost/lowSpeed one.

    It is the function f_read that come back with a "Low level IO error" ...

    After some debuging i ve discover a variable associate in timeout control that was set to zero in a unexpect way as it was set to some value in the beginin of the function and then was not writed anymore in it. So i m wondering if something is not overflowing on it. But why i should do it with some cards and not others ???