I also tried to get sdcard running with ESP8266.
First problem was naming of pins in Espruino and naming on boards.
Figured out at the end that
NodeMCU.D1 is D5
NodeMCU.D2 is D4
NodeMCU.D3 is D0
NodeMCU.D4 is D2
NodeMCU.D5 is D14
NodeMCU.D6 is D12
NodeMCU.D7 is D13
NodeMCU.D8 is D15
NodeMCU.D9 is D3
NodeMCU.D10 is D1
Based on this connected D12 to mosi,D13 to miso and D14 to sck
cs of SDCard was connected to B15
Script now looked like this
var s = new SPI();
s.setup({mosi:NodeMCU.D7,miso:NodeMCU.D6,sck:NodeMCU.D5});
E.connectSDCard(s,NodeMCU.D8
fs = require("fs");
fs.readdir();
Running this I got a reset about 2 secs later.
To get some more information, switched ESP8266Log to serial0
var e = require("ESP8266");
e.setLog(2);
Running script above again error log and stackdump was sent to my terminal. This included information about the location where error occured.
First of all, there was an Fatal exception 9.
By comparing pc with listing, exception happened in check_fs (file ff.c)
Thats a part of reading boot sector on SDCard.
This point marked the end of my knowledge :-(
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I also tried to get sdcard running with ESP8266.
First problem was naming of pins in Espruino and naming on boards.
Figured out at the end that
NodeMCU.D1 is D5
NodeMCU.D2 is D4
NodeMCU.D3 is D0
NodeMCU.D4 is D2
NodeMCU.D5 is D14
NodeMCU.D6 is D12
NodeMCU.D7 is D13
NodeMCU.D8 is D15
NodeMCU.D9 is D3
NodeMCU.D10 is D1
Based on this connected D12 to mosi,D13 to miso and D14 to sck
cs of SDCard was connected to B15
Script now looked like this
Running this I got a reset about 2 secs later.
To get some more information, switched ESP8266Log to serial0
Running script above again error log and stackdump was sent to my terminal. This included information about the location where error occured.
First of all, there was an Fatal exception 9.
By comparing pc with listing, exception happened in check_fs (file ff.c)
Thats a part of reading boot sector on SDCard.
This point marked the end of my knowledge :-(