Add SDcard SARA AFF

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,
Jan

Hi,

Thank you for the quick feedback.

I will try !

Hi,

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 https://www.waveshare.com/wiki/Micro_SD_Storage_Board , from the schematic the module allready has pullup resistors and decoupling capacitors , https://www.waveshare.com/w/upload/8/83/Micro-SD-Storage-Board-Schematic.pdf

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,
Jan

Hi,

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?

Thanks

Hi @angeliki,

Can you save the reset cause to the sd card?

See static void printCpuResetCause(Stream& stream) in:

Best regards,
Jan

Hi,

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.
https://www.arduino.cc/en/Reference/SD

Best regards,
Jan

Hi,

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 https://www.waveshare.com/wiki/Micro_SD_Storage_Board

on top we have tested with 2 libraries SD Arduino library and Sdfat Arduino library(https://github.com/greiman/SdFat).

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 : https://github.com/SodaqMoja/SodaqOne-UniversalTracker/blob/master/SodaqOneTracker/ublox.cpp#L178.

is this the correct library for sara aff gps ?

Thank you for the help and feedback

thnak you for your time.