5 years, 8 months ago.

nRF52840 FATFileSystem & sd card boot error

Hello mbed forum,

The 'sd-driver' library works well on my custom nRF52840 board, but only after a 40 second delay at boot. Simply declaring the FATFileSystem causes the boot delay. Example:

This code causes a 40s delay everytime the NRF is repowered, then the led will blink:

include the mbed library with this snippet

#include "mbed.h"

DigitalOut redled(p6);
SDBlockDevice sd(p4, p5, p3, p2);
FATFileSystem fs("sd", &sd); //Line causes critical ~40sec delay in NRF boot -- otherwise works

int main() {
    for(;;) {
        redled=!redled;
        wait(.1);
    }
}

This code works perfectly (no delay):

include the mbed library with this snippet

#include "mbed.h"

DigitalOut redled(p6);
SDBlockDevice sd(p4, p5, p3, p2);
//FATFileSystem fs("sd", &sd); //Line causes critical ~40sec delay in NRF boot -- otherwise works

int main() {
    for(;;) {
        redled=!redled;
        wait(.1);
    }
}

I'm using mbed-os-5.9 and the latest sd-driver library.

Let me know if you have any ideas, thank you~

Matt

1 Answer

5 years, 8 months ago.

Hello Matthew,

Can you try applying this PR in your sd-driver library: https://github.com/ARMmbed/sd-driver/pull/104? Hopefully, this will fix that issue, this PR has not merge yet is because it is currently under testing.

Please let me know if you have any questions!

- Peter, team Mbed

If this solved your question, please make sure to click the "Thanks" link below!