Problems with sd-card on v1.3 board

Posted on
    1. HW-reset of EspruinoBoard V1.3
    2. connect to webIDE
    3. upload this simple application and get a list of files on SD

      var fs = require("fs");
      console.log(fs.readdir());
      
    4. upload same 2nd time and get ERROR: Unable to list files : DISK_ERR

    5. upload same 3rd time and get ERROR: Unable to mount SD card : NOT_READY

    After HW reset, story starts again

  • Hmm... very strange - is this something new that's happening? It feels like I would have got a lot more complaints if that happened all the time.

    The filesystem code should get completely reset when the Web IDE resets the board, so you'd hope it would be in the same state each time.

    What if you:

    • Type reset();
    • Unplug the SD card, plug it back in
    • Upload your code again

    Does it work on a 1v4? No problem if you haven't tried. They should be identical.

  • I only have boards from first kickstarter (those are V1.3 aren't they?)
    Tried with unplug and plug after reset and got ERROR: Unable to mount SD card : NOT_READY
    I didn't use SD for some weeks now, before it worked fine.

  • Works fine with 1v79

  • Thanks... I'll take a look - looks like I did make some changes related to SD cards in 1v80, and they might have broken something.

  • Last working version I found is from 3rd of june 11:19

  • Thanks - you don't have process.env.GIT_COMMIT for it do you? It makes it easier for me to track down.

  • Last working (I found) is this b1e8bc895c31b638286733149f36ce63bfb6e217
    There are some other between this and next not working.
    They are without any binary and a few without matching binary.

  • I'm having a similar issue with the rev 1v4 pico. SD Card access stopped working at commit a35b05c4a9f31d13aa8ee9b4bd4ba86c82760c0f for me. It seems to be related to the device type enumeration and the addition of the serial status items:

    EV_SERIAL1_STATUS,
    EV_SERIAL2_STATUS,
    EV_SERIAL3_STATUS,
    EV_SERIAL4_STATUS,
    EV_SERIAL5_STATUS,
    EV_SERIAL6_STATUS,
    EV_SERIAL_STATUS_MAX = EV_SERIAL6_STATUS,

    I moved these down below the SPI devices and it appears to be working. There may be some remaining issues with the EV_DEVICE_MAX value.

    Submitted pull request with a possible fix... or hopefully at least part of the fix.

  • Thanks - this seems like a really odd one. What error did you get?

    I'm just wondering - could this have just been an issue with not doing a make clean?

  • Nope, I can reproduce here. I'm really struggling to see why this is happening!

  • Yeah, it seems like a really tricky one. I had to walk the commits between 1v82 and 1v83 to pinpoint the cause.

    My guess is some indirect bitwise error caused by the enum value of the SPI devices changing, or an even more indirect effect from the device count going over 32 and the max value / power of 2 adjustment.

  • Just FYI, issue was filed at https://github.com/espruino/Espruino/issues/696 and it seems this was fixed a while ago now

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Problems with sd-card on v1.3 board

Posted by Avatar for JumJum @JumJum

Actions