SD card access error

Hello , how are you?
I have problems in Access SD Card, made ​​the selection correctly for switch SPI/SD , created FAT16 and FAT32 partitions , tested examples of LSD library and not work . I made tests with a LAudio library running SD Card Files , Also without success . Fast Can you help me ? Thank you !

Hi,

  1. you can update the firmware and try again: seeedstudio.com/wiki/LinkIt_ … are_Update

  2. you should try the examples in LStorage, you can refer to here: github.com/Seeed-Studio/LinkIt- … e/examples

please have a try, thanks`

I did the firmware update now, the error persists, did the tests with the examples of said library without success. Concerning the LAudio library, can run audio files present in the flash memory with the call storageFlash however, with storageSD also does not work, what can I do?
Thank you!

Hello, Could you please post your test code here, I can have a try in my side. thanks.

I tested all examples of LStorage library and one below, the Laudio library.
This runs smoothly with the call storageFlash, but with the SD card (storageSD) does not.
Created partitions in FAT16 and FAT32, as logical and primary partitions, all without success. :frowning:

#include <LAudio.h>

#define KEY 5
char buff[120];
unsigned char KEY_NUM = 0;

enum{Play,SetVolume,Pause,Resume,Stop};

unsigned char Status_Value = Play;

void Scan_KEY()
{
if( digitalRead(KEY) == 0 )
{
delay(20); //延时20ms,去抖动
if( digitalRead(KEY) == 0 ) //查看按键是否按下
{
KEY_NUM = 1;
while(digitalRead(KEY) == 0); //松手检测
}
}
}

void setup()
{
LAudio.begin();
pinMode(KEY,INPUT_PULLUP);
Serial.begin(115200);
Change_Status(Play);
pinMode(8, OUTPUT);

}

void Change_Status(unsigned char status)
{
switch(status)
{
case Play:
LAudio.playFile( storageSD,(char*)“1.mp3”);
LAudio.setVolume(4);
Serial.println(“playOne”);
break;
case SetVolume:
LAudio.setVolume(6);
Serial.println(“setVolume”);
break;
case Pause:
LAudio.pause();
Serial.println(“pause”);
break;
case Resume:
LAudio.resume();
Serial.println(“resume”);
break;
case Stop:
LAudio.stop();
Serial.println(“stop”);
break;
default:
break;
}
}

void loop()
{
//digitalWrite(8, HIGH);
//digitalWrite(8,LOW);

AudioStatus status;
Scan_KEY();
status = LAudio.getStatus();
if(status == AudioEndOfFile)
{
Status_Value = Play;
Change_Status(Status_Value);
}
if(KEY_NUM == 1)
{
KEY_NUM = 0;
Change_Status(Status_Value);
Status_Value++;
if(Status_Value == Stop+1)
{
Status_Value = Play;
}
}

delay(1000);
}

Hello Again, how are you?
I did some testing with mp3 playing code described above and with the inclusion of LSD.h library and the call LSD.begin() and i succeeded in executing file using the SD card, the code was like this:

#include <LAudio.h>
#include <LSD.h>

#define KEY 5
char buff[120];
unsigned char KEY_NUM = 0;

enum{Play,SetVolume,Pause,Resume,Stop};

unsigned char Status_Value = Play;

void Scan_KEY()
{
if( digitalRead(KEY) == 0 )
{
delay(20); //延时20ms,去抖动
if( digitalRead(KEY) == 0 ) //查看按键是否按下
{
KEY_NUM = 1;
while(digitalRead(KEY) == 0); //松手检测
}
}
}

void setup()
{
LSD.begin();
LAudio.begin();

pinMode(KEY,INPUT_PULLUP);
Serial.begin(115200);
Change_Status(Play);
pinMode(8, OUTPUT);

}

void Change_Status(unsigned char status)
{
switch(status)
{
case Play:
LAudio.playFile( storageSD,(char*)“1.mp3”);
LAudio.setVolume(2);
Serial.println(“playOne”);
break;
case SetVolume:
LAudio.setVolume(6);
Serial.println(“setVolume”);
break;
case Pause:
LAudio.pause();
Serial.println(“pause”);
break;
case Resume:
LAudio.resume();
Serial.println(“resume”);
break;
case Stop:
LAudio.stop();
Serial.println(“stop”);
break;
default:
break;
}
}

void loop()
{
//digitalWrite(8, HIGH);
//digitalWrite(8,LOW);

AudioStatus status;
Scan_KEY();
status = LAudio.getStatus();
if(status == AudioEndOfFile)
{
Status_Value = Play;
Change_Status(Status_Value);
}
if(KEY_NUM == 1)
{
KEY_NUM = 0;
Change_Status(Status_Value);
Status_Value++;
if(Status_Value == Stop+1)
{
Status_Value = Play;
}
}

delay(1000);
}

Thank you for your attention and goodbye! :mrgreen:

nice job~ :mrgreen: