Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By Artur Gaspar
#24455 Thank you!
In this test I am not using the wifi , I'm just using the SD card and serial communication .
Compiled and programmed the ESP8266 , but when running I got these errors on the serial output . Using ReadWrite example:
Code: Select allInitializing SD card...
 ets Jan  8 2013,rst cause:4, boot mode:(3,7)

wdt reset
load 0x40100000, len 28780, room 16
tail 12
chksum 0xf0
ho 0 tail 12 room 4
load 0x3ffe8000, len 1332, room 12
tail 8
chksum 0xf9
load 0x3ffe8540, len 1888, room 0
tail 0
chksum 0x2e
csum 0x2e
rlInitializing SD card...
 ets Jan  8 2013,rst cause:4, boot mode:(3,7)

wdt reset
load 0x40100000, len 28780, room 16
tail 12
chksum 0xf0
ho 0 tail 12 room 4
load 0x3ffe8000, len 1332, room 12
tail 8
chksum 0xf9
load 0x3ffe8540, len 1888, room 0
tail 0
chksum 0x2e
csum 0x2e
rlInitializing SD card...



One thing caught my attention . Only the first time I compile I get the errors below .
At other times the build occurs usually without warning .

Code: Select all/home/porcao/Documents/Arduino-esp8266-sdk-1.0/arduino-1.6.5/libraries/SdFat/utility/StdioStream.cpp: In member function 'size_t StdioStream::print(const __FlashStringHelper*)':
/home/porcao/Documents/Arduino-esp8266-sdk-1.0/arduino-1.6.5/libraries/SdFat/utility/StdioStream.cpp:294:39: warning: 'section' attribute does not apply to types [-Wattributes]
   const char *p = (const char PROGMEM *)str;
                                       ^
/home/porcao/Documents/Arduino-esp8266-sdk-1.0/arduino-1.6.5/libraries/SdFat/utility/StdioStream.cpp:302:34: warning: 'section' attribute does not apply to types [-Wattributes]
   return p - (const char PROGMEM *)str;
                                  ^

Sketch uses 229,448 bytes (5%) of program storage space. Maximum is 4,194,304 bytes.
User avatar
By Artur Gaspar
#24457 Done!
Just comment a line: //pinMode(10, OUTPUT);

Here the code:
Code: Select all/*
  SD card read/write

 This example shows how to read and write data to and from an SD card file
 The circuit:
 * SD card attached to SPI bus as follows:
 ** MOSI - pin 11
 ** MISO - pin 12
 ** CLK - pin 13
 ** CS - pin 4

 created   Nov 2010
 by David A. Mellis
 modified 9 Apr 2012
 by Tom Igoe

 This example code is in the public domain.

 */
#define SD_CS_PIN SS
#include <SPI.h>
//#include <SD.h>
#include <SdFat.h>
SdFat SD;

File myFile;

void setup()
{
  // Open serial communications and wait for port to open:
  Serial.begin(115500);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
  }


  Serial.print("Initializing SD card...");
  // On the Ethernet Shield, CS is pin 4. It's set as an output by default.
  // Note that even if it's not used as the CS pin, the hardware SS pin
  // (10 on most Arduino boards, 53 on the Mega) must be left as an output
  // or the SD library functions will not work.
  //pinMode(10, OUTPUT);

  if (!SD.begin(SD_CS_PIN)) {
    Serial.println("initialization failed!");
    return;
  }
  Serial.println("initialization done.");

  // open the file. note that only one file can be open at a time,
  // so you have to close this one before opening another.
  myFile = SD.open("testedoarquivolongo.txt", FILE_WRITE);

  // if the file opened okay, write to it:
  if (myFile) {
    Serial.print("Writing to test.txt...");
    myFile.println("testing 1, 2, 3.");
    // close the file:
    myFile.close();
    Serial.println("done.");
  } else {
    // if the file didn't open, print an error:
    Serial.println("error opening test.txt");
  }

  // re-open the file for reading:
  myFile = SD.open("testedoarquivolongo.txt");
  if (myFile) {
    Serial.println("testedoarquivolongo.txt:");

    // read from the file until there's nothing else in it:
    while (myFile.available()) {
      Serial.write(myFile.read());
    }
    // close the file:
    myFile.close();
  } else {
    // if the file didn't open, print an error:
    Serial.println("error opening test.txt");
  }
}

void loop()
{
  // nothing happens after setup
  delay(0);
}


Thank you very much for your help ! When you comes to Brazil I buy you a beer !
User avatar
By mkeyno
#35099 hi
I've just used the last update of the SdFat library but it is working with Arduino ordinary board wheels both SdFat & SD library installed however when I switch to ESP-12 ver 1.0 board the SdFat library example compile well until reach the following compile line
\AppData\Local\Temp\build6727671956725305751.tmp\SdFat\utility\istream.cpp.o
\AppData\Local\Temp\build6727671956725305751.tmp\SdFat\utility\ostream.cpp.o
\AppData\Local\Temp\build6727671956725305751.tmp\SdFat\utility\StdioStream.cpp.o
\AppData\Local\Temp\build6727671956725305751.tmp/core.a -lm -lgcc -lhal -lphy -lnet80211 -llwip -lwpa -lmain -lpp -lsmartconfig -lwps -lcrypto -Wl,--end-group -L
\AppData\Local\Temp\build6727671956725305751.tmp

it seams the parameter for rest compiling is wrong and stop there

any idea really appreciated