Access to an external sd card with LoPy or WiPy (firmware 1.6.11.b1): Guru meditation error.



  • Hi,
    I’m Marco Rainone, software engineer and collaborator of ICTP wireless laboratory (http://wireless.ictp.it/)
    In our laboratory we are testing some wipy 2.0 and lopy boards. Weeks ago we updated the boards firmware, installing ver. 1.6.11.b1.
    Our test are based on sample programs that we found here:
    https://docs.pycom.io/pycom_esp32/pycom_esp32/tutorial/index.html

    We have found a problem managing an external SD card, using the example described in:
    https://docs.pycom.io/pycom_esp32/library/machine.SD.html

    1. I have a lopy (or wipy 2.0, it does not matter) installed on the expansion board.
    2. on expansion board I’ve installed a 2GB SD card, empty and formatted with FAT32 in windows environment. The Sd has no errors: I’ve checked it with a disk tool.

    This is the example loaded to the pycom board (I’ve named it sdtst.py):
    from machine import SD
    import os
    sd = SD()
    os.mount(sd, '/sd')
    os.listdir('/sd')
    f = open('/sd/test.txt', 'w')
    f.write('Testing SD card write operations')
    f.close()
    f = open('/sd/test.txt', 'r')
    f.readall()
    f.close()

    using repl, I’ve launch the sdtst.py program using the command:

    import sdtst.py

    I immediately got a Guru meditation error:
    /Users/danicampora/Code/Pycom/esp-idf-2017-03-12/components/freertos/./queue.c:1444 (xQueueGenericReceive)- assert failed!
    abort() was called at PC 0x400844a9
    Guru Meditation Error: Core 0 panic'ed (abort)

    Backtrace: 0x40008155:0x3ffc54e0 0x40007d16:0x3ffc5500 0x401203bd:0x3ffc5540 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    …..
    ================= CORE DUMP END =================
    Rebooting...
    ets Jun 8 2016 00:22:57
    rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
    configsip: 0, SPIWP:0x00
    clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
    mode:QIO, clock div:2
    load:0x3fff9010,len:8
    load:0x3fff9018,len:248
    load:0x40078000,len:4056
    load:0x4009fc00,len:920
    entry 0x4009fde4
    I (1556) wifi: wifi firmware version: 90b1b8b
    I (1557) wifi: config NVS flash: disabled
    I (1557) wifi: config nano formating: disabled
    I (1572) wifi: Init dynamic tx buffer num: 32
    I (1573) wifi: wifi driver task: 3ffd5608, prio:23, stack:3584
    I (1573) wifi: Init static rx buffer num: 10
    I (1575) wifi: Init dynamic rx buffer num: 0
    I (1579) wifi: Init rx ampdu len mblock:7
    I (1583) wifi: Init lldesc rx ampdu entry mblock:4
    I (1587) wifi: wifi power manager task: 0x3ffda9c4 prio: 21 stack: 2560
    I (1594) wifi: sleep disable
    I (2583) wifi: wifi timer task: 3ffdba40, prio:22, stack:3584
    I (2599) wifi: Init ampdu: 0
    I (2599) wifi: mode : softAP (24:0a:c4:00:a8:1d)
    MicroPython v1.8.6-593-g8e4ed0fa on 2017-04-12; WiPy with ESP32
    Type "help()" for more information.

    I always got guru meditation error using another sd card (4GB, formatted FAT32) or changing board model used in the experiment (lopy instead of wipy) and changing the expansion board.

    To verify the instructions could be causing problems, I tried to comment the source leaving as little as possible.
    to get the core dump I just perform these steps:
    from machine import SD
    import os
    sd = SD()

    As a last resort, I updated the firmware to the latest version (1.6.12.b1) of a wipy board and repeated the tests.
    The execution of “sd = SD()” has always generated the same error.

    Finally, I have verified that the error does not occur if I run individually and sequentially the instructions of the previous example on repl command line prompt.
    In this case, all steps are executed correctly.

    Is there a quick fix for this problem?

    Marco Rainone



  • @mrainone @daniel Behavior confirmed. I added a few print statements between the lines to see where it fails. Sometimes it passed through the script, sometimes it just stalled, sometimes I get an guru mediation error. In case of failure, it happened at the statement:
    sd = SD()
    Pasting the scripts into REPL always works.
    The core dump starts with (calling for saint Daniel):

    /Users/danicampora/Code/Pycom/esp-idf-2017-03-12/components/freertos/./queue.c:1444 (xQueueGenericReceive)- assert failed!
    abort() was called at PC 0x40085501
    Guru Meditation Error: Core  0 panic'ed (abort)
    
    Backtrace: 0x40008155:0x3ffc5670 0x40007d16:0x3ffc5690 0x40125065:0x3ffc56d0 0x4019e230:0x3ffc5700 0x401977b4:0x3ffc5720 0x40197ba6:0x3ffc5770 0x400e0ee0:0x3ffc57a0 0x400df756:0x3ffc57f0 0x400f2b8e:0x3ffc5830 0x400eace0:0x3ffc5850 0x400f62e8:0x3ffc5870 0x400ee697:0x3ffc5910 0x400eace0:0x3ffc5990 0x400eb776:0x3ffc59b0 0x400f3d46:0x3ffc5a40 0x400f40b5:0x3ffc5a70 0x400eb602:0x3ffc5b50 0x400f65d4:0x3ffc5b90 0x400ee697:0x3ffc5c30 0x400eace0:0x3ffc5cb0 0x400ead09:0x3ffc5cd0 0x400d8c38:0x3ffc5cf0 0x400d8eb3:0x3ffc5d80 0x400d7f76:0x3ffc5dc0
    
    ================= CORE DUMP START =================
    YCgAAAwAAABsAQAA
    6D38P7BV/D9QX/w/
    wFT8P/Be/D8ubAAA7Dr8P+w6/D/oPfw/5Dr8PxQAAAAMf/s/DH/7P+g9/D8AAAAA
    BQAAAFQ//D9NaWNyb1B5AAAAAAAAAAAAAAAAAFBf/D8AAAAAIQAGAAUAAAABAAAA
    AAAAAMhm/D8AAAAAAAAAAAAAAAC4MPs/IDH7P4gx+z8AAAAAAAAAAAEAAAAAAAAA
    iKNCPwAAAABIHQBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAA==
    KYEIgFWBAEA2BwYAFn0AgHBW/D97AAAAewAAABAAAAD/////AAAAAOv///9UOfw/
    AQAAACQAAAAkAAAACAAAAP////8AAAAA/////wUAAAABAAAAAAAAAODCAED2wgBA
    AAAAAAgAAAD/////aBAIQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    


Pycom on Twitter