Hi ,

I want to use an SPI SDCard with my SARA AFF R412M.

The card is 5V powered and I am using the SD library with the default SS pin as CS.

Occasionally SD initialization fails and I need to restart the board. The actual problem though is that the SD card cannot be initialized at all while operating on LiPo battery.

Do I need any pull up resistors for SPI pins? Any ideas ?

Thank you in advance !

Hi @angeliki,

The 5V pin is only available when the USB is plugged in.

We often use an SD card reader in a custom made solution.
We always power the SD card from 3v3 since almost always our boards are 3v3.
Can you try if this also works for you?

Best regards,


Thank you for the quick feedback.

I will try !


based on your sugestions we successfully used an SD card with 3.3V . Though we experience random board restarts during operation with battery.

I am using SD module , from the schematic the module allready has pullup resistors and decoupling capacitors ,

Can you please help by providing some ideas on the board behavior?
On top can you shre the Sd modules you test with internally ?

Hi @angeliki,

What do you use for the base software?
Do you have a watchdog enabled? This can cause a reboot when you don’t reset before the timer expires. Do you have any log on where the board resets and what the board tell you the reset cause is?

Best regards,


No we dont have watchbog enabled. The logging class is using SD library arduino for writing to SD in combination with arduino-printf library. A buffer is flushed to SD file when is full , buffer_size= 512;

Only peripheral we use is the SD and an I2C BME280 env sensor.

I dodnt have any logs from the reboot. How can I take the reboot log oparating on battery?


Hi @angeliki,

Can you save the reset cause to the sd card?

See static void printCpuResetCause(Stream& stream) in:

Best regards,


thanks for the info. I will try to get the reset cause. In the mean time I cannot initialize the sd card since yesterday. can yu please share the libarayyou use for the sd and module type?

Thank you.

Hi @angeliki,

I use the default SD library of Arduino.

Best regards,


thanks for the info. We are testing with 2 sd card modules 3.3V and SanDisk micorSDs 32G:

  1. catalex sd card module
  2. waveshare sd card module

on top we have tested with 2 libraries SD Arduino library and Sdfat Arduino library(

in all cases/combinations, SD card begin fails randomly.
SD errorCode: 0X43,0XFF

is it possible that SPI interface is too low? what is the max speed for SPI?
any other ideas?

Best Regards,

Hi ,

to provide feedback , there was an issues with aconnection wihch was not stable. So now we dont see the sd card initialization issues any more.

Now we have the folowing issue. We are using the universal tracker source code for gps location. With a 120 seconds for timeout , after the 80 seconds the board hangs. We have isolated the problem to
ublox available funtion :

is this the correct library for sara aff gps ?

Thank you for the help and feedback

thnak you for your time.

HI @angeliki .

How did you manage to use the sd card with AFF with sdfat library?

In my case, sd.begin() halts the program. I cant get past this even after 5 minutes… Could you please offer me some tips?

I have :

#include "SdFat.h"
#include <SPI.h>

#define SD_CS 10
#define SD_SCLK 13
#define SD_MISO 12
#define SD_MOSI 11

And then later :

if (!sd.begin(SD_CS, SPI_HALF_SPEED )) {
// do things

This condition seems to freeze the system,

if i use SD.h with card.init, it works fine.