• After 6 weeks of occasional tries I got my sdcard working, yeah!

    I confirm the "Fatal exception 9" of @JumJum in check_fs-function of libs/filesystem/fat_sd/ff.c in this line:

    if ((LD_DWORD(&fs->win[BS_FilSysType]) & 0xFFFFFF) == 0x544146)         /* Check "FAT" string */
    

    Espruino uses the FatFs lib of ChaN in version R0.10a. ChaN has a later version (http://elm-chan.org/fsw/ff/archives.html­) which seem to be compatible and includes some bug fixes. One of them ist mentioned in the Changelog: "Fixed a potential problem of FAT access that can appear on disk error."

    The crashes were gone with the later version R0.10c. I have not testet it thoroughly yet, but it looks promising. Here is my small test code which was crashing the esp8266, and now it is printing the directory content as expected:

    var fs = require('fs');
    SPI1.setup({sck:D14, miso:D12, mosi:D13});
    SPI1.setup();
    E.connectSDCard(SPI1, D15);
    var e = require("ESP8266");
    e.setLog(2);
    console.log(fs.readdir("/"));
    

    For this is my first post here, I want to thank @Gordon and all community members for the great work! I'm convinced that Espruino is the best platform for learning how to program microcontrollers these days, as long as you don't use a not officially supported device and experiment with sophisticated features which are not compiled in by default. ;-)

About

Avatar for hartmut @hartmut started